author | harlekin <harlekin> | 2002-03-13 00:03:08 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-13 00:03:08 (UTC) |
commit | 8e9330a8626076a3dd289a1abbe218eccd3a1784 (patch) (unidiff) | |
tree | 458506d9a708cf47c49268f8336b9ce7a7fafedd | |
parent | ffa1d178f1daedafe801183c8a41a06023423713 (diff) | |
download | opie-8e9330a8626076a3dd289a1abbe218eccd3a1784.zip opie-8e9330a8626076a3dd289a1abbe218eccd3a1784.tar.gz opie-8e9330a8626076a3dd289a1abbe218eccd3a1784.tar.bz2 |
many bugfixes, should work right now again, also now the dates are allways in the right order, at least i hope so
-rw-r--r-- | core/pim/today/changelog | 6 | ||||
-rw-r--r-- | core/pim/today/opie-today.control | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 41 | ||||
-rw-r--r-- | core/pim/today/today.h | 2 |
4 files changed, 39 insertions, 12 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog index ded4458..d0dd966 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog | |||
@@ -1,3 +1,9 @@ | |||
1 | 0.2.9 | ||
2 | |||
3 | * Many bugfixes. | ||
4 | * Today now apparently sorts the dates _allways_ right, i would assume it | ||
5 | to be a qt bug | ||
6 | |||
1 | 0.2.8 | 7 | 0.2.8 |
2 | 8 | ||
3 | * Appointments are now clickable (connection to datebook still missing) | 9 | * Appointments are now clickable (connection to datebook still missing) |
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control index 5ad8f01..f875624 100644 --- a/core/pim/today/opie-today.control +++ b/core/pim/today/opie-today.control | |||
@@ -3,7 +3,7 @@ Priority: optional | |||
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Maximilian Reiß <max.reiss@gmx.de> | 4 | Maintainer: Maximilian Reiß <max.reiss@gmx.de> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: 0.2.8-$SUB_VERSION | 6 | Version: 0.2.9-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION) |
8 | License: GPL | 8 | License: GPL |
9 | Description: today screen | 9 | Description: today screen |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 1cdc6b4..81d4d36 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -40,13 +40,12 @@ | |||
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 | 44 | ||
44 | //#include <iostream.h> | 45 | //#include <iostream.h> |
45 | //#include <unistd.h> | 46 | #include <unistd.h> |
46 | #include <stdlib.h> | 47 | #include <stdlib.h> |
47 | 48 | ||
48 | |||
49 | |||
50 | int MAX_LINES_TASK; | 49 | int MAX_LINES_TASK; |
51 | int MAX_CHAR_CLIP; | 50 | int MAX_CHAR_CLIP; |
52 | int MAX_LINES_MEET; | 51 | int MAX_LINES_MEET; |
@@ -62,7 +61,7 @@ int NEW_START=1; | |||
62 | * name 'name' and widget flags set to 'f' | 61 | * name 'name' and widget flags set to 'f' |
63 | */ | 62 | */ |
64 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 63 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
65 | : TodayBase( parent, name, fl ) { | 64 | : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) { |
66 | QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); | 65 | QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); |
67 | QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); | 66 | QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); |
68 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); | 67 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); |
@@ -195,6 +194,7 @@ void Today::startConfig() { | |||
195 | cfg.writeEntry("autostart", autostart); | 194 | cfg.writeEntry("autostart", autostart); |
196 | // sync it to "disk" | 195 | // sync it to "disk" |
197 | cfg.write(); | 196 | cfg.write(); |
197 | NEW_START=1; | ||
198 | draw(); | 198 | draw(); |
199 | autoStart(); | 199 | autoStart(); |
200 | } | 200 | } |
@@ -205,11 +205,16 @@ void Today::startConfig() { | |||
205 | */ | 205 | */ |
206 | void Today::getDates() { | 206 | void Today::getDates() { |
207 | QDate date = QDate::currentDate(); | 207 | QDate date = QDate::currentDate(); |
208 | QWidget* AllDateBookEvents = new QWidget( ); | 208 | |
209 | if (AllDateBookEvents) delete AllDateBookEvents; | ||
210 | AllDateBookEvents = new QWidget( ); | ||
209 | QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); | 211 | QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); |
210 | 212 | ||
211 | QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); | 213 | QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); |
212 | 214 | ||
215 | qBubbleSort(list); | ||
216 | // printf("Get dates\n"); | ||
217 | |||
213 | Config config( "qpe" ); | 218 | Config config( "qpe" ); |
214 | // if 24 h format | 219 | // if 24 h format |
215 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); | 220 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); |
@@ -221,30 +226,33 @@ void Today::getDates() { | |||
221 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); | 226 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); |
222 | it!=list.end(); ++it ) { | 227 | it!=list.end(); ++it ) { |
223 | 228 | ||
224 | count++; | ||
225 | 229 | ||
226 | if ( count <= MAX_LINES_MEET ) { | 230 | if ( count <= MAX_LINES_MEET ) { |
227 | 231 | ||
228 | QTime time = QTime::currentTime(); | 232 | QTime time = QTime::currentTime(); |
229 | 233 | ||
230 | if (!ONLY_LATER) { | 234 | if (!ONLY_LATER) { |
235 | count++; | ||
231 | DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); | 236 | DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); |
232 | layoutDates->addWidget(l); | 237 | layoutDates->addWidget(l); |
233 | connect (l, SIGNAL(editEvent(const Event &)), | 238 | connect (l, SIGNAL(editEvent(const Event &)), |
234 | this, SIGNAL(editEvent(const Event &))); | 239 | this, SLOT(editEvent(const Event &))); |
235 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { | 240 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { |
241 | count++; | ||
242 | |||
236 | // show only later appointments | 243 | // show only later appointments |
237 | DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents); | 244 | DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents); |
238 | layoutDates->addWidget(l); | 245 | layoutDates->addWidget(l); |
239 | connect (l, SIGNAL(editEvent(const Event &)), | 246 | connect (l, SIGNAL(editEvent(const Event &)), |
240 | this, SIGNAL(editEvent(const Event &))); | 247 | this, SLOT(editEvent(const Event &))); |
241 | } else { | 248 | } |
249 | } | ||
250 | } | ||
251 | if (ONLY_LATER && count==0) { | ||
242 | QLabel* noMoreEvents = new QLabel(AllDateBookEvents); | 252 | QLabel* noMoreEvents = new QLabel(AllDateBookEvents); |
243 | noMoreEvents->setText("No more appointments today"); | 253 | noMoreEvents->setText("No more appointments today"); |
244 | layoutDates->addWidget(noMoreEvents); | 254 | layoutDates->addWidget(noMoreEvents); |
245 | } | 255 | } |
246 | } | ||
247 | } | ||
248 | } else { | 256 | } else { |
249 | QLabel* noEvents = new QLabel(AllDateBookEvents); | 257 | QLabel* noEvents = new QLabel(AllDateBookEvents); |
250 | noEvents->setText("No appointments today"); | 258 | noEvents->setText("No appointments today"); |
@@ -253,6 +261,7 @@ void Today::getDates() { | |||
253 | 261 | ||
254 | layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); | 262 | layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); |
255 | sv1->addChild(AllDateBookEvents); | 263 | sv1->addChild(AllDateBookEvents); |
264 | AllDateBookEvents->show(); | ||
256 | 265 | ||
257 | 266 | ||
258 | } | 267 | } |
@@ -393,6 +402,16 @@ void Today::startDatebook() { | |||
393 | QCopEnvelope e("QPE/System", "execute(QString)"); | 402 | QCopEnvelope e("QPE/System", "execute(QString)"); |
394 | e << QString("datebook"); | 403 | e << QString("datebook"); |
395 | } | 404 | } |
405 | void Today::editEvent(const Event &e) { | ||
406 | startDatebook(); | ||
407 | |||
408 | //Dissabled for now as uid's not working properly | ||
409 | /* | ||
410 | while(!QCopChannel::isRegistered("QPE/Datebook")) sleep(1); | ||
411 | QCopEnvelope env("QPE/Datebook", "editEvent(int)"); | ||
412 | env << e.uid(); | ||
413 | */ | ||
414 | } | ||
396 | 415 | ||
397 | /* | 416 | /* |
398 | * launches todolist | 417 | * launches todolist |
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index b3f0654..0b4356c 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -47,6 +47,7 @@ class Today : public TodayBase { | |||
47 | void startDatebook(); | 47 | void startDatebook(); |
48 | void startMail(); | 48 | void startMail(); |
49 | void draw(); | 49 | void draw(); |
50 | void editEvent(const Event &e); | ||
50 | private: | 51 | private: |
51 | void init(); | 52 | void init(); |
52 | void getDates(); | 53 | void getDates(); |
@@ -58,6 +59,7 @@ class Today : public TodayBase { | |||
58 | private: | 59 | private: |
59 | DateBookDB *db; | 60 | DateBookDB *db; |
60 | todayconfig *conf; | 61 | todayconfig *conf; |
62 | QWidget* AllDateBookEvents; | ||
61 | //Config cfg; | 63 | //Config cfg; |
62 | int MAX_LINES_TASK; | 64 | int MAX_LINES_TASK; |
63 | int MAX_CHAR_CLIP; | 65 | int MAX_CHAR_CLIP; |