-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 ) connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); #endif #endif setOwnerField(); + m_refreshTimer = new QTimer( this ); + connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); + m_refreshTimer->start( 15000 ); refresh(); showMaximized(); } /** * Qcop receive method. @@ -78,12 +81,20 @@ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { QString message; stream >> message; setOwnerField( message ); } } +void Today::setRefreshTimer( int interval ) { + + if ( m_refreshTimerEnabled ) { + m_refreshTimer->changeInterval( interval ); + } +} + + /** * Initialises the owner field with the default value, the username */ void Today::setOwnerField() { QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); if ( QFile::exists( file ) ) { @@ -108,18 +119,21 @@ void Today::setOwnerField( QString &message ) { /** * Init stuff needed for today. Reads the config file. */ void Today::init() { // read config Config cfg( "today" ); - cfg.setGroup( "Plugins" ); + cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); m_allApplets = cfg.readListEntry( "AllApplets", ',' ); + cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); + m_refreshTimer->changeInterval( cfg.readNumEntry( "checkinterval", 15000 ) ); + } /** * Load the plugins */ @@ -290,12 +304,13 @@ void Today::startConfig() { * Refresh for the view. Reload all applets * */ 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>" ) ); |