-rw-r--r-- | core/pim/today/changelog | 4 | ||||
-rw-r--r-- | core/pim/today/opie-today.control | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 17 | ||||
-rw-r--r-- | core/pim/today/today.h | 4 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 14 | ||||
-rw-r--r-- | core/pim/today/todayconfig.h | 1 |
6 files changed, 39 insertions, 3 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog index 25d63ef..eb2496a 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog @@ -1,16 +1,20 @@ +0.5.2 + +* refresh settings + 0.5.1 * icons scalable and clickable again 0.5 * now fully plugin based 0.3.4 * "fill our business card now a clickable label" * Several bugfixes regarding todo section. 0.3.3 * Changed the logo so it better scales to bigger display and also diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control index 28087f9..267a195 100644 --- a/core/pim/today/opie-today.control +++ b/core/pim/today/opie-today.control @@ -1,16 +1,16 @@ Files: bin/today apps/1Pim/today.desktop pics/today/* Priority: optional Section: opie/applications Maintainer: Maximilian Reiß <harlekin@handhelds.org> Architecture: arm -Version: 0.5.1-$SUB_VERSION +Version: 0.5.2-$SUB_VERSION Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) License: GPL Description: today screen This today screen app gives an overview of appointments and todos. It also shows incoming and outgoing mails from opiemail. When using Opie (opie.handhelds.org) today can be autostarted on resume. It is highly configurable. 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 @@ -52,84 +52,98 @@ static QValueList<TodayPlugin> pluginList; Today::Today( QWidget* parent, const char* name, WFlags fl ) : TodayBase( parent, name, fl ) { QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); #if defined(Q_WS_QWS) #if !defined(QT_NO_COP) QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 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. */ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "message(QString)" ) { 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 ) ) { Contact cont = Contact::readVCard( file )[0]; QString returnString = cont.fullName(); OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); } else { OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); } } /** * Set the owner field with a given QString, for example per qcop. */ void Today::setOwnerField( QString &message ) { if ( !message.isEmpty() ) { OwnerField->setText( "<b>" + message + "</b>" ); } } /** * 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 */ void Today::loadPlugins() { QValueList<TodayPlugin>::Iterator tit; for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { (*tit).library->unload(); delete (*tit).library; } pluginList.clear(); QString path = QPEApplication::qpeDir() + "/plugins/today"; @@ -280,32 +294,33 @@ void Today::startConfig() { for ( confWidget = configWidgetList.first(); confWidget != 0; confWidget = configWidgetList.next() ) { confWidget->writeConfig(); } refresh(); } } /** * 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>" ) ); if ( layout ) { delete layout; } layout = new QVBoxLayout( this ); layout->addWidget( Frame ); layout->addWidget( OwnerField ); loadPlugins(); draw(); } diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 6f13df6..4485a0b 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -43,31 +43,35 @@ class Today : public TodayBase { Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~Today(); private slots: void startConfig(); void startAddressbook(); void startApplication(); void editCard(); void refresh(); private: void init(); void setOwnerField(); void setOwnerField(QString &string); void loadPlugins(); void draw(); + void setRefreshTimer( int ); private slots: void channelReceived(const QCString &msg, const QByteArray & data); private: TodayConfig *conf; QStringList m_excludeApplets; QStringList m_allApplets; + QTimer *m_refreshTimer; + + bool m_refreshTimerEnabled; int m_newStart; int m_iconSize; int m_maxCharClip; }; #endif diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index f9dd8f7..db1141a 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -86,35 +86,45 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); QHBox *hbox_inactive = new QHBox( tab_3 ); TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); TimeLabel->setText( tr( "minutes inactive" ) ); QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); QHBox *hbox_iconSize = new QHBox( tab_3 ); QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); iconSizeLabel->setText( tr( "Icon size" ) ); QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); SpinBoxIconSize->setMaxValue( 32 ); QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) ); + QHBox *hbox_refresh = new QHBox( tab_3 ); + QLabel *refreshLabel = new QLabel( hbox_refresh ); + refreshLabel->setText( tr( "Refresh" ) ); + QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); + SpinRefresh = new QSpinBox( hbox_refresh ); + SpinRefresh->setMinValue( 2 ); + SpinRefresh->setSuffix( tr( " seconds" ) ); + QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); + tab3Layout->addWidget( hbox_auto ); tab3Layout->addWidget( hbox_inactive ); tab3Layout->addWidget( hbox_iconSize ); + tab3Layout->addWidget( hbox_refresh ); TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); m_applets_changed = false; connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); readConfig(); showMaximized(); } /** * Autostart, uses the new (opie only) autostart method in the launcher code. * If registered against that today ist started on each resume. */ void TodayConfig::setAutoStart() { @@ -133,32 +143,34 @@ void TodayConfig::setAutoStart() { } /** * Read the config part */ void TodayConfig::readConfig() { Config cfg( "today" ); cfg.setGroup( "Autostart" ); m_autoStart = cfg.readNumEntry( "autostart", 1 ); CheckBoxAuto->setChecked( m_autoStart ); m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); SpinBoxTime->setValue( m_autoStartTimer ); cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); SpinBoxIconSize->setValue( m_iconSize ); + SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); + cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); } /** * Write the config part */ void TodayConfig::writeConfig() { Config cfg( "today" ); cfg.setGroup( "Plugins" ); if ( m_applets_changed ) { QStringList exclude; QStringList include; QStringList all_applets; @@ -179,33 +191,33 @@ void TodayConfig::writeConfig() { } } cfg.writeEntry( "ExcludeApplets", exclude, ',' ); cfg.writeEntry( "IncludeApplets", include, ',' ); cfg.writeEntry( "AllApplets", all_applets, ',' ); } cfg.setGroup( "Autostart" ); m_autoStart = CheckBoxAuto->isChecked(); cfg.writeEntry( "autostart", m_autoStart ); m_autoStartTimer = SpinBoxTime->value(); cfg.writeEntry( "autostartdelay", m_autoStartTimer ); m_iconSize = SpinBoxIconSize->value(); cfg.setGroup( "General" ); cfg.writeEntry( "IconSize", m_iconSize ); - + cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); // set autostart settings setAutoStart(); } void TodayConfig::moveSelectedUp() { QListViewItem *item = m_appletListView->selectedItem(); if ( item && item->itemAbove() ) { item->itemAbove()->moveItem( item ); } } void TodayConfig::moveSelectedDown() { QListViewItem *item = m_appletListView->selectedItem(); diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h index 827e106..68483c2 100644 --- a/core/pim/today/todayconfig.h +++ b/core/pim/today/todayconfig.h @@ -54,20 +54,21 @@ private: QMap<QString,QCheckListItem*> m_applets; int m_autoStart; int m_autoStartTimer; int m_iconSize; QStringList m_excludeApplets; bool m_applets_changed; QLabel* TextLabel2; QCheckBox* CheckBoxAuto; QWidget* tab_2; QWidget* tab_3; QLabel* TextLabel1; QSpinBox* SpinBox7; QLabel* TimeLabel; QSpinBox* SpinBoxTime; + QSpinBox* SpinRefresh; QSpinBox* SpinBoxIconSize; }; #endif |