summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
Unidiff
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 61bd0c4..f5ed8d2 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -22,7 +22,7 @@
22#include <qpe/timestring.h> 22#include <qpe/timestring.h>
23#include <qpe/config.h> 23#include <qpe/config.h>
24#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
25#include <qpe/qprocess.h> 25//#include <qpe/qprocess.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/contact.h> 27#include <qpe/contact.h>
28#include <qpe/global.h> 28#include <qpe/global.h>
@@ -38,7 +38,7 @@
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qtimer.h> 39#include <qtimer.h>
40#include <qpixmap.h> 40#include <qpixmap.h>
41#include <qfileinfo.h> 41//#include <qfileinfo.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qtl.h> 43#include <qtl.h>
44 44
@@ -55,6 +55,7 @@ int SHOW_NOTES;
55int ONLY_LATER; 55int ONLY_LATER;
56int AUTOSTART; 56int AUTOSTART;
57int NEW_START=1; 57int NEW_START=1;
58QString AUTOSTART_TIMER;
58 59
59/* 60/*
60 * Constructs a Example which is a child of 'parent', with the 61 * Constructs a Example which is a child of 'parent', with the
@@ -126,15 +127,17 @@ void Today::setOwnerField(QString &message) {
126 * If registered against that today ist started on each resume. 127 * If registered against that today ist started on each resume.
127 */ 128 */
128void Today::autoStart() { 129void Today::autoStart() {
129 Config cfg("today"); 130 // Config cfg("today");
130 cfg.setGroup("Autostart"); 131 //cfg.setGroup("Autostart");
131 AUTOSTART = cfg.readNumEntry("autostart",1); 132 //AUTOSTART = cfg.readNumEntry("autostart",1);
133
132 if (AUTOSTART) { 134 if (AUTOSTART) {
133 QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); 135 QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)");
134 e << QString("add"); 136 e << QString("add");
135 e << QString("today"); 137 e << QString("today");
138 e << AUTOSTART_TIMER;
136 } else { 139 } else {
137 QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); 140 QCopEnvelope e("QPE/System", "autoStart(QString, QString)");
138 e << QString("remove"); 141 e << QString("remove");
139 e << QString("today"); 142 e << QString("today");
140 } 143 }
@@ -212,6 +215,10 @@ void Today::init() {
212 // should only later appointments be shown or all for the current day. 215 // should only later appointments be shown or all for the current day.
213 ONLY_LATER = cfg.readNumEntry("onlylater",1); 216 ONLY_LATER = cfg.readNumEntry("onlylater",1);
214 217
218 cfg.setGroup("Autostart");
219 AUTOSTART = cfg.readNumEntry("autostart",1);
220 AUTOSTART_TIMER = cfg.readEntry("autostartdelay", "0");
221
215 //db = new DateBookDB; 222 //db = new DateBookDB;
216} 223}
217 224
@@ -240,6 +247,8 @@ void Today::startConfig() {
240 conf->CheckBox3->setChecked(ONLY_LATER); 247 conf->CheckBox3->setChecked(ONLY_LATER);
241 // if today should be autostarted 248 // if today should be autostarted
242 conf->CheckBoxAuto->setChecked(AUTOSTART); 249 conf->CheckBoxAuto->setChecked(AUTOSTART);
250 // autostart only if device has been suspended for X minutes
251 conf->SpinBoxTime->setValue( AUTOSTART_TIMER.toInt() );
243 252
244 conf->exec(); 253 conf->exec();
245 254
@@ -249,7 +258,8 @@ void Today::startConfig() {
249 int notes = conf->CheckBox2->isChecked(); 258 int notes = conf->CheckBox2->isChecked();
250 int maxcharclip = conf->SpinBox7->value(); 259 int maxcharclip = conf->SpinBox7->value();
251 int onlylater = conf->CheckBox3->isChecked(); 260 int onlylater = conf->CheckBox3->isChecked();
252 int autostart =conf->CheckBoxAuto->isChecked(); 261 int autostart = conf->CheckBoxAuto->isChecked();
262 int autostartdelay = conf->SpinBoxTime->value();
253 263
254 cfg.writeEntry("maxlinestask",maxlinestask); 264 cfg.writeEntry("maxlinestask",maxlinestask);
255 cfg.writeEntry("maxcharclip", maxcharclip); 265 cfg.writeEntry("maxcharclip", maxcharclip);
@@ -259,6 +269,7 @@ void Today::startConfig() {
259 cfg.writeEntry("onlylater", onlylater); 269 cfg.writeEntry("onlylater", onlylater);
260 cfg.setGroup("Autostart"); 270 cfg.setGroup("Autostart");
261 cfg.writeEntry("autostart", autostart); 271 cfg.writeEntry("autostart", autostart);
272 cfg.writeEntry("autostartdelay", autostartdelay);
262 273
263 // sync it to "disk" 274 // sync it to "disk"
264 cfg.write(); 275 cfg.write();