author | harlekin <harlekin> | 2002-05-07 14:03:52 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-05-07 14:03:52 (UTC) |
commit | 8ba0398d93f0e70ea2de254a4090d8bd02f593cd (patch) (unidiff) | |
tree | 25de91d3eb02cbc496b232676406e5c1076f0128 | |
parent | 2dc0b530ab0ced8f840064bdb4d294a243894325 (diff) | |
download | opie-8ba0398d93f0e70ea2de254a4090d8bd02f593cd.zip opie-8ba0398d93f0e70ea2de254a4090d8bd02f593cd.tar.gz opie-8ba0398d93f0e70ea2de254a4090d8bd02f593cd.tar.bz2 |
clickable label is now in libopie
-rw-r--r-- | core/pim/today/changelog | 7 | ||||
-rw-r--r-- | core/pim/today/clickablelabel.cpp | 31 | ||||
-rw-r--r-- | core/pim/today/clickablelabel.h | 20 | ||||
-rw-r--r-- | core/pim/today/opie-today.control | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/today.h | 6 | ||||
-rw-r--r-- | core/pim/today/today.pro | 4 |
7 files changed, 15 insertions, 59 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog index 0bc5fe0..c687cea 100644 --- a/core/pim/today/changelog +++ b/core/pim/today/changelog | |||
@@ -1,85 +1,92 @@ | |||
1 | 0.3.3 | ||
2 | |||
3 | * Changed the logo so it better scales to bigger display and also | ||
4 | made the "Today" string translatable. | ||
5 | * some am/pm fixes | ||
6 | * clickable labels now in libopie | ||
7 | |||
1 | 0.3.2 | 8 | 0.3.2 |
2 | 9 | ||
3 | * Autostart is now more configurable. You can decide how long | 10 | * Autostart is now more configurable. You can decide how long |
4 | the ipaq has to has been suspended, before autostart is triggered.(Opie | 11 | the ipaq has to has been suspended, before autostart is triggered.(Opie |
5 | only) | 12 | only) |
6 | * am/pm time optinal (autodetect) | 13 | * am/pm time optinal (autodetect) |
7 | 14 | ||
8 | 0.3.1 | 15 | 0.3.1 |
9 | 16 | ||
10 | * fixed the wrong color of the buttons | 17 | * fixed the wrong color of the buttons |
11 | * better translation (thanks carsten and others) | 18 | * better translation (thanks carsten and others) |
12 | * fixes memory leaks | 19 | * fixes memory leaks |
13 | * bugfixes in calendar part, now location and note are working again. | 20 | * bugfixes in calendar part, now location and note are working again. |
14 | 21 | ||
15 | 0.3.0 | 22 | 0.3.0 |
16 | 23 | ||
17 | * today uses now tododb from libopie. So major changes in the todo part: | 24 | * today uses now tododb from libopie. So major changes in the todo part: |
18 | - overdue items on top | 25 | - overdue items on top |
19 | - then sorted by date, then by priority | 26 | - then sorted by date, then by priority |
20 | * some cleanups | 27 | * some cleanups |
21 | * speed optimisations | 28 | * speed optimisations |
22 | 29 | ||
23 | 0.2.9 | 30 | 0.2.9 |
24 | 31 | ||
25 | * Many bugfixes. | 32 | * Many bugfixes. |
26 | * Today now apparently sorts the dates _allways_ right, i would assume it | 33 | * Today now apparently sorts the dates _allways_ right, i would assume it |
27 | to be a qt bug | 34 | to be a qt bug |
28 | 35 | ||
29 | 0.2.8 | 36 | 0.2.8 |
30 | 37 | ||
31 | * Appointments are now clickable (connection to datebook still missing) | 38 | * Appointments are now clickable (connection to datebook still missing) |
32 | * autostart support (opie only) | 39 | * autostart support (opie only) |
33 | 40 | ||
34 | 0.2.7 | 41 | 0.2.7 |
35 | 42 | ||
36 | * check if todolist.xml was changed before parsing it | 43 | * check if todolist.xml was changed before parsing it |
37 | * check only every 30 sec for changes. | 44 | * check only every 30 sec for changes. |
38 | * some visual stuff | 45 | * some visual stuff |
39 | * as usual many little improvements .-) | 46 | * as usual many little improvements .-) |
40 | 47 | ||
41 | 0.2.6 | 48 | 0.2.6 |
42 | 49 | ||
43 | * added scrollbars to dates and todo | 50 | * added scrollbars to dates and todo |
44 | * all day detection | 51 | * all day detection |
45 | * some smaller bugfixes | 52 | * some smaller bugfixes |
46 | 53 | ||
47 | 0.2.5 | 54 | 0.2.5 |
48 | 55 | ||
49 | * some other minor fixes regarding autoupdate | 56 | * some other minor fixes regarding autoupdate |
50 | * fixed segfault with todolist > 7 entries | 57 | * fixed segfault with todolist > 7 entries |
51 | * fixed the "ugly grey border around buttons" issue | 58 | * fixed the "ugly grey border around buttons" issue |
52 | * fixed the "empty calendar field" "bug" | 59 | * fixed the "empty calendar field" "bug" |
53 | * shown only later appointments as option | 60 | * shown only later appointments as option |
54 | 61 | ||
55 | 62 | ||
56 | 0.2.4 | 63 | 0.2.4 |
57 | 64 | ||
58 | * added support for email | 65 | * added support for email |
59 | * autoupdates after 1 min | 66 | * autoupdates after 1 min |
60 | * QCopEnvelope instead of system() | 67 | * QCopEnvelope instead of system() |
61 | * starting to use qvbox in gui | 68 | * starting to use qvbox in gui |
62 | 69 | ||
63 | 70 | ||
64 | 0.2.3 | 71 | 0.2.3 |
65 | 72 | ||
66 | * the 4 am release | 73 | * the 4 am release |
67 | * several bugfixes | 74 | * several bugfixes |
68 | 75 | ||
69 | 76 | ||
70 | 0.2.2 | 77 | 0.2.2 |
71 | 78 | ||
72 | * started working on calling other apps | 79 | * started working on calling other apps |
73 | * and finished it | 80 | * and finished it |
74 | 81 | ||
75 | 0.2.1 | 82 | 0.2.1 |
76 | 83 | ||
77 | * images no more inline | 84 | * images no more inline |
78 | * config dialog | 85 | * config dialog |
79 | 86 | ||
80 | 0.1.1 | 87 | 0.1.1 |
81 | 88 | ||
82 | * started changelog. | 89 | * started changelog. |
83 | * fixed segfault on empty/nonexistant todolist.xml | 90 | * fixed segfault on empty/nonexistant todolist.xml |
84 | * better handling for file location | 91 | * better handling for file location |
85 | 92 | ||
diff --git a/core/pim/today/clickablelabel.cpp b/core/pim/today/clickablelabel.cpp deleted file mode 100644 index e11cef6..0000000 --- a/core/pim/today/clickablelabel.cpp +++ b/dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #include "clickablelabel.h" | ||
2 | |||
3 | ClickableLabel::ClickableLabel(QWidget* parent, | ||
4 | const char* name, | ||
5 | WFlags fl) : | ||
6 | QLabel(parent,name,fl) | ||
7 | { | ||
8 | setFrameShape(NoFrame); | ||
9 | setFrameShadow(Sunken); | ||
10 | } | ||
11 | |||
12 | void ClickableLabel::mousePressEvent( QMouseEvent *e ) { | ||
13 | setFrameShape(Panel); | ||
14 | repaint(); | ||
15 | } | ||
16 | |||
17 | void ClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { | ||
18 | setFrameShape(NoFrame); | ||
19 | repaint(); | ||
20 | if (rect().contains(e->pos())) { | ||
21 | emit clicked(); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | void ClickableLabel::mouseMoveEvent( QMouseEvent *e ) { | ||
26 | if (rect().contains(e->pos())) { | ||
27 | setFrameShape(Panel); | ||
28 | } else { | ||
29 | setFrameShape(NoFrame); | ||
30 | } | ||
31 | } | ||
diff --git a/core/pim/today/clickablelabel.h b/core/pim/today/clickablelabel.h deleted file mode 100644 index b6d33ad..0000000 --- a/core/pim/today/clickablelabel.h +++ b/dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef CLICKABLELABEL | ||
2 | #define CLICKABLELABEL | ||
3 | |||
4 | #include <qlabel.h> | ||
5 | |||
6 | class ClickableLabel: public QLabel | ||
7 | { | ||
8 | Q_OBJECT | ||
9 | public: | ||
10 | ClickableLabel(QWidget* parent = 0, const char* name = 0, | ||
11 | WFlags fl = 0); | ||
12 | protected: | ||
13 | void mousePressEvent( QMouseEvent *e ); | ||
14 | void mouseReleaseEvent( QMouseEvent *e ); | ||
15 | void mouseMoveEvent( QMouseEvent *e ); | ||
16 | signals: | ||
17 | void clicked(); | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/core/pim/today/opie-today.control b/core/pim/today/opie-today.control index cf982fd..da9d9fa 100644 --- a/core/pim/today/opie-today.control +++ b/core/pim/today/opie-today.control | |||
@@ -1,16 +1,16 @@ | |||
1 | Files: bin/today apps/Applications/today.desktop pics/today/* | 1 | Files: bin/today apps/Applications/today.desktop pics/today/* |
2 | Priority: optional | 2 | 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.3.2-$SUB_VERSION | 6 | Version: 0.3.3-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) |
8 | License: GPL | 8 | License: GPL |
9 | Description: today screen | 9 | Description: today screen |
10 | This today screen app gives an overview of appointments | 10 | This today screen app gives an overview of appointments |
11 | and todos. | 11 | and todos. |
12 | It also shows incoming and outgoing mails from opiemail. | 12 | It also shows incoming and outgoing mails from opiemail. |
13 | When using Opie (opie.handhelds.org) today can be autostarted | 13 | When using Opie (opie.handhelds.org) today can be autostarted |
14 | on resume. | 14 | on resume. |
15 | It is highly configurable. | 15 | It is highly configurable. |
16 | 16 | ||
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 1b4408c..0f4cbdb 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -284,330 +284,330 @@ void Today::startConfig() { | |||
284 | 284 | ||
285 | 285 | ||
286 | /* | 286 | /* |
287 | * Get all events that are in the datebook xml file for today | 287 | * Get all events that are in the datebook xml file for today |
288 | */ | 288 | */ |
289 | void Today::getDates() { | 289 | void Today::getDates() { |
290 | QDate date = QDate::currentDate(); | 290 | QDate date = QDate::currentDate(); |
291 | 291 | ||
292 | if (AllDateBookEvents) delete AllDateBookEvents; | 292 | if (AllDateBookEvents) delete AllDateBookEvents; |
293 | AllDateBookEvents = new QWidget( ); | 293 | AllDateBookEvents = new QWidget( ); |
294 | QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); | 294 | QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); |
295 | 295 | ||
296 | if (db) { | 296 | if (db) { |
297 | delete db; | 297 | delete db; |
298 | } | 298 | } |
299 | db = new DateBookDB; | 299 | db = new DateBookDB; |
300 | 300 | ||
301 | QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); | 301 | QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); |
302 | 302 | ||
303 | qBubbleSort(list); | 303 | qBubbleSort(list); |
304 | // printf("Get dates\n"); | 304 | // printf("Get dates\n"); |
305 | 305 | ||
306 | Config config( "qpe" ); | 306 | Config config( "qpe" ); |
307 | // if 24 h format | 307 | // if 24 h format |
308 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); | 308 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); |
309 | 309 | ||
310 | int count=0; | 310 | int count=0; |
311 | 311 | ||
312 | if ( list.count() > 0 ) { | 312 | if ( list.count() > 0 ) { |
313 | 313 | ||
314 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); | 314 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); |
315 | it!=list.end(); ++it ) { | 315 | it!=list.end(); ++it ) { |
316 | 316 | ||
317 | 317 | ||
318 | if ( count <= MAX_LINES_MEET ) { | 318 | if ( count <= MAX_LINES_MEET ) { |
319 | 319 | ||
320 | QTime time = QTime::currentTime(); | 320 | QTime time = QTime::currentTime(); |
321 | 321 | ||
322 | if (!ONLY_LATER) { | 322 | if (!ONLY_LATER) { |
323 | count++; | 323 | count++; |
324 | DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); | 324 | DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); |
325 | layoutDates->addWidget(l); | 325 | layoutDates->addWidget(l); |
326 | connect (l, SIGNAL(editEvent(const Event &)), | 326 | connect (l, SIGNAL(editEvent(const Event &)), |
327 | this, SLOT(editEvent(const Event &))); | 327 | this, SLOT(editEvent(const Event &))); |
328 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { | 328 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { |
329 | count++; | 329 | count++; |
330 | 330 | ||
331 | // show only later appointments | 331 | // show only later appointments |
332 | DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); | 332 | DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); |
333 | layoutDates->addWidget(l); | 333 | layoutDates->addWidget(l); |
334 | connect (l, SIGNAL(editEvent(const Event &)), | 334 | connect (l, SIGNAL(editEvent(const Event &)), |
335 | this, SLOT(editEvent(const Event &))); | 335 | this, SLOT(editEvent(const Event &))); |
336 | } | 336 | } |
337 | } | 337 | } |
338 | } | 338 | } |
339 | if (ONLY_LATER && count==0) { | 339 | if (ONLY_LATER && count==0) { |
340 | QLabel* noMoreEvents = new QLabel(AllDateBookEvents); | 340 | QLabel* noMoreEvents = new QLabel(AllDateBookEvents); |
341 | noMoreEvents->setText(tr("No more appointments today")); | 341 | noMoreEvents->setText(tr("No more appointments today")); |
342 | layoutDates->addWidget(noMoreEvents); | 342 | layoutDates->addWidget(noMoreEvents); |
343 | } | 343 | } |
344 | } else { | 344 | } else { |
345 | QLabel* noEvents = new QLabel(AllDateBookEvents); | 345 | QLabel* noEvents = new QLabel(AllDateBookEvents); |
346 | noEvents->setText(tr("No appointments today")); | 346 | noEvents->setText(tr("No appointments today")); |
347 | layoutDates->addWidget(noEvents); | 347 | layoutDates->addWidget(noEvents); |
348 | } | 348 | } |
349 | 349 | ||
350 | layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); | 350 | layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); |
351 | sv1->addChild(AllDateBookEvents); | 351 | sv1->addChild(AllDateBookEvents); |
352 | AllDateBookEvents->show(); | 352 | AllDateBookEvents->show(); |
353 | } | 353 | } |
354 | 354 | ||
355 | 355 | ||
356 | void Today::getMail() { | 356 | void Today::getMail() { |
357 | Config cfg("opiemail"); | 357 | Config cfg("opiemail"); |
358 | cfg.setGroup("today"); | 358 | cfg.setGroup("today"); |
359 | 359 | ||
360 | // how many lines should be showed in the task section | 360 | // how many lines should be showed in the task section |
361 | int NEW_MAILS = cfg.readNumEntry("newmails",0); | 361 | int NEW_MAILS = cfg.readNumEntry("newmails",0); |
362 | int OUTGOING = cfg.readNumEntry("outgoing",0); | 362 | int OUTGOING = cfg.readNumEntry("outgoing",0); |
363 | 363 | ||
364 | QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); | 364 | QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); |
365 | 365 | ||
366 | MailField->setText(output); | 366 | MailField->setText(output); |
367 | } | 367 | } |
368 | 368 | ||
369 | 369 | ||
370 | /* | 370 | /* |
371 | * Get the todos | 371 | * Get the todos |
372 | */ | 372 | */ |
373 | void Today::getTodo() { | 373 | void Today::getTodo() { |
374 | 374 | ||
375 | QString output; | 375 | QString output; |
376 | QString tmpout; | 376 | QString tmpout; |
377 | int count = 0; | 377 | int count = 0; |
378 | int ammount = 0; | 378 | int ammount = 0; |
379 | 379 | ||
380 | // get overdue todos first | 380 | // get overdue todos first |
381 | QValueList<ToDoEvent> overDueList = todo->overDue(); | 381 | QValueList<ToDoEvent> overDueList = todo->overDue(); |
382 | qBubbleSort(overDueList); | 382 | qBubbleSort(overDueList); |
383 | for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); | 383 | for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); |
384 | it!=overDueList.end(); ++it ) { | 384 | it!=overDueList.end(); ++it ) { |
385 | if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { | 385 | if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { |
386 | tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; | 386 | tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; |
387 | ammount++; | 387 | ammount++; |
388 | } | 388 | } |
389 | } | 389 | } |
390 | 390 | ||
391 | // get total number of still open todos | 391 | // get total number of still open todos |
392 | QValueList<ToDoEvent> open = todo->rawToDos(); | 392 | QValueList<ToDoEvent> open = todo->rawToDos(); |
393 | qBubbleSort(open); | 393 | qBubbleSort(open); |
394 | for ( QValueList<ToDoEvent>::Iterator it=open.begin(); | 394 | for ( QValueList<ToDoEvent>::Iterator it=open.begin(); |
395 | it!=open.end(); ++it ) { | 395 | it!=open.end(); ++it ) { |
396 | if (!(*it).isCompleted()){ | 396 | if (!(*it).isCompleted()){ |
397 | count +=1; | 397 | count +=1; |
398 | // not the overdues, we allready got them, and not if we are | 398 | // not the overdues, we allready got them, and not if we are |
399 | // over the maxlines | 399 | // over the maxlines |
400 | if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { | 400 | if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { |
401 | tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; | 401 | tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; |
402 | ammount++; | 402 | ammount++; |
403 | } | 403 | } |
404 | } | 404 | } |
405 | } | 405 | } |
406 | 406 | ||
407 | 407 | ||
408 | if (count > 0) { | 408 | if (count > 0) { |
409 | if( count == 1 ) { | 409 | if( count == 1 ) { |
410 | output = tr("There is <b> 1</b> active task: <br>" ); | 410 | output = tr("There is <b> 1</b> active task: <br>" ); |
411 | } else { | 411 | } else { |
412 | output = tr("There are <b> %1</b> active tasks: <br>").arg(count); | 412 | output = tr("There are <b> %1</b> active tasks: <br>").arg(count); |
413 | } | 413 | } |
414 | output += tmpout; | 414 | output += tmpout; |
415 | } else { | 415 | } else { |
416 | output = tr("No active tasks"); | 416 | output = tr("No active tasks"); |
417 | } | 417 | } |
418 | 418 | ||
419 | TodoField->setText(tr(output)); | 419 | TodoField->setText(tr(output)); |
420 | } | 420 | } |
421 | 421 | ||
422 | /* | 422 | /* |
423 | * launches datebook | 423 | * launches datebook |
424 | */ | 424 | */ |
425 | void Today::startDatebook() { | 425 | void Today::startDatebook() { |
426 | QCopEnvelope e("QPE/System", "execute(QString)"); | 426 | QCopEnvelope e("QPE/System", "execute(QString)"); |
427 | e << QString("datebook"); | 427 | e << QString("datebook"); |
428 | } | 428 | } |
429 | 429 | ||
430 | /* | 430 | /* |
431 | * starts the edit dialog as known from datebook | 431 | * starts the edit dialog as known from datebook |
432 | */ | 432 | */ |
433 | 433 | ||
434 | extern QPEApplication *todayApp; | 434 | extern QPEApplication *todayApp; |
435 | 435 | ||
436 | void Today::editEvent(const Event &e) { | 436 | void Today::editEvent(const Event &e) { |
437 | startDatebook(); | 437 | startDatebook(); |
438 | 438 | ||
439 | while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); | 439 | while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); |
440 | QCopEnvelope env("QPE/Datebook", "editEvent(int)"); | 440 | QCopEnvelope env("QPE/Datebook", "editEvent(int)"); |
441 | env << e.uid(); | 441 | env << e.uid(); |
442 | } | 442 | } |
443 | 443 | ||
444 | /* | 444 | /* |
445 | * launches todolist | 445 | * launches todolist |
446 | */ | 446 | */ |
447 | void Today::startTodo() { | 447 | void Today::startTodo() { |
448 | QCopEnvelope e("QPE/System", "execute(QString)"); | 448 | QCopEnvelope e("QPE/System", "execute(QString)"); |
449 | e << QString("todolist"); | 449 | e << QString("todolist"); |
450 | } | 450 | } |
451 | 451 | ||
452 | /* | 452 | /* |
453 | * launch opiemail | 453 | * launch opiemail |
454 | */ | 454 | */ |
455 | void Today::startMail() { | 455 | void Today::startMail() { |
456 | QCopEnvelope e("QPE/System", "execute(QString)"); | 456 | QCopEnvelope e("QPE/System", "execute(QString)"); |
457 | e << QString("opiemail"); | 457 | e << QString("opiemail"); |
458 | //Right now start both, maybe decide which to rum via config file .. | 458 | //Right now start both, maybe decide which to rum via config file .. |
459 | QCopEnvelope f("QPE/System", "execute(QString)"); | 459 | QCopEnvelope f("QPE/System", "execute(QString)"); |
460 | f << QString("qtmail"); | 460 | f << QString("qtmail"); |
461 | } | 461 | } |
462 | 462 | ||
463 | 463 | ||
464 | Today::~Today() { | 464 | Today::~Today() { |
465 | } | 465 | } |
466 | 466 | ||
467 | /* | 467 | /* |
468 | * Gets the events for the current day, if it should get all dates | 468 | * Gets the events for the current day, if it should get all dates |
469 | */ | 469 | */ |
470 | DateBookEvent::DateBookEvent(const EffectiveEvent &ev, | 470 | DateBookEvent::DateBookEvent(const EffectiveEvent &ev, |
471 | QWidget* parent, | 471 | QWidget* parent, |
472 | int SHOW_LOCATION, | 472 | int SHOW_LOCATION, |
473 | int SHOW_NOTES, | 473 | int SHOW_NOTES, |
474 | const char* name, | 474 | const char* name, |
475 | WFlags fl) : | 475 | WFlags fl) : |
476 | ClickableLabel(parent,name,fl), event(ev) { | 476 | OClickableLabel(parent,name,fl), event(ev) { |
477 | 477 | ||
478 | QString msg; | 478 | QString msg; |
479 | //QTime time = QTime::currentTime(); | 479 | //QTime time = QTime::currentTime(); |
480 | 480 | ||
481 | Config config( "qpe" ); | 481 | Config config( "qpe" ); |
482 | config.setGroup( "Time" ); | 482 | config.setGroup( "Time" ); |
483 | // if 24 h format | 483 | // if 24 h format |
484 | ampm = config.readBoolEntry( "AMPM", TRUE ); | 484 | ampm = config.readBoolEntry( "AMPM", TRUE ); |
485 | 485 | ||
486 | 486 | ||
487 | if (!ONLY_LATER) { | 487 | if (!ONLY_LATER) { |
488 | msg += "<B>" + (ev).description() + "</B>"; | 488 | msg += "<B>" + (ev).description() + "</B>"; |
489 | if ( (ev).event().hasAlarm() ) { | 489 | if ( (ev).event().hasAlarm() ) { |
490 | msg += " <b>[with alarm]</b>"; | 490 | msg += " <b>[with alarm]</b>"; |
491 | } | 491 | } |
492 | // include location or not | 492 | // include location or not |
493 | if (SHOW_LOCATION == 1) { | 493 | if (SHOW_LOCATION == 1) { |
494 | msg += "<BR><i>" + (ev).location() + "</i>"; | 494 | msg += "<BR><i>" + (ev).location() + "</i>"; |
495 | } | 495 | } |
496 | 496 | ||
497 | if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { | 497 | if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { |
498 | msg += "<br>All day"; | 498 | msg += "<br>All day"; |
499 | } else { | 499 | } else { |
500 | // start time of event | 500 | // start time of event |
501 | msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) | 501 | msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) |
502 | // end time of event | 502 | // end time of event |
503 | + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); | 503 | + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); |
504 | } | 504 | } |
505 | 505 | ||
506 | // include possible note or not | 506 | // include possible note or not |
507 | if (SHOW_NOTES == 1) { | 507 | if (SHOW_NOTES == 1) { |
508 | msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); | 508 | msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); |
509 | } | 509 | } |
510 | } | 510 | } |
511 | setText(msg); | 511 | setText(msg); |
512 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); | 512 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); |
513 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); | 513 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); |
514 | } | 514 | } |
515 | 515 | ||
516 | 516 | ||
517 | QString DateBookEvent::ampmTime(QTime tm) { | 517 | QString DateBookEvent::ampmTime(QTime tm) { |
518 | 518 | ||
519 | QString s; | 519 | QString s; |
520 | if( ampm ) { | 520 | if( ampm ) { |
521 | int hour = tm.hour(); | 521 | int hour = tm.hour(); |
522 | if (hour == 0) | 522 | if (hour == 0) |
523 | hour = 12; | 523 | hour = 12; |
524 | if (hour > 12) | 524 | if (hour > 12) |
525 | hour -= 12; | 525 | hour -= 12; |
526 | s.sprintf( "%2d:%02d %s", hour, tm.minute(), | 526 | s.sprintf( "%2d:%02d %s", hour, tm.minute(), |
527 | (tm.hour() >= 12) ? "PM" : "AM" ); | 527 | (tm.hour() >= 12) ? "PM" : "AM" ); |
528 | return s; | 528 | return s; |
529 | } else { | 529 | } else { |
530 | s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); | 530 | s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); |
531 | return s; | 531 | return s; |
532 | } | 532 | } |
533 | 533 | ||
534 | } | 534 | } |
535 | 535 | ||
536 | 536 | ||
537 | DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, | 537 | DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, |
538 | QWidget* parent, | 538 | QWidget* parent, |
539 | int SHOW_LOCATION, | 539 | int SHOW_LOCATION, |
540 | int SHOW_NOTES, | 540 | int SHOW_NOTES, |
541 | const char* name, | 541 | const char* name, |
542 | WFlags fl) : | 542 | WFlags fl) : |
543 | ClickableLabel(parent,name,fl), event(ev) { | 543 | OClickableLabel(parent,name,fl), event(ev) { |
544 | 544 | ||
545 | QString msg; | 545 | QString msg; |
546 | QTime time = QTime::currentTime(); | 546 | QTime time = QTime::currentTime(); |
547 | 547 | ||
548 | Config config( "qpe" ); | 548 | Config config( "qpe" ); |
549 | config.setGroup( "Time" ); | 549 | config.setGroup( "Time" ); |
550 | // if 24 h format | 550 | // if 24 h format |
551 | ampm = config.readBoolEntry( "AMPM", TRUE ); | 551 | ampm = config.readBoolEntry( "AMPM", TRUE ); |
552 | 552 | ||
553 | 553 | ||
554 | if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { | 554 | if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { |
555 | // show only later appointments | 555 | // show only later appointments |
556 | msg += "<B>" + (ev).description() + "</B>"; | 556 | msg += "<B>" + (ev).description() + "</B>"; |
557 | if ( (ev).event().hasAlarm() ) { | 557 | if ( (ev).event().hasAlarm() ) { |
558 | msg += " <b>[with alarm]</b>"; | 558 | msg += " <b>[with alarm]</b>"; |
559 | } | 559 | } |
560 | // include location or not | 560 | // include location or not |
561 | if (SHOW_LOCATION == 1) { | 561 | if (SHOW_LOCATION == 1) { |
562 | msg += "<BR><i>" + (ev).location() + "</i>"; | 562 | msg += "<BR><i>" + (ev).location() + "</i>"; |
563 | } | 563 | } |
564 | 564 | ||
565 | if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { | 565 | if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { |
566 | msg += "<br>All day"; | 566 | msg += "<br>All day"; |
567 | } else { | 567 | } else { |
568 | // start time of event | 568 | // start time of event |
569 | msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) | 569 | msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) |
570 | // end time of event | 570 | // end time of event |
571 | + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); | 571 | + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); |
572 | } | 572 | } |
573 | // include possible note or not | 573 | // include possible note or not |
574 | if (SHOW_NOTES == 1) { | 574 | if (SHOW_NOTES == 1) { |
575 | msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); | 575 | msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); |
576 | } | 576 | } |
577 | } | 577 | } |
578 | 578 | ||
579 | setText(msg); | 579 | setText(msg); |
580 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); | 580 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); |
581 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); | 581 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); |
582 | } | 582 | } |
583 | 583 | ||
584 | 584 | ||
585 | QString DateBookEventLater::ampmTime(QTime tm) { | 585 | QString DateBookEventLater::ampmTime(QTime tm) { |
586 | 586 | ||
587 | QString s; | 587 | QString s; |
588 | if( ampm ) { | 588 | if( ampm ) { |
589 | int hour = tm.hour(); | 589 | int hour = tm.hour(); |
590 | if (hour == 0) | 590 | if (hour == 0) |
591 | hour = 12; | 591 | hour = 12; |
592 | if (hour > 12) | 592 | if (hour > 12) |
593 | hour -= 12; | 593 | hour -= 12; |
594 | s.sprintf( "%2d:%02d %s", hour, tm.minute(), | 594 | s.sprintf( "%2d:%02d %s", hour, tm.minute(), |
595 | (tm.hour() >= 12) ? "PM" : "AM" ); | 595 | (tm.hour() >= 12) ? "PM" : "AM" ); |
596 | return s; | 596 | return s; |
597 | } else { | 597 | } else { |
598 | s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); | 598 | s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); |
599 | return s; | 599 | return s; |
600 | } | 600 | } |
601 | 601 | ||
602 | } | 602 | } |
603 | 603 | ||
604 | 604 | ||
605 | void DateBookEvent::editMe() { | 605 | void DateBookEvent::editMe() { |
606 | emit editEvent(event.event()); | 606 | emit editEvent(event.event()); |
607 | } | 607 | } |
608 | 608 | ||
609 | void DateBookEventLater::editMe() { | 609 | void DateBookEventLater::editMe() { |
610 | emit editEvent(event.event()); | 610 | emit editEvent(event.event()); |
611 | } | 611 | } |
612 | 612 | ||
613 | 613 | ||
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index d265d67..32bb4a3 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -1,116 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | * today.h | 2 | * today.h |
3 | * | 3 | * |
4 | * --------------------- | 4 | * --------------------- |
5 | * | 5 | * |
6 | * begin : Sun 10 17:20:00 CEST 2002 | 6 | * begin : Sun 10 17:20:00 CEST 2002 |
7 | * copyright : (c) 2002 by Maximilian Reiß | 7 | * copyright : (c) 2002 by Maximilian Reiß |
8 | * email : max.reiss@gmx.de | 8 | * email : max.reiss@gmx.de |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | 19 | ||
20 | 20 | ||
21 | #ifndef TODAY_H | 21 | #ifndef TODAY_H |
22 | #define TODAY_H | 22 | #define TODAY_H |
23 | 23 | ||
24 | #include <qpe/datebookdb.h> | 24 | #include <qpe/datebookdb.h> |
25 | #include <qpe/event.h> | 25 | #include <qpe/event.h> |
26 | 26 | ||
27 | #include <opie/tododb.h> | 27 | #include <opie/tododb.h> |
28 | #include <opie/oclickablelabel.h> | ||
28 | 29 | ||
29 | #include <qdatetime.h> | 30 | #include <qdatetime.h> |
30 | #include <qlist.h> | 31 | #include <qlist.h> |
31 | 32 | ||
32 | #include "todayconfig.h" | 33 | #include "todayconfig.h" |
33 | #include "todaybase.h" | 34 | #include "todaybase.h" |
34 | #include "clickablelabel.h" | ||
35 | 35 | ||
36 | class QVBoxLayout; | 36 | class QVBoxLayout; |
37 | 37 | ||
38 | class Today : public TodayBase { | 38 | class Today : public TodayBase { |
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | 40 | ||
41 | public: | 41 | public: |
42 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 42 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
43 | ~Today(); | 43 | ~Today(); |
44 | 44 | ||
45 | private slots: | 45 | private slots: |
46 | void startConfig(); | 46 | void startConfig(); |
47 | void startTodo(); | 47 | void startTodo(); |
48 | void startDatebook(); | 48 | void startDatebook(); |
49 | void startMail(); | 49 | void startMail(); |
50 | void draw(); | 50 | void draw(); |
51 | void editEvent(const Event &e); | 51 | void editEvent(const Event &e); |
52 | private: | 52 | private: |
53 | void init(); | 53 | void init(); |
54 | void getDates(); | 54 | void getDates(); |
55 | void getTodo(); | 55 | void getTodo(); |
56 | void getMail(); | 56 | void getMail(); |
57 | void autoStart(); | 57 | void autoStart(); |
58 | bool checkIfModified(); | 58 | bool checkIfModified(); |
59 | void setOwnerField(); | 59 | void setOwnerField(); |
60 | void setOwnerField(QString &string); | 60 | void setOwnerField(QString &string); |
61 | private slots: | 61 | private slots: |
62 | void channelReceived(const QCString &msg, const QByteArray & data); | 62 | void channelReceived(const QCString &msg, const QByteArray & data); |
63 | 63 | ||
64 | private: | 64 | private: |
65 | DateBookDB *db; | 65 | DateBookDB *db; |
66 | ToDoDB *todo; | 66 | ToDoDB *todo; |
67 | todayconfig *conf; | 67 | todayconfig *conf; |
68 | QWidget* AllDateBookEvents; | 68 | QWidget* AllDateBookEvents; |
69 | //Config cfg; | 69 | //Config cfg; |
70 | int MAX_LINES_TASK; | 70 | int MAX_LINES_TASK; |
71 | int MAX_CHAR_CLIP; | 71 | int MAX_CHAR_CLIP; |
72 | int MAX_LINES_MEET; | 72 | int MAX_LINES_MEET; |
73 | int SHOW_LOCATION; | 73 | int SHOW_LOCATION; |
74 | int SHOW_NOTES; | 74 | int SHOW_NOTES; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | class DateBookEvent: public ClickableLabel { | 77 | class DateBookEvent: public OClickableLabel { |
78 | Q_OBJECT | 78 | Q_OBJECT |
79 | public: | 79 | public: |
80 | DateBookEvent(const EffectiveEvent &ev, | 80 | DateBookEvent(const EffectiveEvent &ev, |
81 | QWidget* parent = 0, | 81 | QWidget* parent = 0, |
82 | int SHOW_LOCATION = 0, | 82 | int SHOW_LOCATION = 0, |
83 | int SHOW_NOTES = 0, | 83 | int SHOW_NOTES = 0, |
84 | const char* name = 0, | 84 | const char* name = 0, |
85 | WFlags fl = 0); | 85 | WFlags fl = 0); |
86 | signals: | 86 | signals: |
87 | void editEvent(const Event &e); | 87 | void editEvent(const Event &e); |
88 | private slots: | 88 | private slots: |
89 | void editMe(); | 89 | void editMe(); |
90 | private: | 90 | private: |
91 | QString ampmTime(QTime); | 91 | QString ampmTime(QTime); |
92 | const EffectiveEvent event; | 92 | const EffectiveEvent event; |
93 | bool ampm; | 93 | bool ampm; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | class DateBookEventLater: public ClickableLabel { | 96 | class DateBookEventLater: public OClickableLabel { |
97 | Q_OBJECT | 97 | Q_OBJECT |
98 | public: | 98 | public: |
99 | DateBookEventLater(const EffectiveEvent &ev, | 99 | DateBookEventLater(const EffectiveEvent &ev, |
100 | QWidget* parent = 0, | 100 | QWidget* parent = 0, |
101 | int SHOW_LOCATION = 0, | 101 | int SHOW_LOCATION = 0, |
102 | int SHOW_NOTES = 0, | 102 | int SHOW_NOTES = 0, |
103 | const char* name = 0, | 103 | const char* name = 0, |
104 | WFlags fl = 0); | 104 | WFlags fl = 0); |
105 | signals: | 105 | signals: |
106 | void editEvent(const Event &e); | 106 | void editEvent(const Event &e); |
107 | private slots: | 107 | private slots: |
108 | void editMe(); | 108 | void editMe(); |
109 | private: | 109 | private: |
110 | QString ampmTime(QTime); | 110 | QString ampmTime(QTime); |
111 | const EffectiveEvent event; | 111 | const EffectiveEvent event; |
112 | bool ampm; | 112 | bool ampm; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | #endif // TODAY_H | 115 | #endif // TODAY_H |
116 | 116 | ||
diff --git a/core/pim/today/today.pro b/core/pim/today/today.pro index 2d37b5d..f40edca 100644 --- a/core/pim/today/today.pro +++ b/core/pim/today/today.pro | |||
@@ -1,24 +1,24 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | #CONFIG = qt warn_on debug | 2 | #CONFIG = qt warn_on debug |
3 | CONFIG = qt warn_on release | 3 | CONFIG = qt warn_on release |
4 | HEADERS = today.h todaybase.h todayconfig.h clickablelabel.h | 4 | HEADERS = today.h todaybase.h todayconfig.h |
5 | SOURCES = main.cpp today.cpp todaybase.cpp todayconfig.cpp clickablelabel.cpp | 5 | SOURCES = main.cpp today.cpp todaybase.cpp todayconfig.cpp |
6 | 6 | ||
7 | INCLUDEPATH+= $(OPIEDIR)/include | 7 | INCLUDEPATH+= $(OPIEDIR)/include |
8 | DEPENDPATH+= $(OPIEDIR)/include | 8 | DEPENDPATH+= $(OPIEDIR)/include |
9 | LIBS += -lqpe -lopie | 9 | LIBS += -lqpe -lopie |
10 | INTERFACES= | 10 | INTERFACES= |
11 | TARGET = today | 11 | TARGET = today |
12 | DESTDIR = $(OPIEDIR)/bin | 12 | DESTDIR = $(OPIEDIR)/bin |
13 | TRANSLATIONS = ../i18n/pt_BR/today.ts | 13 | TRANSLATIONS = ../i18n/pt_BR/today.ts |
14 | TRANSLATIONS += ../i18n/de/today.ts | 14 | TRANSLATIONS += ../i18n/de/today.ts |
15 | TRANSLATIONS += ../i18n/en/today.ts | 15 | TRANSLATIONS += ../i18n/en/today.ts |
16 | TRANSLATIONS += ../i18n/hu/today.ts | 16 | TRANSLATIONS += ../i18n/hu/today.ts |
17 | TRANSLATIONS += ../i18n/sl/today.ts | 17 | TRANSLATIONS += ../i18n/sl/today.ts |
18 | TRANSLATIONS += ../i18n/ja/today.ts | 18 | TRANSLATIONS += ../i18n/ja/today.ts |
19 | TRANSLATIONS += ../i18n/ko/today.ts | 19 | TRANSLATIONS += ../i18n/ko/today.ts |
20 | TRANSLATIONS += ../i18n/no/today.ts | 20 | TRANSLATIONS += ../i18n/no/today.ts |
21 | TRANSLATIONS += ../i18n/zh_CN/today.ts | 21 | TRANSLATIONS += ../i18n/zh_CN/today.ts |
22 | TRANSLATIONS += ../i18n/zh_TW/today.ts | 22 | TRANSLATIONS += ../i18n/zh_TW/today.ts |
23 | TRANSLATIONS += ../i18n/fr/today.ts | 23 | TRANSLATIONS += ../i18n/fr/today.ts |
24 | TRANSLATIONS += ../i18n/pl/today.ts | 24 | TRANSLATIONS += ../i18n/pl/today.ts |