summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-24 11:52:25 (UTC)
committer harlekin <harlekin>2002-10-24 11:52:25 (UTC)
commit667da4143ff65ac9502d55fb09ca8223b16a8994 (patch) (side-by-side diff)
treecc7f7762a8ba88f0e913515d572b788073066bce
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 (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/changelog4
-rw-r--r--core/pim/today/opie-today.control2
-rw-r--r--core/pim/today/today.cpp17
-rw-r--r--core/pim/today/today.h4
-rw-r--r--core/pim/today/todayconfig.cpp14
-rw-r--r--core/pim/today/todayconfig.h1
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,4 +1,8 @@
+0.5.2
+
+* refresh settings
+
0.5.1
* icons scalable and clickable again
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
@@ -2,9 +2,9 @@ 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
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
@@ -64,8 +64,11 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
#endif
#endif
setOwnerField();
+ m_refreshTimer = new QTimer( this );
+ connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+ m_refreshTimer->start( 15000 );
refresh();
showMaximized();
}
@@ -80,8 +83,16 @@ void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
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() {
@@ -110,14 +121,17 @@ void Today::setOwnerField( QString &message ) {
*/
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 ) );
+
}
/**
@@ -292,8 +306,9 @@ void Today::startConfig() {
*/
void Today::refresh() {
init();
+ qDebug(" refresh ");
// set the date in top label
QDate date = QDate::currentDate();
QString time = ( tr( date.toString() ) );
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
@@ -55,8 +55,9 @@ private:
void setOwnerField();
void setOwnerField(QString &string);
void loadPlugins();
void draw();
+ void setRefreshTimer( int );
private slots:
void channelReceived(const QCString &msg, const QByteArray & data);
@@ -64,8 +65,11 @@ private slots:
TodayConfig *conf;
QStringList m_excludeApplets;
QStringList m_allApplets;
+ QTimer *m_refreshTimer;
+
+ bool m_refreshTimerEnabled;
int m_newStart;
int m_iconSize;
int m_maxCharClip;
};
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
@@ -98,11 +98,21 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
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;
@@ -145,8 +155,10 @@ void TodayConfig::readConfig() {
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", ',' );
}
@@ -191,9 +203,9 @@ void TodayConfig::writeConfig() {
m_iconSize = SpinBoxIconSize->value();
cfg.setGroup( "General" );
cfg.writeEntry( "IconSize", m_iconSize );
-
+ cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 );
// set autostart settings
setAutoStart();
}
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
@@ -66,8 +66,9 @@ private:
QLabel* TextLabel1;
QSpinBox* SpinBox7;
QLabel* TimeLabel;
QSpinBox* SpinBoxTime;
+ QSpinBox* SpinRefresh;
QSpinBox* SpinBoxIconSize;
};
#endif