summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-04-19 21:43:29 (UTC)
committer harlekin <harlekin>2002-04-19 21:43:29 (UTC)
commit59aeb3bb66ad382201fe1e2cc3066564240d1cc1 (patch) (unidiff)
treee2d5721765a6dc269d2a58bef5c02ccc11d459e5
parent7ea4abeb652e6787e57a938e1ca028d25fd249ce (diff)
downloadopie-59aeb3bb66ad382201fe1e2cc3066564240d1cc1.zip
opie-59aeb3bb66ad382201fe1e2cc3066564240d1cc1.tar.gz
opie-59aeb3bb66ad382201fe1e2cc3066564240d1cc1.tar.bz2
launch ALSO qtmail by clicking on mail icon
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index f5ed8d2..1cb4881 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -390,128 +390,131 @@ void Today::getTodo() {
390 for ( QValueList<ToDoEvent>::Iterator it=open.begin(); 390 for ( QValueList<ToDoEvent>::Iterator it=open.begin();
391 it!=open.end(); ++it ) { 391 it!=open.end(); ++it ) {
392 if (!(*it).isCompleted()){ 392 if (!(*it).isCompleted()){
393 count +=1; 393 count +=1;
394 // not the overdues, we allready got them, and not if we are 394 // not the overdues, we allready got them, and not if we are
395 // over the maxlines 395 // over the maxlines
396 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { 396 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) {
397 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; 397 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>";
398 ammount++; 398 ammount++;
399 } 399 }
400 } 400 }
401 } 401 }
402 402
403 403
404 if (count > 0) { 404 if (count > 0) {
405 if( count == 1 ) { 405 if( count == 1 ) {
406 output = tr("There is <b> 1</b> active task: <br>" ); 406 output = tr("There is <b> 1</b> active task: <br>" );
407 } else { 407 } else {
408 output = tr("There are <b> %1</b> active tasks: <br>").arg(count); 408 output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
409 } 409 }
410 output += tmpout; 410 output += tmpout;
411 } else { 411 } else {
412 output = tr("No active tasks"); 412 output = tr("No active tasks");
413 } 413 }
414 414
415 TodoField->setText(tr(output)); 415 TodoField->setText(tr(output));
416} 416}
417 417
418/* 418/*
419 * launches datebook 419 * launches datebook
420 */ 420 */
421void Today::startDatebook() { 421void Today::startDatebook() {
422 QCopEnvelope e("QPE/System", "execute(QString)"); 422 QCopEnvelope e("QPE/System", "execute(QString)");
423 e << QString("datebook"); 423 e << QString("datebook");
424} 424}
425 425
426/* 426/*
427 * starts the edit dialog as known from datebook 427 * starts the edit dialog as known from datebook
428 */ 428 */
429 429
430extern QPEApplication *todayApp; 430extern QPEApplication *todayApp;
431 431
432void Today::editEvent(const Event &e) { 432void Today::editEvent(const Event &e) {
433 startDatebook(); 433 startDatebook();
434 434
435 while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); 435 while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents();
436 QCopEnvelope env("QPE/Datebook", "editEvent(int)"); 436 QCopEnvelope env("QPE/Datebook", "editEvent(int)");
437 env << e.uid(); 437 env << e.uid();
438} 438}
439 439
440/* 440/*
441 * launches todolist 441 * launches todolist
442 */ 442 */
443void Today::startTodo() { 443void Today::startTodo() {
444 QCopEnvelope e("QPE/System", "execute(QString)"); 444 QCopEnvelope e("QPE/System", "execute(QString)");
445 e << QString("todolist"); 445 e << QString("todolist");
446} 446}
447 447
448/* 448/*
449 * launch opiemail 449 * launch opiemail
450 */ 450 */
451void Today::startMail() { 451void Today::startMail() {
452 QCopEnvelope e("QPE/System", "execute(QString)"); 452 QCopEnvelope e("QPE/System", "execute(QString)");
453 e << QString("opiemail"); 453 e << QString("opiemail");
454//Right now start both, maybe decide which to rum via config file ..
455 QCopEnvelope e("QPE/System", "execute(QString)");
456 e << QString("qtmail");
454} 457}
455 458
456 459
457Today::~Today() { 460Today::~Today() {
458} 461}
459 462
460/* 463/*
461 * Gets the events for the current day, if it should get all dates 464 * Gets the events for the current day, if it should get all dates
462 */ 465 */
463DateBookEvent::DateBookEvent(const EffectiveEvent &ev, 466DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
464 QWidget* parent = 0, 467 QWidget* parent = 0,
465 int SHOW_LOCATION = 0, 468 int SHOW_LOCATION = 0,
466 int SHOW_NOTES = 0, 469 int SHOW_NOTES = 0,
467 const char* name = 0, 470 const char* name = 0,
468 WFlags fl = 0) : 471 WFlags fl = 0) :
469 ClickableLabel(parent,name,fl), event(ev) { 472 ClickableLabel(parent,name,fl), event(ev) {
470 473
471 QString msg; 474 QString msg;
472 //QTime time = QTime::currentTime(); 475 //QTime time = QTime::currentTime();
473 476
474 Config config( "qpe" ); 477 Config config( "qpe" );
475 // if 24 h format 478 // if 24 h format
476 ampm = config.readBoolEntry( "AMPM", TRUE ); 479 ampm = config.readBoolEntry( "AMPM", TRUE );
477 480
478 481
479 if (!ONLY_LATER) { 482 if (!ONLY_LATER) {
480 msg += "<B>" + (ev).description() + "</B>"; 483 msg += "<B>" + (ev).description() + "</B>";
481 if ( (ev).event().hasAlarm() ) { 484 if ( (ev).event().hasAlarm() ) {
482 msg += " <b>[with alarm]</b>"; 485 msg += " <b>[with alarm]</b>";
483 } 486 }
484 // include location or not 487 // include location or not
485 if (SHOW_LOCATION == 1) { 488 if (SHOW_LOCATION == 1) {
486 msg += "<BR><i>" + (ev).location() + "</i>"; 489 msg += "<BR><i>" + (ev).location() + "</i>";
487 } 490 }
488 491
489 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 492 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
490 msg += "<br>All day"; 493 msg += "<br>All day";
491 } else { 494 } else {
492 // start time of event 495 // start time of event
493 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) 496 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) )
494 // end time of event 497 // end time of event
495 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); 498 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) );
496 } 499 }
497 500
498 // include possible note or not 501 // include possible note or not
499 if (SHOW_NOTES == 1) { 502 if (SHOW_NOTES == 1) {
500 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); 503 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP);
501 } 504 }
502 } 505 }
503 setText(msg); 506 setText(msg);
504 connect(this, SIGNAL(clicked()), this, SLOT(editMe())); 507 connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
505 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); 508 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
506} 509}
507 510
508 511
509QString DateBookEvent::ampmTime(QTime tm) { 512QString DateBookEvent::ampmTime(QTime tm) {
510 513
511 QString s; 514 QString s;
512 if( ampm ) { 515 if( ampm ) {
513 int hour = tm.hour(); 516 int hour = tm.hour();
514 if (hour == 0) 517 if (hour == 0)
515 hour = 12; 518 hour = 12;
516 if (hour > 12) 519 if (hour > 12)
517 hour -= 12; 520 hour -= 12;