-rw-r--r-- | libopie/pim/oevent.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp index 83b191f..e4f5d92 100644 --- a/libopie/pim/oevent.cpp +++ b/libopie/pim/oevent.cpp @@ -236,10 +236,30 @@ bool OEvent::match( const QRegExp& re )const { } QString OEvent::toRichText()const { - QString text; + QString text, value; + + // description + text += "<b><h3><img src=\"datebook/DateBook\">"; if ( !description().isEmpty() ) { - text += "<b>" + QObject::tr( "Description:") + "</b><br>"; - text += Qtopia::escapeString(description() ). - replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; + text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "" ); + } + text += "</h3></b><br><hr><br>"; + + // location + if ( !(value = location()).isEmpty() ) { + text += "<b>" + QObject::tr( "Location:" ) + "</b> "; + text += Qtopia::escapeString(value) + "<br>"; + } + + // all day event + if ( isAllDay() ) { + text += "<b><i>" + QObject::tr( "This is an all day event" ) + "</i></b><br>"; } + // multiple day event + else if ( isMultipleDay () ) { + text += "<b><i>" + QObject::tr( "This is a multiple day event" ) + "</i></b><br>"; + } + // start & end times + else { + // start time if ( startDateTime().isValid() ) { text += "<b>" + QObject::tr( "Start:") + "</b> "; @@ -247,4 +267,6 @@ QString OEvent::toRichText()const { replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; } + + // end time if ( endDateTime().isValid() ) { text += "<b>" + QObject::tr( "End:") + "</b> "; @@ -252,4 +274,14 @@ QString OEvent::toRichText()const { replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; } + } + + // categories + if ( categoryNames("Calendar").count() ){ + text += "<b>" + QObject::tr( "Category:") + "</b> "; + text += categoryNames("Calendar").join(", "); + text += "<br>"; + } + + //notes if ( !note().isEmpty() ) { text += "<b>" + QObject::tr( "Note:") + "</b><br>"; |