summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
authorharlekin <harlekin>2003-02-10 21:28:14 (UTC)
committer harlekin <harlekin>2003-02-10 21:28:14 (UTC)
commitbbb3cdf8f91d567f6c2e786bd144b64bd679ff9a (patch) (unidiff)
tree9c622e670cab66c44d9bd079707945cf3c9bcb89 /core/pim/today/today.cpp
parentde272b8c47c3960a3fe574317fe2e6fb0c32e4af (diff)
downloadopie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.zip
opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.tar.gz
opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.tar.bz2
adapted to new refresh, datebookplugin still need some work
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp42
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
@@ -70,7 +70,8 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
70 m_refreshTimer = new QTimer( this ); 70 m_refreshTimer = new QTimer( this );
71 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 71 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
72 m_refreshTimer->start( 15000 ); 72 m_refreshTimer->start( 15000 );
73 refresh(); 73 init();
74 loadPlugins();
74 showMaximized(); 75 showMaximized();
75} 76}
76 77
@@ -136,6 +137,21 @@ void Today::init() {
136 cfg.setGroup( "General" ); 137 cfg.setGroup( "General" );
137 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 138 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
138 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); 139 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
140
141
142 // qDebug(" refresh ");
143 // set the date in top label
144 QDate date = QDate::currentDate();
145 QString time = ( tr( date.toString() ) );
146
147 DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) );
148
149 if ( layout ) {
150 delete layout;
151 }
152 layout = new QVBoxLayout( this );
153 layout->addWidget( Frame );
154 layout->addWidget( OwnerField );
139} 155}
140 156
141 157
@@ -266,6 +282,7 @@ void Today::loadPlugins() {
266 } 282 }
267 } 283 }
268 } 284 }
285 draw();
269} 286}
270 287
271 288
@@ -340,7 +357,7 @@ void Today::startConfig() {
340 confWidget = configWidgetList.next() ) { 357 confWidget = configWidgetList.next() ) {
341 confWidget->writeConfig(); 358 confWidget->writeConfig();
342 } 359 }
343 refresh(); 360 loadPlugins();
344 } else { 361 } else {
345 // since refresh is not called in that case , reconnect the signal 362 // since refresh is not called in that case , reconnect the signal
346 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 363 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
@@ -355,22 +372,13 @@ void Today::startConfig() {
355void Today::refresh() { 372void Today::refresh() {
356 init(); 373 init();
357 374
358 // qDebug(" refresh "); 375 QValueList<TodayPlugin>::Iterator it;
359 // set the date in top label 376 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
360 QDate date = QDate::currentDate(); 377 if ( !(*it).excludeRefresh ) {
361 QString time = ( tr( date.toString() ) ); 378 (*it).guiPart->refresh();
362 379 qDebug( "refresh" );
363 DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); 380 }
364
365 if ( layout ) {
366 delete layout;
367 } 381 }
368 layout = new QVBoxLayout( this );
369 layout->addWidget( Frame );
370 layout->addWidget( OwnerField );
371
372 loadPlugins();
373 draw();
374} 382}
375 383
376void Today::startApplication() { 384void Today::startApplication() {