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,6 +1,10 @@
+0.5.2
+
+* refresh settings
+
0.5.1
* icons scalable and clickable again
0.5
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,12 +1,12 @@
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.
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>" ) );
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
@@ -53,21 +53,25 @@ private slots:
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
@@ -96,15 +96,25 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
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 ( ) ) );
@@ -143,12 +153,14 @@ void TodayConfig::readConfig() {
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", ',' );
}
/**
@@ -189,13 +201,13 @@ void TodayConfig::writeConfig() {
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();
}
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
@@ -64,10 +64,11 @@ private:
QWidget* tab_2;
QWidget* tab_3;
QLabel* TextLabel1;
QSpinBox* SpinBox7;
QLabel* TimeLabel;
QSpinBox* SpinBoxTime;
+ QSpinBox* SpinRefresh;
QSpinBox* SpinBoxIconSize;
};
#endif