From af4a3940dd672423da28b54e5d955cc5d33cecda Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 25 Jun 2002 19:55:53 +0000 Subject: All day events are not from 00:00 to 23:59 they're all day now. --- (limited to 'core/pim/datebook/datebookday.cpp') 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, DateBookDay *db ) : QWidget( db->dayView()->viewport() ), ev( e ), dateBook( db ) { - bool whichClock = db->dayView()->whichClock(); + // why would someone use "<"? Oh well, fix it up... // I wonder what other things may be messed up... @@ -597,27 +597,14 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, } text = "" + strDesc + "
" + "" - + strCat + "" - + "
" + tr("Start") + ": "; - - - if ( e.startDate() != ev.date() ) { - // multi-day event. Show start date - text += TimeString::longDateString( e.startDate() ); - } else { - // Show start time. - text += TimeString::timeString( ev.start(), whichClock, FALSE ); - } + + strCat + "
"; + if (ev.event().type() == Event::Normal ) + setEventText( text ); + else + setAllDayText( text ); - text += "
" + tr("End") + ": "; - if ( e.endDate() != ev.date() ) { - // multi-day event. Show end date - text += TimeString::longDateString( e.endDate() ); - } else { - // Show end time. - text += TimeString::timeString( ev.end(), whichClock, FALSE ); - } text += "

" + strNote; + setBackgroundMode( PaletteBase ); QTime start = ev.start(); @@ -635,6 +622,30 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e, geom.setWidth(dateBook->dayView()->columnWidth(0)-1); } +void DateBookDayWidget::setAllDayText( QString &text ) { + text += "" + tr("This is an all day event.") + "
"; +} +void DateBookDayWidget::setEventText( QString& text ) { + bool whichClock = dateBook->dayView()->whichClock(); + text += "" + tr("Start") + ": "; + if ( ev.startDate() != ev.date() ) { + // multi-day event. Show start date + text += TimeString::longDateString( ev.startDate() ); + } else { + // Show start time. + text += TimeString::timeString( ev.start(), whichClock, FALSE ); + } + + text += "
" + tr("End") + ": "; + 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() { @@ -689,6 +700,7 @@ void DateBookDayWidget::paintEvent( QPaintEvent *e ) if ( ev.event().hasRepeat() ) { p.drawPixmap( width() - 16, y, Resource::loadPixmap( "repeat" ) ); d = 20; + y += 20; } QSimpleRichText rt( text, font() ); -- cgit v0.9.0.2