Diffstat (limited to 'core/pim/datebook/datebookday.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookday.cpp | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 9cc5fcd..5474cfc 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -566,7 +566,7 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, | |||
566 | DateBookDay *db ) | 566 | DateBookDay *db ) |
567 | : QWidget( db->dayView()->viewport() ), ev( e ), dateBook( db ) | 567 | : QWidget( db->dayView()->viewport() ), ev( e ), dateBook( db ) |
568 | { | 568 | { |
569 | bool whichClock = db->dayView()->whichClock(); | 569 | |
570 | 570 | ||
571 | // why would someone use "<"? Oh well, fix it up... | 571 | // why would someone use "<"? Oh well, fix it up... |
572 | // I wonder what other things may be messed up... | 572 | // I wonder what other things may be messed up... |
@@ -597,27 +597,14 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, | |||
597 | } | 597 | } |
598 | 598 | ||
599 | text = "<b>" + strDesc + "</b><br>" + "<i>" | 599 | text = "<b>" + strDesc + "</b><br>" + "<i>" |
600 | + strCat + "</i>" | 600 | + strCat + "</i><br>"; |
601 | + "<br><b>" + tr("Start") + "</b>: "; | 601 | if (ev.event().type() == Event::Normal ) |
602 | 602 | setEventText( text ); | |
603 | 603 | else | |
604 | if ( e.startDate() != ev.date() ) { | 604 | setAllDayText( text ); |
605 | // multi-day event. Show start date | ||
606 | text += TimeString::longDateString( e.startDate() ); | ||
607 | } else { | ||
608 | // Show start time. | ||
609 | text += TimeString::timeString( ev.start(), whichClock, FALSE ); | ||
610 | } | ||
611 | 605 | ||
612 | text += "<br><b>" + tr("End") + "</b>: "; | ||
613 | if ( e.endDate() != ev.date() ) { | ||
614 | // multi-day event. Show end date | ||
615 | text += TimeString::longDateString( e.endDate() ); | ||
616 | } else { | ||
617 | // Show end time. | ||
618 | text += TimeString::timeString( ev.end(), whichClock, FALSE ); | ||
619 | } | ||
620 | text += "<br><br>" + strNote; | 606 | text += "<br><br>" + strNote; |
607 | |||
621 | setBackgroundMode( PaletteBase ); | 608 | setBackgroundMode( PaletteBase ); |
622 | 609 | ||
623 | QTime start = ev.start(); | 610 | QTime start = ev.start(); |
@@ -635,6 +622,30 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, | |||
635 | geom.setWidth(dateBook->dayView()->columnWidth(0)-1); | 622 | geom.setWidth(dateBook->dayView()->columnWidth(0)-1); |
636 | 623 | ||
637 | } | 624 | } |
625 | void DateBookDayWidget::setAllDayText( QString &text ) { | ||
626 | text += "<b>" + tr("This is an all day event.") + "</b><br>"; | ||
627 | } | ||
628 | void DateBookDayWidget::setEventText( QString& text ) { | ||
629 | bool whichClock = dateBook->dayView()->whichClock(); | ||
630 | text += "<b>" + tr("Start") + "</b>: "; | ||
631 | if ( ev.startDate() != ev.date() ) { | ||
632 | // multi-day event. Show start date | ||
633 | text += TimeString::longDateString( ev.startDate() ); | ||
634 | } else { | ||
635 | // Show start time. | ||
636 | text += TimeString::timeString( ev.start(), whichClock, FALSE ); | ||
637 | } | ||
638 | |||
639 | text += "<br><b>" + tr("End") + "</b>: "; | ||
640 | if ( ev.endDate() != ev.date() ) { | ||
641 | // multi-day event. Show end date | ||
642 | text += TimeString::longDateString( ev.endDate() ); | ||
643 | } else { | ||
644 | // Show end time. | ||
645 | text += TimeString::timeString( ev.end(), whichClock, FALSE ); | ||
646 | } | ||
647 | |||
648 | } | ||
638 | 649 | ||
639 | DateBookDayWidget::~DateBookDayWidget() | 650 | DateBookDayWidget::~DateBookDayWidget() |
640 | { | 651 | { |
@@ -689,6 +700,7 @@ void DateBookDayWidget::paintEvent( QPaintEvent *e ) | |||
689 | if ( ev.event().hasRepeat() ) { | 700 | if ( ev.event().hasRepeat() ) { |
690 | p.drawPixmap( width() - 16, y, Resource::loadPixmap( "repeat" ) ); | 701 | p.drawPixmap( width() - 16, y, Resource::loadPixmap( "repeat" ) ); |
691 | d = 20; | 702 | d = 20; |
703 | y += 20; | ||
692 | } | 704 | } |
693 | 705 | ||
694 | QSimpleRichText rt( text, font() ); | 706 | QSimpleRichText rt( text, font() ); |