summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp18
-rw-r--r--core/pim/today/today.h1
2 files changed, 12 insertions, 7 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 9e9d31f..ad1ec90 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -400,74 +400,78 @@ void Today::getTodo() {
400 // not the overdues, we allready got them, and not if we are 400 // not the overdues, we allready got them, and not if we are
401 // over the maxlines 401 // over the maxlines
402 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { 402 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) {
403 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; 403 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>";
404 ammount++; 404 ammount++;
405 } 405 }
406 } 406 }
407 } 407 }
408 408
409 409
410 if (count > 0) { 410 if (count > 0) {
411 if( count == 1 ) { 411 if( count == 1 ) {
412 output = tr("There is <b> 1</b> active task: <br>" ); 412 output = tr("There is <b> 1</b> active task: <br>" );
413 } else { 413 } else {
414 output = tr("There are <b> %1</b> active tasks: <br>").arg(count); 414 output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
415 } 415 }
416 output += tmpout; 416 output += tmpout;
417 } else { 417 } else {
418 output = tr("No active tasks"); 418 output = tr("No active tasks");
419 } 419 }
420 420
421 TodoField->setText(tr(output)); 421 TodoField->setText(tr(output));
422} 422}
423 423
424
425void Today::startAddressbook() {
426 QCopEnvelope e("QPE/System", "execute(QString)");
427 e << QString("addressbook");
428}
429
430extern QPEApplication *todayApp;
431
424/* 432/*
425 * launch addressbook (personal card) 433 * launch addressbook (personal card)
426 */ 434 */
427void Today::editCard() { 435void Today::editCard() {
428 QCopEnvelope w("QPE/System", "execute(QString)");
429 w << QString("addressbook");
430 436
431 // while( !QCopChannel::isRegistered("QPE/Addressbook")) 437 startAddressbook();
438
439 while( !QCopChannel::isRegistered("QPE/Addressbook")) todayApp->processEvents();
432 QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()"); 440 QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()");
433} 441}
434 442
435/* 443/*
436 * launches datebook 444 * launches datebook
437 */ 445 */
438void Today::startDatebook() { 446void Today::startDatebook() {
439 QCopEnvelope e("QPE/System", "execute(QString)"); 447 QCopEnvelope e("QPE/System", "execute(QString)");
440 e << QString("datebook"); 448 e << QString("datebook");
441} 449}
442 450
443/* 451/*
444 * starts the edit dialog as known from datebook 452 * starts the edit dialog as known from datebook
445 */ 453 */
446
447
448extern QPEApplication *todayApp;
449
450void Today::editEvent(const Event &e) { 454void Today::editEvent(const Event &e) {
451 startDatebook(); 455 startDatebook();
452 456
453 while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); 457 while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents();
454 QCopEnvelope env("QPE/Datebook", "editEvent(int)"); 458 QCopEnvelope env("QPE/Datebook", "editEvent(int)");
455 env << e.uid(); 459 env << e.uid();
456} 460}
457 461
458/* 462/*
459 * launches todolist 463 * launches todolist
460 */ 464 */
461void Today::startTodo() { 465void Today::startTodo() {
462 QCopEnvelope e("QPE/System", "execute(QString)"); 466 QCopEnvelope e("QPE/System", "execute(QString)");
463 e << QString("todolist"); 467 e << QString("todolist");
464} 468}
465 469
466/* 470/*
467 * launch opiemail 471 * launch opiemail
468 */ 472 */
469void Today::startMail() { 473void Today::startMail() {
470 QCopEnvelope e("QPE/System", "execute(QString)"); 474 QCopEnvelope e("QPE/System", "execute(QString)");
471 e << QString("opiemail"); 475 e << QString("opiemail");
472//Right now start both, maybe decide which to rum via config file .. 476//Right now start both, maybe decide which to rum via config file ..
473 QCopEnvelope f("QPE/System", "execute(QString)"); 477 QCopEnvelope f("QPE/System", "execute(QString)");
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index 54f31cc..f28c029 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -25,48 +25,49 @@
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#include <opie/oclickablelabel.h>
29 29
30#include <qdatetime.h> 30#include <qdatetime.h>
31#include <qlist.h> 31#include <qlist.h>
32 32
33#include "todayconfig.h" 33#include "todayconfig.h"
34#include "todaybase.h" 34#include "todaybase.h"
35 35
36class QVBoxLayout; 36class QVBoxLayout;
37 37
38class Today : public TodayBase { 38class 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 startAddressbook();
49 void startMail(); 50 void startMail();
50 void editCard(); 51 void editCard();
51 void draw(); 52 void draw();
52 void editEvent(const Event &e); 53 void editEvent(const Event &e);
53 private: 54 private:
54 void init(); 55 void init();
55 void getDates(); 56 void getDates();
56 void getTodo(); 57 void getTodo();
57 void getMail(); 58 void getMail();
58 void autoStart(); 59 void autoStart();
59 bool checkIfModified(); 60 bool checkIfModified();
60 void setOwnerField(); 61 void setOwnerField();
61 void setOwnerField(QString &string); 62 void setOwnerField(QString &string);
62 private slots: 63 private slots:
63 void channelReceived(const QCString &msg, const QByteArray & data); 64 void channelReceived(const QCString &msg, const QByteArray & data);
64 65
65 private: 66 private:
66 DateBookDB *db; 67 DateBookDB *db;
67 ToDoDB *todo; 68 ToDoDB *todo;
68 todayconfig *conf; 69 todayconfig *conf;
69 QWidget* AllDateBookEvents; 70 QWidget* AllDateBookEvents;
70 //Config cfg; 71 //Config cfg;
71 int MAX_LINES_TASK; 72 int MAX_LINES_TASK;
72 int MAX_CHAR_CLIP; 73 int MAX_CHAR_CLIP;