summaryrefslogtreecommitdiff
path: root/core
authorumopapisdn <umopapisdn>2003-03-22 00:35:37 (UTC)
committer umopapisdn <umopapisdn>2003-03-22 00:35:37 (UTC)
commit5d488108161a2dfe1377ac38226b5d8a3a438d11 (patch) (unidiff)
tree1c1931f4e0a03e95ba1d1324135d6bf703c8c4fa /core
parentebf65f250904e0619c10b69a0428fcc538ffc167 (diff)
downloadopie-5d488108161a2dfe1377ac38226b5d8a3a438d11.zip
opie-5d488108161a2dfe1377ac38226b5d8a3a438d11.tar.gz
opie-5d488108161a2dfe1377ac38226b5d8a3a438d11.tar.bz2
More informative dayview text:
An event that begins and ends on the same day is only mentioned by start and end time. An event that spans across multiple days, is also mentioned with start and end date.
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookday.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp
index aaf3e16..a6a1be3 100644
--- a/core/pim/datebook/datebookday.cpp
+++ b/core/pim/datebook/datebookday.cpp
@@ -610,66 +610,61 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e,
610 610
611 setBackgroundMode( PaletteBase ); 611 setBackgroundMode( PaletteBase );
612 612
613 QTime start = ev.start(); 613 QTime start = ev.start();
614 QTime end = ev.end(); 614 QTime end = ev.end();
615 int y = start.hour()*60+start.minute(); 615 int y = start.hour()*60+start.minute();
616 int h = end.hour()*60+end.minute()-y; 616 int h = end.hour()*60+end.minute()-y;
617 int rh = dateBook->dayView()->rowHeight(0); 617 int rh = dateBook->dayView()->rowHeight(0);
618 y = y*rh/60; 618 y = y*rh/60;
619 h = h*rh/60; 619 h = h*rh/60;
620 if ( h < 3 ) { 620 if ( h < 3 ) {
621 h = 3; 621 h = 3;
622 } 622 }
623 geom.setY( y ); 623 geom.setY( y );
624 geom.setHeight( h ); 624 geom.setHeight( h );
625 geom.setX( 0 ); 625 geom.setX( 0 );
626 geom.setWidth(dateBook->dayView()->columnWidth(0)-1); 626 geom.setWidth(dateBook->dayView()->columnWidth(0)-1);
627 627
628} 628}
629void DateBookDayWidget::setAllDayText( QString &text ) { 629void DateBookDayWidget::setAllDayText( QString &text ) {
630 text += "<b>" + tr("This is an all day event.") + "</b><br>"; 630 text += "<b>" + tr("This is an all day event.") + "</b><br>";
631} 631}
632void DateBookDayWidget::setEventText( QString& text ) { 632void DateBookDayWidget::setEventText( QString& text ) {
633 bool whichClock = dateBook->dayView()->whichClock(); 633 bool whichClock = dateBook->dayView()->whichClock();
634 text += "<b>" + tr("Time") + "</b>: "; 634 if ( ev.startDate() != ev.endDate() ) {
635 if ( ev.startDate() != ev.date() ) { 635 text += "<b>" + tr("Start") + "</b>: ";
636 // multi-day event. Show start date 636 text += TimeString::timeString( ev.event().start().time(), whichClock, FALSE );
637 text += TimeString::longDateString( ev.startDate() ); 637 text += " - " + TimeString::longDateString( ev.startDate() ) + "<br>";
638 text += "<b>" + tr("End") + "</b>: ";
639 text += TimeString::timeString( ev.event().end().time(), whichClock, FALSE );
640 text += " - " + TimeString::longDateString( ev.endDate() ) + "<br>";
638 } else { 641 } else {
639 // Show start time. 642 text += "<b>" + tr("Time") + "</b>: ";
640 text += TimeString::timeString( ev.start(), whichClock, FALSE ); 643 text += TimeString::timeString( ev.start(), whichClock, FALSE );
641 } 644 text += "<b>" + tr(" - ") + "</b>";
642
643 text += "<b>" + tr(" - ") + "</b>";
644 if ( ev.endDate() != ev.date() ) {
645 // multi-day event. Show end date
646 text += TimeString::longDateString( ev.endDate() );
647 } else {
648 // Show end time.
649 text += TimeString::timeString( ev.end(), whichClock, FALSE ); 645 text += TimeString::timeString( ev.end(), whichClock, FALSE );
650 } 646 }
651
652} 647}
653 648
654DateBookDayWidget::~DateBookDayWidget() 649DateBookDayWidget::~DateBookDayWidget()
655{ 650{
656} 651}
657 652
658void DateBookDayWidget::paintEvent( QPaintEvent *e ) 653void DateBookDayWidget::paintEvent( QPaintEvent *e )
659{ 654{
660 QPainter p( this ); 655 QPainter p( this );
661 656
662 if (dateBook->getSelectedWidget() == this) 657 if (dateBook->getSelectedWidget() == this)
663 { 658 {
664 p.setBrush( QColor( 155, 240, 230 ) ); // selected item 659 p.setBrush( QColor( 155, 240, 230 ) ); // selected item
665 } else 660 } else
666 { 661 {
667 if (dateBook->date() == QDate::currentDate()) 662 if (dateBook->date() == QDate::currentDate())
668 { 663 {
669 QTime curTime = QTime::currentTime(); 664 QTime curTime = QTime::currentTime();
670 665
671 if (ev.end() < curTime) 666 if (ev.end() < curTime)
672 { 667 {
673 p.setBrush( QColor( 180, 180, 180 ) ); // grey, inactive 668 p.setBrush( QColor( 180, 180, 180 ) ); // grey, inactive
674 } else 669 } else
675 { 670 {