-rw-r--r-- | core/pim/today/today.cpp | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 91028c8..1f758f2 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -69,9 +69,10 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) setOwnerField(); m_refreshTimer = new QTimer( this ); connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); m_refreshTimer->start( 15000 ); - refresh(); + init(); + loadPlugins(); showMaximized(); } /** @@ -135,8 +136,23 @@ void Today::init() { cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); + + + // qDebug(" refresh "); + // set the date in top label + QDate date = QDate::currentDate(); + QString time = ( tr( date.toString() ) ); + + DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); + + if ( layout ) { + delete layout; + } + layout = new QVBoxLayout( this ); + layout->addWidget( Frame ); + layout->addWidget( OwnerField ); } /** @@ -265,8 +281,9 @@ void Today::loadPlugins() { pluginList.append( tempPlugin ); } } } + draw(); } /** @@ -339,9 +356,9 @@ void Today::startConfig() { for ( confWidget = configWidgetList.first(); confWidget != 0; confWidget = configWidgetList.next() ) { confWidget->writeConfig(); } - refresh(); + loadPlugins(); } else { // since refresh is not called in that case , reconnect the signal connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); } @@ -354,24 +371,15 @@ void Today::startConfig() { */ void Today::refresh() { init(); - // qDebug(" refresh "); - // set the date in top label - QDate date = QDate::currentDate(); - QString time = ( tr( date.toString() ) ); - - DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); - - if ( layout ) { - delete layout; + QValueList<TodayPlugin>::Iterator it; + for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { + if ( !(*it).excludeRefresh ) { + (*it).guiPart->refresh(); + qDebug( "refresh" ); + } } - layout = new QVBoxLayout( this ); - layout->addWidget( Frame ); - layout->addWidget( OwnerField ); - - loadPlugins(); - draw(); } void Today::startApplication() { QCopEnvelope e( "QPE/System", "execute(QString)" ); |