summaryrefslogtreecommitdiff
Side-by-side diff
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,12 +1,16 @@
+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.
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
@@ -56,40 +56,51 @@ Today::Today( QWidget* parent, const char* name, WFlags 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>" );
}
@@ -102,30 +113,33 @@ 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;
@@ -284,24 +298,25 @@ void Today::startConfig() {
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 );
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
@@ -47,27 +47,31 @@ 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
@@ -90,27 +90,37 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
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();
}
/**
@@ -137,24 +147,26 @@ void TodayConfig::setAutoStart() {
*/
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 ) {
@@ -183,25 +195,25 @@ void TodayConfig::writeConfig() {
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 );
}
}
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
@@ -58,16 +58,17 @@ private:
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