summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-04-10 17:01:21 (UTC)
committer harlekin <harlekin>2002-04-10 17:01:21 (UTC)
commit5504a71f3e65673a3eea23051d0043f2b483276b (patch) (unidiff)
tree83ef0b4af63a1ebe665e03eae1422f3d6956c208
parentbbc11689a4f22d825a75b456811f3c8f0031b37d (diff)
downloadopie-5504a71f3e65673a3eea23051d0043f2b483276b.zip
opie-5504a71f3e65673a3eea23051d0043f2b483276b.tar.gz
opie-5504a71f3e65673a3eea23051d0043f2b483276b.tar.bz2
paperbag, no it is
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 3d17379..6dac6d9 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -434,160 +434,160 @@ void Today::startTodo() {
434 e << QString("todolist"); 434 e << QString("todolist");
435} 435}
436 436
437/* 437/*
438 * launch opiemail 438 * launch opiemail
439 */ 439 */
440void Today::startMail() { 440void Today::startMail() {
441 QCopEnvelope e("QPE/System", "execute(QString)"); 441 QCopEnvelope e("QPE/System", "execute(QString)");
442 e << QString("opiemail"); 442 e << QString("opiemail");
443} 443}
444 444
445 445
446Today::~Today() { 446Today::~Today() {
447} 447}
448 448
449/* 449/*
450 * Gets the events for the current day, if it should get all dates 450 * Gets the events for the current day, if it should get all dates
451 */ 451 */
452DateBookEvent::DateBookEvent(const EffectiveEvent &ev, 452DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
453 QWidget* parent = 0, 453 QWidget* parent = 0,
454 int SHOW_LOCATION = 0, 454 int SHOW_LOCATION = 0,
455 int SHOW_NOTES = 0, 455 int SHOW_NOTES = 0,
456 const char* name = 0, 456 const char* name = 0,
457 WFlags fl = 0) : 457 WFlags fl = 0) :
458 ClickableLabel(parent,name,fl), event(ev) { 458 ClickableLabel(parent,name,fl), event(ev) {
459 459
460 QString msg; 460 QString msg;
461 //QTime time = QTime::currentTime(); 461 //QTime time = QTime::currentTime();
462 462
463 Config config( "qpe" ); 463 Config config( "qpe" );
464 // if 24 h format 464 // if 24 h format
465 ampm = config.readBoolEntry( "AMPM", TRUE ); 465 ampm = config.readBoolEntry( "AMPM", TRUE );
466 466
467 467
468 if (!ONLY_LATER) { 468 if (!ONLY_LATER) {
469 msg += "<B>" + (ev).description() + "</B>"; 469 msg += "<B>" + (ev).description() + "</B>";
470 if ( (ev).event().hasAlarm() ) { 470 if ( (ev).event().hasAlarm() ) {
471 msg += " <b>[with alarm]</b>"; 471 msg += " <b>[with alarm]</b>";
472 } 472 }
473 // include location or not 473 // include location or not
474 if (SHOW_LOCATION == 1) { 474 if (SHOW_LOCATION == 1) {
475 msg += "<BR><i>" + (ev).location() + "</i>"; 475 msg += "<BR><i>" + (ev).location() + "</i>";
476 } 476 }
477 477
478 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 478 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
479 msg += "<br>All day"; 479 msg += "<br>All day";
480 } else { 480 } else {
481 // start time of event 481 // start time of event
482 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ); 482 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) )
483 // end time of event 483 // end time of event
484 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); 484 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) );
485 } 485 }
486 486
487 // include possible note or not 487 // include possible note or not
488 if (SHOW_NOTES == 1) { 488 if (SHOW_NOTES == 1) {
489 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); 489 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP);
490 } 490 }
491 } 491 }
492 setText(msg); 492 setText(msg);
493 connect(this, SIGNAL(clicked()), this, SLOT(editMe())); 493 connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
494 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); 494 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
495} 495}
496 496
497 497
498QString DateBookEvent::ampmTime(QTime tm) { 498QString DateBookEvent::ampmTime(QTime tm) {
499 499
500 QString s; 500 QString s;
501 if( ampm ) { 501 if( ampm ) {
502 int hour = tm.hour(); 502 int hour = tm.hour();
503 if (hour == 0) 503 if (hour == 0)
504 hour = 12; 504 hour = 12;
505 if (hour > 12) 505 if (hour > 12)
506 hour -= 12; 506 hour -= 12;
507 s.sprintf( "%2d:%02d %s", hour, tm.minute(), 507 s.sprintf( "%2d:%02d %s", hour, tm.minute(),
508 (tm.hour() >= 12) ? "PM" : "AM" ); 508 (tm.hour() >= 12) ? "PM" : "AM" );
509 return s; 509 return s;
510 } else { 510 } else {
511 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); 511 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
512 return s; 512 return s;
513 } 513 }
514 514
515} 515}
516 516
517 517
518DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, 518DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev,
519 QWidget* parent = 0, 519 QWidget* parent = 0,
520 int SHOW_LOCATION = 0, 520 int SHOW_LOCATION = 0,
521 int SHOW_NOTES = 0, 521 int SHOW_NOTES = 0,
522 const char* name = 0, 522 const char* name = 0,
523 WFlags fl = 0) : 523 WFlags fl = 0) :
524 ClickableLabel(parent,name,fl), event(ev) { 524 ClickableLabel(parent,name,fl), event(ev) {
525 525
526 QString msg; 526 QString msg;
527 QTime time = QTime::currentTime(); 527 QTime time = QTime::currentTime();
528 528
529 Config config( "qpe" ); 529 Config config( "qpe" );
530 // if 24 h format 530 // if 24 h format
531 ampm = config.readBoolEntry( "AMPM", TRUE ); 531 ampm = config.readBoolEntry( "AMPM", TRUE );
532 532
533 533
534 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { 534 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) {
535 // show only later appointments 535 // show only later appointments
536 msg += "<B>" + (ev).description() + "</B>"; 536 msg += "<B>" + (ev).description() + "</B>";
537 if ( (ev).event().hasAlarm() ) { 537 if ( (ev).event().hasAlarm() ) {
538 msg += " <b>[with alarm]</b>"; 538 msg += " <b>[with alarm]</b>";
539 } 539 }
540 // include location or not 540 // include location or not
541 if (SHOW_LOCATION == 1) { 541 if (SHOW_LOCATION == 1) {
542 msg += "<BR><i>" + (ev).location() + "</i>"; 542 msg += "<BR><i>" + (ev).location() + "</i>";
543 } 543 }
544 544
545 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 545 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
546 msg += "<br>All day"; 546 msg += "<br>All day";
547 } else { 547 } else {
548 // start time of event 548 // start time of event
549 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ); 549 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) )
550 // end time of event 550 // end time of event
551 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); 551 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) );
552 } 552 }
553 // include possible note or not 553 // include possible note or not
554 if (SHOW_NOTES == 1) { 554 if (SHOW_NOTES == 1) {
555 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); 555 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP);
556 } 556 }
557 } 557 }
558 558
559 setText(msg); 559 setText(msg);
560 connect(this, SIGNAL(clicked()), this, SLOT(editMe())); 560 connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
561 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); 561 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
562} 562}
563 563
564 564
565QString DateBookEventLater::ampmTime(QTime tm) { 565QString DateBookEventLater::ampmTime(QTime tm) {
566 566
567 QString s; 567 QString s;
568 if( ampm ) { 568 if( ampm ) {
569 int hour = tm.hour(); 569 int hour = tm.hour();
570 if (hour == 0) 570 if (hour == 0)
571 hour = 12; 571 hour = 12;
572 if (hour > 12) 572 if (hour > 12)
573 hour -= 12; 573 hour -= 12;
574 s.sprintf( "%2d:%02d %s", hour, tm.minute(), 574 s.sprintf( "%2d:%02d %s", hour, tm.minute(),
575 (tm.hour() >= 12) ? "PM" : "AM" ); 575 (tm.hour() >= 12) ? "PM" : "AM" );
576 return s; 576 return s;
577 } else { 577 } else {
578 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); 578 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
579 return s; 579 return s;
580 } 580 }
581 581
582} 582}
583 583
584 584
585void DateBookEvent::editMe() { 585void DateBookEvent::editMe() {
586 emit editEvent(event.event()); 586 emit editEvent(event.event());
587} 587}
588 588
589void DateBookEventLater::editMe() { 589void DateBookEventLater::editMe() {
590 emit editEvent(event.event()); 590 emit editEvent(event.event());
591} 591}
592 592
593 593