author | umopapisdn <umopapisdn> | 2003-03-22 00:35:37 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2003-03-22 00:35:37 (UTC) |
commit | 5d488108161a2dfe1377ac38226b5d8a3a438d11 (patch) (side-by-side diff) | |
tree | 1c1931f4e0a03e95ba1d1324135d6bf703c8c4fa | |
parent | ebf65f250904e0619c10b69a0428fcc538ffc167 (diff) | |
download | opie-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.
-rw-r--r-- | core/pim/datebook/datebookday.cpp | 21 |
1 files changed, 8 insertions, 13 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, setBackgroundMode( PaletteBase ); QTime start = ev.start(); QTime end = ev.end(); int y = start.hour()*60+start.minute(); int h = end.hour()*60+end.minute()-y; int rh = dateBook->dayView()->rowHeight(0); y = y*rh/60; h = h*rh/60; if ( h < 3 ) { h = 3; } geom.setY( y ); geom.setHeight( h ); geom.setX( 0 ); geom.setWidth(dateBook->dayView()->columnWidth(0)-1); } void DateBookDayWidget::setAllDayText( QString &text ) { text += "<b>" + tr("This is an all day event.") + "</b><br>"; } void DateBookDayWidget::setEventText( QString& text ) { bool whichClock = dateBook->dayView()->whichClock(); - text += "<b>" + tr("Time") + "</b>: "; - if ( ev.startDate() != ev.date() ) { - // multi-day event. Show start date - text += TimeString::longDateString( ev.startDate() ); + if ( ev.startDate() != ev.endDate() ) { + text += "<b>" + tr("Start") + "</b>: "; + text += TimeString::timeString( ev.event().start().time(), whichClock, FALSE ); + text += " - " + TimeString::longDateString( ev.startDate() ) + "<br>"; + text += "<b>" + tr("End") + "</b>: "; + text += TimeString::timeString( ev.event().end().time(), whichClock, FALSE ); + text += " - " + TimeString::longDateString( ev.endDate() ) + "<br>"; } else { - // Show start time. + text += "<b>" + tr("Time") + "</b>: "; text += TimeString::timeString( ev.start(), whichClock, FALSE ); - } - text += "<b>" + tr(" - ") + "</b>"; - if ( ev.endDate() != ev.date() ) { - // multi-day event. Show end date - text += TimeString::longDateString( ev.endDate() ); - } else { - // Show end time. text += TimeString::timeString( ev.end(), whichClock, FALSE ); } - } DateBookDayWidget::~DateBookDayWidget() { } void DateBookDayWidget::paintEvent( QPaintEvent *e ) { QPainter p( this ); if (dateBook->getSelectedWidget() == this) { p.setBrush( QColor( 155, 240, 230 ) ); // selected item } else { if (dateBook->date() == QDate::currentDate()) { QTime curTime = QTime::currentTime(); if (ev.end() < curTime) { p.setBrush( QColor( 180, 180, 180 ) ); // grey, inactive } else { |