summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp94
1 files changed, 56 insertions, 38 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index bdad248..fefc778 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -306,44 +306,44 @@ void KOEventViewer::appendEvent(Event *event, int mode )
mMailSubject += i18n( "Meeting " )+ event->summary();
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This event has been cancelled!"));
mText.append("<br>");
mText += "</font>";
mMailSubject += i18n("(cancelled)");
}
- if (!event->location().isEmpty()) {
- addTag("b",i18n("Location: "));
- mText.append(deTag(event->location())+"<br>");
- mMailSubject += i18n(" at ") + event->location();
- }
+
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>");
+ mMailSubject += i18n(" at ") + event->location();
+ }
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 );
@@ -375,36 +375,45 @@ void KOEventViewer::appendEvent(Event *event, int mode )
addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
//addTag("p",s);
}
addTag("b",i18n("Access: "));
mText.append(event->secrecyStr()+"<br>");
- if ( KOPrefs::instance()->mEVshowDetails ) {
- if (!event->description().isEmpty()) {
- addTag("p",i18n("<b>Details: </b>"));
- addTag("p",deTag(event->description()));
- }
- }
+
formatCategories(event);
formatReadOnly(event);
formatAttendees(event);
if ( KOPrefs::instance()->mEVshowCreated ) {
+#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 ( KOPrefs::instance()->mEVshowChanged ) {
+#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 ( KOPrefs::instance()->mEVshowDetails ) {
+ if (!event->description().isEmpty()) {
+ addTag("p",i18n("<b>Details: </b>"));
+ addTag("p",deTag(event->description()));
+ }
}
setText(mText);
//QWhatsThis::add(this,mText);
}
void KOEventViewer::appendTodo(Todo *event, int mode )
{
@@ -444,83 +453,92 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This todo has been cancelled!"));
mText.append("<br>");
mText += "</font>";
mMailSubject += i18n("(cancelled)");
}
- if (!event->location().isEmpty()) {
- addTag("b",i18n("Location: "));
- mText.append(deTag(event->location())+"<br>");
- mMailSubject += i18n(" at ") + event->location();
- }
+
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(KOPrefs::instance()->mShortDateInViewer)));
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
mMailSubject += i18n(" - " )+event->dtDueStr( true );
}
-
+ if (!event->location().isEmpty()) {
+ addTag("b",i18n("Location: "));
+ mText.append(deTag(event->location())+"<br>");
+ mMailSubject += i18n(" at ") + event->location();
+ }
+ 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("b",i18n("Access: "));
mText.append(event->secrecyStr()+"<br>");
- if ( KOPrefs::instance()->mEVshowDetails ) {
- if (!event->description().isEmpty()) {
- addTag("p",i18n("<b>Details: </b>"));
- addTag("p",deTag(event->description()));
- }
- }
formatCategories(event);
- mText.append(i18n("<p><b>Priority:</b> %2</p>")
- .arg(QString::number(event->priority())));
-
formatReadOnly(event);
formatAttendees(event);
+
+ if ( KOPrefs::instance()->mEVshowCreated ) {
+#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 ( KOPrefs::instance()->mEVshowChanged ) {
+#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 ( event->relatedTo() ) {
addTag("b",i18n("Parent todo:<br>"));
mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
}
QPtrList<Incidence> Relations = event->relations();
Incidence *to;
if ( Relations.first() )
addTag("b",i18n("Sub todos:<br>"));
for (to=Relations.first();to;to=Relations.next()) {
mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
}
- if ( KOPrefs::instance()->mEVshowCreated ) {
- addTag("p",i18n("<b>Created: ") +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
-
- }
- if ( KOPrefs::instance()->mEVshowChanged ) {
- addTag("p",i18n("<b>Last modified: ") +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
-
+
+ if ( KOPrefs::instance()->mEVshowDetails ) {
+ if (!event->description().isEmpty()) {
+ addTag("p",i18n("<b>Details: </b>"));
+ addTag("p",deTag(event->description()));
+ }
}
setText(mText);
}
void KOEventViewer::formatCategories(Incidence *event)
{
if (!event->categoriesStr().isEmpty()) {
if (event->categories().count() == 1) {