summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
authorharlekin <harlekin>2002-10-24 11:52:25 (UTC)
committer harlekin <harlekin>2002-10-24 11:52:25 (UTC)
commit667da4143ff65ac9502d55fb09ca8223b16a8994 (patch) (unidiff)
treecc7f7762a8ba88f0e913515d572b788073066bce /core/pim/today/today.cpp
parentbb381ba95d321259295ff7fc02534281d21ded87 (diff)
downloadopie-667da4143ff65ac9502d55fb09ca8223b16a8994.zip
opie-667da4143ff65ac9502d55fb09ca8223b16a8994.tar.gz
opie-667da4143ff65ac9502d55fb09ca8223b16a8994.tar.bz2
today refreshes itself now by a timer, important for fast load and on retail rom which might not get the pim signal we will have soon - closes bug #335
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index dd98824..8184730 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -65,6 +65,9 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
65#endif 65#endif
66 66
67 setOwnerField(); 67 setOwnerField();
68 m_refreshTimer = new QTimer( this );
69 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
70 m_refreshTimer->start( 15000 );
68 refresh(); 71 refresh();
69 showMaximized(); 72 showMaximized();
70} 73}
@@ -81,6 +84,14 @@ void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
81 } 84 }
82} 85}
83 86
87void Today::setRefreshTimer( int interval ) {
88
89 if ( m_refreshTimerEnabled ) {
90 m_refreshTimer->changeInterval( interval );
91 }
92}
93
94
84/** 95/**
85 * Initialises the owner field with the default value, the username 96 * Initialises the owner field with the default value, the username
86 */ 97 */
@@ -111,12 +122,15 @@ void Today::setOwnerField( QString &message ) {
111void Today::init() { 122void Today::init() {
112 // read config 123 // read config
113 Config cfg( "today" ); 124 Config cfg( "today" );
114 cfg.setGroup( "Plugins" );
115 125
126 cfg.setGroup( "Plugins" );
116 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 127 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
117 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 128 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
129
118 cfg.setGroup( "General" ); 130 cfg.setGroup( "General" );
119 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 131 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
132 m_refreshTimer->changeInterval( cfg.readNumEntry( "checkinterval", 15000 ) );
133
120} 134}
121 135
122 136
@@ -293,6 +307,7 @@ void Today::startConfig() {
293void Today::refresh() { 307void Today::refresh() {
294 init(); 308 init();
295 309
310 qDebug(" refresh ");
296 // set the date in top label 311 // set the date in top label
297 QDate date = QDate::currentDate(); 312 QDate date = QDate::currentDate();
298 QString time = ( tr( date.toString() ) ); 313 QString time = ( tr( date.toString() ) );