-rw-r--r-- | core/pim/today/today.cpp | 27 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 57 | ||||
-rw-r--r-- | core/pim/today/todayconfig.h | 39 |
3 files changed, 75 insertions, 48 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; | |||
55 | int ONLY_LATER; | 55 | int ONLY_LATER; |
56 | int AUTOSTART; | 56 | int AUTOSTART; |
57 | int NEW_START=1; | 57 | int NEW_START=1; |
58 | QString 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 | */ |
128 | void Today::autoStart() { | 129 | void 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(); |
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 500e8fb..905ec4b 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp | |||
@@ -1,11 +1,22 @@ | |||
1 | /**************************************************************************** | 1 | /* |
2 | ** Form implementation generated from reading ui file 'todayconfig.ui' | 2 | * todayconfig.cpp |
3 | ** | 3 | * |
4 | ** Created: Thu Feb 14 15:04:33 2002 | 4 | * --------------------- |
5 | ** by: The User Interface Compiler (uic) | 5 | * |
6 | ** | 6 | * begin : Sun 10 17:20:00 CEST 2002 |
7 | ** WARNING! All changes made in this file will be lost! | 7 | * copyright : (c) 2002 by Maximilian Reiß |
8 | ****************************************************************************/ | 8 | * email : max.reiss@gmx.de |
9 | * | ||
10 | */ | ||
11 | /*************************************************************************** | ||
12 | * * | ||
13 | * This program is free software; you can redistribute it and/or modify * | ||
14 | * it under the terms of the GNU General Public License as published by * | ||
15 | * the Free Software Foundation; either version 2 of the License, or * | ||
16 | * (at your option) any later version. * | ||
17 | * * | ||
18 | ***************************************************************************/ | ||
19 | |||
9 | #include "todayconfig.h" | 20 | #include "todayconfig.h" |
10 | 21 | ||
11 | #include <qcheckbox.h> | 22 | #include <qcheckbox.h> |
@@ -16,20 +27,12 @@ | |||
16 | #include <qwidget.h> | 27 | #include <qwidget.h> |
17 | #include <qlayout.h> | 28 | #include <qlayout.h> |
18 | #include <qvariant.h> | 29 | #include <qvariant.h> |
19 | #include <qwhatsthis.h> | 30 | //#include <qwhatsthis.h> |
20 | 31 | ||
21 | /* | ||
22 | * Constructs a todayconfig which is a child of 'parent', with the | ||
23 | * name 'name' and widget flags set to 'f' | ||
24 | * | ||
25 | * The dialog will by default be modeless, unless you set 'modal' to | ||
26 | * TRUE to construct a modal dialog. | ||
27 | */ | ||
28 | todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags fl ) | 32 | todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags fl ) |
29 | : QDialog( parent, name, modal, fl ) | 33 | : QDialog( parent, name, modal, fl ) { |
30 | { | ||
31 | if ( !name ) | 34 | if ( !name ) |
32 | setName( "todayconfig" ); | 35 | setName( "todayconfig" ); |
33 | resize( 175, 232 ); | 36 | resize( 175, 232 ); |
34 | setCaption( tr( "Today config" ) ); | 37 | setCaption( tr( "Today config" ) ); |
35 | 38 | ||
@@ -120,7 +123,6 @@ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags | |||
120 | SpinBox7 = new QSpinBox( Frame14, "SpinBox7" ); | 123 | SpinBox7 = new QSpinBox( Frame14, "SpinBox7" ); |
121 | SpinBox7->setGeometry( QRect( 115, 20, 58, 25 ) ); | 124 | SpinBox7->setGeometry( QRect( 115, 20, 58, 25 ) ); |
122 | SpinBox7->setMaxValue( 80 ); | 125 | SpinBox7->setMaxValue( 80 ); |
123 | SpinBox7->setValue( 30 ); | ||
124 | 126 | ||
125 | TextLabel2 = new QLabel( Frame14, "AutoStart" ); | 127 | TextLabel2 = new QLabel( Frame14, "AutoStart" ); |
126 | TextLabel2->setGeometry( QRect( 20, 60, 100, 45 ) ); | 128 | TextLabel2->setGeometry( QRect( 20, 60, 100, 45 ) ); |
@@ -132,15 +134,18 @@ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags | |||
132 | CheckBoxAuto = new QCheckBox (Frame14, "CheckBoxAuto" ); | 134 | CheckBoxAuto = new QCheckBox (Frame14, "CheckBoxAuto" ); |
133 | CheckBoxAuto->setGeometry( QRect( 158, 60, 27, 21 ) ); | 135 | CheckBoxAuto->setGeometry( QRect( 158, 60, 27, 21 ) ); |
134 | 136 | ||
137 | TimeLabel = new QLabel( Frame14, "TimeLabel" ); | ||
138 | TimeLabel->setGeometry( QRect ( 20, 120, 120, 45 ) ); | ||
139 | TimeLabel->setText( tr( "Activate the \n" | ||
140 | "autostart after how\n" | ||
141 | "many minutes?" ) ); | ||
142 | SpinBoxTime = new QSpinBox( Frame14, "TimeSpinner"); | ||
143 | SpinBoxTime->setGeometry( QRect( 115, 120, 58, 25 ) ); | ||
144 | |||
135 | TabWidget3->insertTab( tab_3, tr( "Misc" ) ); | 145 | TabWidget3->insertTab( tab_3, tr( "Misc" ) ); |
136 | 146 | ||
137 | } | 147 | } |
138 | 148 | ||
139 | /* | 149 | todayconfig::~todayconfig() { |
140 | * Destroys the object and frees any allocated resources | ||
141 | */ | ||
142 | todayconfig::~todayconfig() | ||
143 | { | ||
144 | // no need to delete child widgets, Qt does it all for us | ||
145 | } | 150 | } |
146 | 151 | ||
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h index 4739b5a..2986c4c 100644 --- a/core/pim/today/todayconfig.h +++ b/core/pim/today/todayconfig.h | |||
@@ -1,19 +1,29 @@ | |||
1 | /**************************************************************************** | 1 | /* |
2 | ** Form interface generated from reading ui file 'todayconfig.ui' | 2 | * todayconfig.h |
3 | ** | 3 | * |
4 | ** Created: Thu Feb 14 15:04:33 2002 | 4 | * --------------------- |
5 | ** by: The User Interface Compiler (uic) | 5 | * |
6 | ** | 6 | * begin : Sun 10 17:20:00 CEST 2002 |
7 | ** WARNING! All changes made in this file will be lost! | 7 | * copyright : (c) 2002 by Maximilian Reiß |
8 | ****************************************************************************/ | 8 | * email : max.reiss@gmx.de |
9 | * | ||
10 | */ | ||
11 | /*************************************************************************** | ||
12 | * * | ||
13 | * This program is free software; you can redistribute it and/or modify * | ||
14 | * it under the terms of the GNU General Public License as published by * | ||
15 | * the Free Software Foundation; either version 2 of the License, or * | ||
16 | * (at your option) any later version. * | ||
17 | * * | ||
18 | ***************************************************************************/ | ||
9 | #ifndef TODAYCONFIG_H | 19 | #ifndef TODAYCONFIG_H |
10 | #define TODAYCONFIG_H | 20 | #define TODAYCONFIG_H |
11 | 21 | ||
12 | #include <qvariant.h> | 22 | #include <qvariant.h> |
13 | #include <qdialog.h> | 23 | #include <qdialog.h> |
14 | //class QVBoxLayout; | 24 | //class QVBoxLayout; |
15 | class QHBoxLayout; | 25 | class QHBoxLayout; |
16 | class QGridLayout; | 26 | class QGridLayout; |
17 | class QCheckBox; | 27 | class QCheckBox; |
18 | class QFrame; | 28 | class QFrame; |
19 | class QLabel; | 29 | class QLabel; |
@@ -21,8 +31,7 @@ class QSpinBox; | |||
21 | class QTabWidget; | 31 | class QTabWidget; |
22 | class QWidget; | 32 | class QWidget; |
23 | 33 | ||
24 | class todayconfig : public QDialog | 34 | class todayconfig : public QDialog { |
25 | { | ||
26 | Q_OBJECT | 35 | Q_OBJECT |
27 | 36 | ||
28 | public: | 37 | public: |
@@ -49,7 +58,9 @@ public: | |||
49 | QFrame* Frame14; | 58 | QFrame* Frame14; |
50 | QLabel* TextLabel1; | 59 | QLabel* TextLabel1; |
51 | QSpinBox* SpinBox7; | 60 | QSpinBox* SpinBox7; |
61 | QLabel* TimeLabel; | ||
62 | QSpinBox* SpinBoxTime; | ||
52 | 63 | ||
53 | }; | 64 | }; |
54 | 65 | ||
55 | #endif // TODAYCONFIG_H | 66 | #endif |