summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-09-17 09:36:43 (UTC)
committer harlekin <harlekin>2002-09-17 09:36:43 (UTC)
commit03abe825f26678c34142e14f93cabd8f097d5bea (patch) (side-by-side diff)
tree39ea534ae903bf7699237dc8d19c4f34d955c0bf
parent537aee09b7df89a166debf5ffd14286cbb636898 (diff)
downloadopie-03abe825f26678c34142e14f93cabd8f097d5bea.zip
opie-03abe825f26678c34142e14f93cabd8f097d5bea.tar.gz
opie-03abe825f26678c34142e14f93cabd8f097d5bea.tar.bz2
some changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/configwidget.h4
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.cpp8
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.h1
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.cpp3
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.h6
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.h2
-rw-r--r--core/pim/today/plugins/todolist/todopluginconfig.h1
-rw-r--r--core/pim/today/today.cpp167
-rw-r--r--core/pim/today/today.h10
-rw-r--r--core/pim/today/todayconfig.cpp15
10 files changed, 105 insertions, 112 deletions
diff --git a/core/pim/today/configwidget.h b/core/pim/today/configwidget.h
index f449db4..02ce37a 100644
--- a/core/pim/today/configwidget.h
+++ b/core/pim/today/configwidget.h
@@ -5,8 +5,8 @@
-
class ConfigWidget : public QWidget {
+
public:
- ConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) {};
+ ConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) {} ;
virtual ~ConfigWidget() {};
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp
index d2a73df..9800e61 100644
--- a/core/pim/today/plugins/datebook/datebookplugin.cpp
+++ b/core/pim/today/plugins/datebook/datebookplugin.cpp
@@ -23,7 +23,2 @@
-#include "../../configwidget.h"
-
-#include <qpe/timestring.h>
-#include <qpe/config.h>
-
@@ -72,2 +67,3 @@ int DatebookPlugin::maxHeight() const {
-
+int main() {
+}
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h
index f2c4446..61dc9f3 100644
--- a/core/pim/today/plugins/datebook/datebookplugin.h
+++ b/core/pim/today/plugins/datebook/datebookplugin.h
@@ -22,3 +22,2 @@
-#include <qpe/datebookdb.h>
#include <opie/oclickablelabel.h>
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
index 7482f5e..51be40e 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
@@ -4,3 +4,2 @@
-
#include <qpe/config.h>
@@ -14,3 +13,3 @@
DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name)
- : ConfigWidget( parent, name ) {
+ : ConfigWidget( parent, name ) {
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h
index 33d3c4e..9505a2d 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfig.h
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h
@@ -4,3 +4,3 @@
-#include <qwidget.h>
+//#include <qwidget.h>
#include <qcheckbox.h>
@@ -12,3 +12,3 @@ class DatebookPluginConfig : public ConfigWidget {
- Q_OBJECT
+
@@ -16,3 +16,3 @@ public:
DatebookPluginConfig( QWidget *parent, const char *name );
- ~DatebookPluginConfig();
+ ~DatebookPluginConfig();
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h
index 77889d6..7e5006f 100644
--- a/core/pim/today/plugins/todolist/todoplugin.h
+++ b/core/pim/today/plugins/todolist/todoplugin.h
@@ -26,3 +26,2 @@
#include "../../todayplugininterface.h"
-#include "../../configwidget.h"
@@ -30,3 +29,2 @@ class TodolistPlugin : public TodayPluginObject {
-
public:
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h
index a46cc7c..6be4b1e 100644
--- a/core/pim/today/plugins/todolist/todopluginconfig.h
+++ b/core/pim/today/plugins/todolist/todopluginconfig.h
@@ -26,3 +26,2 @@ class TodolistPluginConfig : public ConfigWidget {
- Q_OBJECT
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 09540bd..d78b5b5 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -34,2 +34,3 @@
#include <qlayout.h>
+#include <qhbox.h>
#include <qtabwidget.h>
@@ -38,2 +39,12 @@
+struct TodayPlugin {
+ QLibrary *library;
+ TodayPluginInterface *iface;
+ TodayPluginObject *guiPart;
+ QHBox *guiBox;
+ QString name;
+ bool active;
+ int pos;
+};
+
static QValueList<TodayPlugin> pluginList;
@@ -54,3 +65,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
- pluginLayout = 0l;
+ // pluginLayout = 0l;
@@ -58,3 +69,4 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
init();
- refresh();
+ loadPlugins();
+ draw();
showMaximized();
@@ -126,2 +138,3 @@ void Today::loadPlugins() {
}
+ pluginList.clear();
@@ -141,3 +154,3 @@ void Today::loadPlugins() {
qDebug( "loading: %s", QString( path + "/" + *it ).latin1() );
- qDebug( QString(*it).latin1() );
+ qDebug( QString(*it) );
TodayPlugin plugin;
@@ -145,3 +158,3 @@ void Today::loadPlugins() {
plugin.iface = iface;
- plugin.name = QString(*it).latin1();
+ plugin.name = QString(*it);
@@ -153,2 +166,23 @@ void Today::loadPlugins() {
plugin.guiPart = plugin.iface->guiPart();
+
+ plugin.guiBox = new QHBox( this );
+ QPixmap plugPix;
+ plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 );
+ OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
+ plugIcon->setPixmap( plugPix );
+ QScrollView* sv = new QScrollView( plugin.guiBox );
+ QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
+ sv->setMinimumHeight( plugin.guiPart->minHeight() );
+ //sv->setMaximumHeight( plugin.guiPart->maxHeight() );
+ sv->setResizePolicy( QScrollView::AutoOneFit );
+ sv->setHScrollBarMode( QScrollView::AlwaysOff );
+ sv->setFrameShape( QFrame::NoFrame );
+ sv->addChild( plugWidget );
+
+ //plugin.guiBox->addWidget( plugIcon, 0, AlignTop );
+ //plugin.guiBox->addWidget( sv, 0, AlignTop );
+ plugin.guiBox->setStretchFactor( plugIcon, 1 );
+ plugin.guiBox->setStretchFactor( sv, 9 );
+ layout->addWidget( plugin.guiBox );
+
pluginList.append( plugin );
@@ -168,7 +202,2 @@ void Today::draw() {
- if ( pluginLayout ) {
- delete pluginLayout;
- }
- pluginLayout = new QVBoxLayout( layout );
-
if ( pluginList.count() == 0 ) {
@@ -186,25 +215,11 @@ void Today::draw() {
if ( plugin.active ) {
- QHBoxLayout* plugLayout = new QHBoxLayout( this );
- QPixmap plugPix;
- plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 );
- OClickableLabel* plugIcon = new OClickableLabel( this );
- plugIcon->setPixmap( plugPix );
- QScrollView* sv = new QScrollView( this );
- QWidget* plugWidget = plugin.guiPart->widget( sv->viewport() );
- // plugWidget->reparent( sv->viewport(), QPoint( 0, 0 ) );
- sv->setMinimumHeight( plugin.guiPart->minHeight() );
- //sv->setMaximumHeight( plugin.guiPart->maxHeight() );
-
- sv->setResizePolicy( QScrollView::AutoOneFit );
- sv->setHScrollBarMode( QScrollView::AlwaysOff );
- sv->setFrameShape( QFrame::NoFrame );
- sv->addChild( plugWidget );
-
- plugLayout->addWidget( plugIcon, 0, AlignTop );
- plugLayout->addWidget( sv, 0, AlignTop );
- plugLayout->setStretchFactor( plugIcon, 1 );
- plugLayout->setStretchFactor( sv, 9 );
- pluginLayout->addLayout( plugLayout );
- count++;
- }
+ qDebug( plugin.name + " is ACTIVE " );
+ // QHBoxLayout* plugLayout = new QHBoxLayout( this );
+ plugin.guiBox->show();
+ } else {
+ // plugin.guiWidget->hide();
+ qDebug( plugin.name + " is INACTIVE" );
+ plugin.guiBox->hide();
+ }
+ count++;
}
@@ -218,14 +233,2 @@ void Today::draw() {
layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
-
-
- // how often refresh - later have qcop update calls in *db
- // QTimer::singleShot( 20*1000, this, SLOT( draw() ) );
-}
-
-
-void Today::refresh() {
- loadPlugins();
- draw();
- qDebug( "redraw" );
-// QTimer::singleShot( 30*1000, this, SLOT( refresh() ) );
}
@@ -237,39 +240,49 @@ void Today::refresh() {
void Today::startConfig() {
- conf = new TodayConfig ( this, "", true );
-
- uint count = 0;
- TodayPlugin plugin;
-
- QList<ConfigWidget> configWidgetList;
- for ( uint i = 0; i < pluginList.count(); i++ ) {
- plugin = pluginList[i];
-
- // load the config widgets in the tabs
- if ( plugin.guiPart->configWidget( this ) != 0l ) {
- ConfigWidget* widget = plugin.guiPart->configWidget( this );
- widget->reparent( conf , QPoint( 0,0 ) );
- configWidgetList.append( widget );
- conf->TabWidget3->insertTab( widget, plugin.guiPart->appName() );
- }
- // set the order/activate tab
- conf->pluginManagement( plugin.name, plugin.guiPart->pluginName(),
+
+ TodayConfig conf( this, "dialog", true );
+
+ TodayPlugin plugin;
+
+ QList<ConfigWidget> configWidgetList;
+ for ( uint i = 0; i < pluginList.count(); i++ ) {
+ plugin = pluginList[i];
+
+ // load the config widgets in the tabs
+ if ( plugin.guiPart->configWidget( this ) != 0l ) {
+ ConfigWidget* widget = plugin.guiPart->configWidget( this );
+ configWidgetList.append( widget );
+ conf.TabWidget3->insertTab( widget, plugin.guiPart->appName() );
+ }
+ // set the order/activate tab
+ conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(),
Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) );
- count++;
- }
+ }
- conf->showMaximized();
+ conf.exec();
+ if ( conf.exec() == QDialog::Accepted ) {
+ conf.writeConfig();
+ ConfigWidget *confWidget;
+ for ( confWidget = configWidgetList.first(); confWidget != 0;
+ confWidget = configWidgetList.next() ) {
+ confWidget->writeConfig();
+ }
+ init();
- if ( conf->exec() == QDialog::Accepted ) {
- ConfigWidget *confWidget;
- for ( confWidget=configWidgetList.first(); confWidget != 0;
- confWidget = configWidgetList.next() ) {
- confWidget->writeConfig();
- }
- conf->writeConfig();
- init();
- loadPlugins();
- draw();
- }
- delete conf;
+ TodayPlugin plugin;
+ for ( uint i = 0; i < pluginList.count(); i++ ) {
+ plugin = pluginList[i];
+
+ if ( m_excludeApplets.grep( plugin.name ).isEmpty() ) {
+ qDebug("CONFIG" + plugin.name + "ACTIVE");
+ plugin.active = true;
+ } else {
+ qDebug("CONFIG" + plugin.name + "INACTIVE");
+
+ plugin.active = false;
+ }
+ }
+
+ draw();
+ }
}
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index ca17020..0a9a705 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -24,2 +24,3 @@
#include <qlist.h>
+#include <qhbox.h>
@@ -34,10 +35,2 @@ class QVBoxLayout;
-struct TodayPlugin {
- QLibrary *library;
- TodayPluginInterface *iface;
- TodayPluginObject *guiPart;
- QString name;
- bool active;
- int pos;
-};
@@ -57,3 +50,2 @@ class Today : public TodayBase {
void draw();
- void refresh();
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 08e59c0..79c4d1f 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -32,6 +32,4 @@
-// for getenv
-#include <stdlib.h>
-
class ToolButton : public QToolButton {
+
public:
@@ -39,3 +37,3 @@ public:
: QToolButton( parent, name ) {
- setTextLabel( name );
+ // setTextLabel( name );
setPixmap( Resource::loadPixmap( icon ) );
@@ -54,8 +52,5 @@ public:
*/
-TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl )
+TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl ) {
- if ( !name ) {
- setName( "todayconfig" );
- }
setCaption( tr( "Today config" ) );
@@ -64,3 +59,4 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags
TabWidget3 = new QTabWidget( this, "TabWidget3" );
- TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) );
+ // TabWidget3->setFrameShape( QFrame::NoFrame );
+ //TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) );
TabWidget3->setAutoMask( FALSE );
@@ -109,2 +105,3 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags
readConfig();
+ showMaximized();
}