author | zautrix <zautrix> | 2005-04-15 09:18:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-15 09:18:49 (UTC) |
commit | ab47475f1b03a8c82f9b0388549a2618743f2a69 (patch) (side-by-side diff) | |
tree | 381622b3ceb94daf771a2697ee10f0cd6572e947 /libkcal | |
parent | acb5803cdda97ef1369388eb15eb669e2835c06a (diff) | |
download | kdepimpi-ab47475f1b03a8c82f9b0388549a2618743f2a69.zip kdepimpi-ab47475f1b03a8c82f9b0388549a2618743f2a69.tar.gz kdepimpi-ab47475f1b03a8c82f9b0388549a2618743f2a69.tar.bz2 |
fixxx
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index d67ad52..8ae5b46 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -67,50 +67,50 @@ void KIncidenceFormatter::setEvent(Event *event) addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); if ( mColorMode ) mText += "</font>"; } if (event->cancelled ()) { mText +="<font color=\"#B00000\">"; addTag("i",i18n("This event has been cancelled!")); mText.append("<br>"); mText += "</font>"; } - if (!event->location().isEmpty()) { - addTag("b",i18n("Location: ")); - mText.append(deTag(event->location())+"<br>"); - } if (event->doesFloat()) { if (event->isMultiDay()) { mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") .arg(event->dtStartDateStr(shortDate)) .arg(event->dtEndDateStr(shortDate))); } else { mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); } } else { if (event->isMultiDay()) { mText.append(i18n("<p><b>From:</b> %1</p> ") .arg(event->dtStartStr( shortDate))); mText.append(i18n("<p><b>To:</b> %1</p>") .arg(event->dtEndStr(shortDate))); } else { - mText.append(i18n("<p><b>On:</b> %1</p> ") - .arg(event->dtStartDateStr( shortDate ))); mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") .arg(event->dtStartTimeStr()) .arg(event->dtEndTimeStr())); + mText.append(i18n("<p><b>On:</b> %1</p> ") + .arg(event->dtStartDateStr( shortDate ))); } } + if (!event->location().isEmpty()) { + addTag("b",i18n("Location: ")); + mText.append(deTag(event->location())+"<br>"); + } if (event->recurrence()->doesRecur()) { QString recurText = event->recurrence()->recurrenceText(); addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); bool ok; QDate start = QDate::currentDate(); QDateTime next; next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); if ( ok ) { addTag("p",i18n("<b>Next recurrence is on:</b>") ); @@ -133,44 +133,52 @@ void KIncidenceFormatter::setEvent(Event *event) QDateTime t = alarm->time(); QString s =i18n("( %1 before )").arg( alarm->offsetText() ); addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); //addTag("p",s); } addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); // mText.append(event->secrecyStr()+"<br>"); formatCategories(event); - if ( mDetails ) { - if (!event->description().isEmpty()) { - addTag("p",i18n("<b>Details: </b>")); - addTag("p",deTag(event->description())); - } - } formatReadOnly(event); formatAttendees(event); if ( mCreated ) { +#ifdef DESKTOP_VERSION + addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); +#else addTag("p",i18n("<b>Created: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); +#endif } if ( mModified ) { +#ifdef DESKTOP_VERSION + addTag("p",i18n("<b>Last modified: ") +" </b>"+KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); +#else addTag("p",i18n("<b>Last modified: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); +#endif } + if ( mDetails ) { + if (!event->description().isEmpty()) { + addTag("p",i18n("<b>Details: </b>")); + addTag("p",deTag(event->description())); + } + } } void KIncidenceFormatter::setTodo(Todo *event ) { int mode = 0; mCurrentIncidence = event; bool shortDate = true; if (mode == 0 ) addTag("h3",deTag(event->summary())); else { if ( mColorMode == 1 ) { @@ -194,75 +202,86 @@ void KIncidenceFormatter::setTodo(Todo *event ) mText += "</font>"; } else { mText.append(i18n("<p><i>%1 % completed</i></p>") .arg(event->percentComplete())); } if (event->cancelled ()) { mText +="<font color=\"#B00000\">"; addTag("i",i18n("This todo has been cancelled!")); mText.append("<br>"); mText += "</font>"; } - if (!event->location().isEmpty()) { - addTag("b",i18n("Location: ")); - mText.append(deTag(event->location())+"<br>"); - } if (event->recurrence()->doesRecur()) { QString recurText = event->recurrence()->recurrenceText(); addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); } if (event->hasStartDate()) { mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate))); } if (event->hasDueDate()) { mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); } + + if (!event->location().isEmpty()) { + addTag("b",i18n("Location: ")); + mText.append(deTag(event->location())+"<br>"); + } + mText.append(i18n("<p><b>Priority:</b> %2</p>") .arg(QString::number(event->priority()))); if (event->isAlarmEnabled()) { Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); QString s =i18n("( %1 before )").arg( alarm->offsetText() ); addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); //addTag("p",s); } addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); formatCategories(event); - if ( mDetails ) { - if (!event->description().isEmpty()) { - addTag("p",i18n("<b>Details: </b>")); - addTag("p",deTag(event->description())); - } - } + formatReadOnly(event); formatAttendees(event); if ( mCreated ) { +#ifdef DESKTOP_VERSION + addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); +#else addTag("p",i18n("<b>Created: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); +#endif } if ( mModified ) { +#ifdef DESKTOP_VERSION + addTag("p",i18n("<b>Last modified: ") +" </b>"+KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); +#else addTag("p",i18n("<b>Last modified: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); +#endif } + if ( mDetails ) { + if (!event->description().isEmpty()) { + addTag("p",i18n("<b>Details: </b>")); + addTag("p",deTag(event->description())); + } + } } void KIncidenceFormatter::setJournal(Journal* ) { } void KIncidenceFormatter::formatCategories(Incidence *event) { if (!event->categoriesStr().isEmpty()) { addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); //mText.append(event->categoriesStr()); |