-rw-r--r-- | core/pim/today/today.cpp | 17 |
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 | |||
@@ -62,12 +62,15 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
62 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), | 62 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), |
63 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); | 63 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); |
64 | #endif | 64 | #endif |
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 | } |
71 | 74 | ||
72 | /** | 75 | /** |
73 | * Qcop receive method. | 76 | * Qcop receive method. |
@@ -78,12 +81,20 @@ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { | |||
78 | QString message; | 81 | QString message; |
79 | stream >> message; | 82 | stream >> message; |
80 | setOwnerField( message ); | 83 | setOwnerField( message ); |
81 | } | 84 | } |
82 | } | 85 | } |
83 | 86 | ||
87 | void 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 | */ |
87 | void Today::setOwnerField() { | 98 | void Today::setOwnerField() { |
88 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); | 99 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); |
89 | if ( QFile::exists( file ) ) { | 100 | if ( QFile::exists( file ) ) { |
@@ -108,18 +119,21 @@ void Today::setOwnerField( QString &message ) { | |||
108 | /** | 119 | /** |
109 | * Init stuff needed for today. Reads the config file. | 120 | * Init stuff needed for today. Reads the config file. |
110 | */ | 121 | */ |
111 | void Today::init() { | 122 | void 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 | ||
123 | /** | 137 | /** |
124 | * Load the plugins | 138 | * Load the plugins |
125 | */ | 139 | */ |
@@ -290,12 +304,13 @@ void Today::startConfig() { | |||
290 | * Refresh for the view. Reload all applets | 304 | * Refresh for the view. Reload all applets |
291 | * | 305 | * |
292 | */ | 306 | */ |
293 | void Today::refresh() { | 307 | void 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() ) ); |
299 | 314 | ||
300 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); | 315 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); |
301 | 316 | ||