summaryrefslogtreecommitdiff
path: root/core
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 /core
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') (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,3 +1,7 @@
+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
@@ -3,7 +3,7 @@ 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
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 )
#endif
setOwnerField();
+ m_refreshTimer = new QTimer( this );
+ connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+ m_refreshTimer->start( 15000 );
refresh();
showMaximized();
}
@@ -81,6 +84,14 @@ void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
}
}
+void Today::setRefreshTimer( int interval ) {
+
+ if ( m_refreshTimerEnabled ) {
+ m_refreshTimer->changeInterval( interval );
+ }
+}
+
+
/**
* Initialises the owner field with the default value, the username
*/
@@ -111,12 +122,15 @@ 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 ) );
+
}
@@ -293,6 +307,7 @@ 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
@@ -56,6 +56,7 @@ private:
void setOwnerField(QString &string);
void loadPlugins();
void draw();
+ void setRefreshTimer( int );
private slots:
void channelReceived(const QCString &msg, const QByteArray & data);
@@ -65,6 +66,9 @@ private slots:
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
@@ -99,9 +99,19 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
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;
@@ -146,6 +156,8 @@ 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", ',' );
@@ -192,7 +204,7 @@ void TodayConfig::writeConfig() {
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
@@ -67,6 +67,7 @@ private:
QSpinBox* SpinBox7;
QLabel* TimeLabel;
QSpinBox* SpinBoxTime;
+ QSpinBox* SpinRefresh;
QSpinBox* SpinBoxIconSize;
};