author | harlekin <harlekin> | 2002-09-18 09:52:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-18 09:52:51 (UTC) |
commit | 15ecc4aa71878039ad40ce270fae06282d8e98c2 (patch) (side-by-side diff) | |
tree | 1b1cae7b89bdd3960da222542e99c05332610231 | |
parent | 01d31aeaa8d513bde8237a07ea0a48ac1b85c3c0 (diff) | |
download | opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.zip opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.tar.gz opie-15ecc4aa71878039ad40ce270fae06282d8e98c2.tar.bz2 |
reload plugins now on config change
-rw-r--r-- | core/pim/today/plugins/datebook/datebookevent.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginwidget.cpp | 6 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 58 | ||||
-rw-r--r-- | core/pim/today/today.h | 9 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 16 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 4 |
6 files changed, 40 insertions, 57 deletions
diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp index 1caf061..d4e8e1e 100644 --- a/core/pim/today/plugins/datebook/datebookevent.cpp +++ b/core/pim/today/plugins/datebook/datebookevent.cpp @@ -31,4 +31,6 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, OClickableLabel(parent,name,fl), event(ev) { + setAlignment( AlignTop ); + QString msg; @@ -91,6 +93,4 @@ QString DateBookEvent::ampmTime( QTime tm ) { -//extern QPEApplication *todayApp; - /* * starts the edit dialog as known from datebook diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index e4667ae..7948656 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -60,4 +60,6 @@ void DatebookPluginWidget::getDates() { QVBoxLayout* layoutDates = new QVBoxLayout( this ); + layoutDates->setSpacing( 1 ); + layoutDates->setMargin( 1 ); if ( db ) { @@ -106,6 +108,6 @@ void DatebookPluginWidget::getDates() { layoutDates->addWidget( noEvents ); } - - layoutDates->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + //layoutDates->addStretch(0); +// layoutDates->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); // how often refresh - later have qcop update calls in *db diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index f052a9f..7537631 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -65,7 +65,5 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) setOwnerField(); - init(); - loadPlugins(); - draw(); + refresh(); showMaximized(); } @@ -119,5 +117,4 @@ void Today::init() { // read config Config cfg( "today" ); - cfg.setGroup( "Applets" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); @@ -137,4 +134,5 @@ void Today::loadPlugins() { pluginList.clear(); + QString path = QPEApplication::qpeDir() + "/plugins/today"; QDir dir( path, "lib*.so" ); @@ -143,5 +141,4 @@ void Today::loadPlugins() { QStringList::Iterator it; - uint count = 0; for ( it = list.begin(); it != list.end(); ++it ) { TodayPluginInterface *iface = 0; @@ -157,4 +154,5 @@ void Today::loadPlugins() { plugin.name = QString(*it); + // find out if plugins should be shown if ( m_excludeApplets.grep( *it ).isEmpty() ) { plugin.active = true; @@ -177,5 +175,4 @@ void Today::loadPlugins() { 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 ); @@ -191,5 +188,4 @@ void Today::loadPlugins() { pluginList.append( plugin ); - count++; } else { qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); @@ -232,6 +228,6 @@ void Today::draw() { layout->addWidget( noPluginsActive ); } - - layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + //layout->addStretch(0); + //layout->addItem( new QSpacerItem( 1,1, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); } @@ -245,5 +241,4 @@ void Today::startConfig() { TodayPlugin plugin; - QList<ConfigWidget> configWidgetList; for ( uint i = 0; i < pluginList.count(); i++ ) { @@ -268,27 +263,26 @@ void Today::startConfig() { confWidget->writeConfig(); } + refresh(); + } +} - init(); - - TodayPlugin plugin; - QValueList<TodayPlugin> plugList; - 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; - } - plugList.append( plugin ); - } - pluginList = plugList; +/** + * Refresh for the view. Reload all applets + * + */ +void Today::refresh() { + init(); - draw(); + if ( layout ) { + delete layout; } -} + layout = new QVBoxLayout( this ); + layout->addWidget( Frame ); + layout->addWidget( OwnerField ); + loadPlugins(); + draw(); +} void Today::startAddressbook() { @@ -309,12 +303,4 @@ void Today::editCard() { } -/* - * launches an App - */ -void Today::launchApp( QString appName ) { - QCopEnvelope e( "QPE/System", "execute(QString)" ); - e << QString( appName ); -} - Today::~Today() { } diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 0a9a705..672adc4 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -43,10 +43,9 @@ class Today : public TodayBase { ~Today(); - private slots: +private slots: void startConfig(); void startAddressbook(); - void launchApp( QString appName ); void editCard(); - void draw(); + void refresh(); private: @@ -55,4 +54,6 @@ private: void setOwnerField(QString &string); void loadPlugins(); + void draw(); + private slots: @@ -63,6 +64,4 @@ private slots: QStringList m_excludeApplets; - QVBoxLayout *pluginLayout; - // QString m_autoStartTimer; int m_newStart; diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 74f4fa0..800ca5d 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp @@ -35,4 +35,6 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) layout = new QVBoxLayout( this ); + QVBoxLayout *mainLayout = new QVBoxLayout( this ); + QPalette pal = this->palette(); QColor col = pal.color( QPalette::Active, QColorGroup::Background ); @@ -78,12 +80,12 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) // Opiezilla - QLabel* Opiezilla = new QLabel( Frame, "OpieZilla"); + QLabel* Opiezilla = new QLabel( Frame, "OpieZilla" ); Opiezilla->setPixmap( opiezilla ); - Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47); + Opiezilla->setGeometry( QApplication::desktop()->width()-50 ,1, 45, 47 ); Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); // Ownerfield OwnerField = new OClickableLabel( this , "Owner" ); - OwnerField->setGeometry( QRect( 0,0, this->width(), 12 )); + OwnerField->setGeometry( QRect( 0, 0, this->width(), 12 ) ); OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); OwnerField->setMaximumHeight(12); @@ -91,11 +93,7 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) // config ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); - ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) ); - ConfigButton->setPixmap( config ); + ConfigButton->setGeometry( QRect( QApplication::desktop()->width()-80, 30, 25, 21 ) ); + ConfigButton->setPixmap( config ); ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); - - // -- layout -- - layout->addWidget( Frame ); - layout->addWidget( OwnerField ); } diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 79c4d1f..4f23471 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -58,6 +58,4 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags QVBoxLayout *layout = new QVBoxLayout( this ); TabWidget3 = new QTabWidget( this, "TabWidget3" ); - // TabWidget3->setFrameShape( QFrame::NoFrame ); - //TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) ); TabWidget3->setAutoMask( FALSE ); TabWidget3->setTabShape( QTabWidget::Rounded ); @@ -123,5 +121,5 @@ void TodayConfig::setAutoStart() { } else { QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); - e << QString( "remove"); + e << QString( "remove" ); e << QString( "today" ); } |