summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-04-10 16:57:56 (UTC)
committer harlekin <harlekin>2002-04-10 16:57:56 (UTC)
commitbbc11689a4f22d825a75b456811f3c8f0031b37d (patch) (unidiff)
treefb46122714b556946b556a94bd19cbe8652705e6
parent34e0e7af48992314d461be1a5a573dc0967fe260 (diff)
downloadopie-bbc11689a4f22d825a75b456811f3c8f0031b37d.zip
opie-bbc11689a4f22d825a75b456811f3c8f0031b37d.tar.gz
opie-bbc11689a4f22d825a75b456811f3c8f0031b37d.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 028947d..3d17379 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -501,93 +501,93 @@ QString DateBookEvent::ampmTime(QTime tm) {
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