summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
Unidiff
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 1fcc977..cee0466 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -339,70 +339,84 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
339 } 339 }
340 if ( mode == 1 ) { 340 if ( mode == 1 ) {
341 addTag("h2",i18n( "Local: " ) +event->summary()); 341 addTag("h2",i18n( "Local: " ) +event->summary());
342 } else { 342 } else {
343 addTag("h2",i18n( "Remote: " ) +event->summary()); 343 addTag("h2",i18n( "Remote: " ) +event->summary());
344 } 344 }
345 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 345 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
346 if ( mColorMode ) 346 if ( mColorMode )
347 mText += "</font>"; 347 mText += "</font>";
348 } 348 }
349 mMailSubject += i18n( "Todo " )+ event->summary(); 349 mMailSubject += i18n( "Todo " )+ event->summary();
350 if (event->cancelled ()) { 350 if (event->cancelled ()) {
351 mText +="<font color=\"#B00000\">"; 351 mText +="<font color=\"#B00000\">";
352 addTag("i",i18n("This todo has been cancelled!")); 352 addTag("i",i18n("This todo has been cancelled!"));
353 mText.append("<br>"); 353 mText.append("<br>");
354 mText += "</font>"; 354 mText += "</font>";
355 mMailSubject += i18n("(cancelled)"); 355 mMailSubject += i18n("(cancelled)");
356 } 356 }
357 357
358 if (!event->location().isEmpty()) { 358 if (!event->location().isEmpty()) {
359 addTag("b",i18n("Location: ")); 359 addTag("b",i18n("Location: "));
360 mText.append(event->location()+"<br>"); 360 mText.append(event->location()+"<br>");
361 mMailSubject += i18n(" at ") + event->location(); 361 mMailSubject += i18n(" at ") + event->location();
362 } 362 }
363 if (event->hasStartDate()) {
364 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
365 }
363 if (event->hasDueDate()) { 366 if (event->hasDueDate()) {
364 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 367 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
365 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 368 mMailSubject += i18n(" - " )+event->dtDueStr( true );
366 } 369 }
367 addTag("b",i18n("Access: ")); 370 addTag("b",i18n("Access: "));
368 mText.append(event->secrecyStr()+"<br>"); 371 mText.append(event->secrecyStr()+"<br>");
369 if (!event->description().isEmpty()) { 372 if (!event->description().isEmpty()) {
370 addTag("p",i18n("<b>Details: </b>")); 373 addTag("p",i18n("<b>Details: </b>"));
371 addTag("p",event->description()); 374 addTag("p",event->description());
372 } 375 }
373 376
374 formatCategories(event); 377 formatCategories(event);
375 378
376 mText.append(i18n("<p><b>Priority:</b> %2</p>") 379 mText.append(i18n("<p><b>Priority:</b> %2</p>")
377 .arg(QString::number(event->priority()))); 380 .arg(QString::number(event->priority())));
378 381
379 mText.append(i18n("<p><i>%1 % completed</i></p>") 382 mText.append(i18n("<p><i>%1 % completed</i></p>")
380 .arg(event->percentComplete())); 383 .arg(event->percentComplete()));
381 384
382 formatReadOnly(event); 385 formatReadOnly(event);
383 formatAttendees(event); 386 formatAttendees(event);
387 if ( event->relatedTo() ) {
388 addTag("b",i18n("Parent todo: "));
389 mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
390 }
391 QPtrList<Incidence> Relations = event->relations();
392 Incidence *to;
393 if ( Relations.first() )
394 addTag("b",i18n("Sub todos:<br>"));
395 for (to=Relations.first();to;to=Relations.next()) {
396 mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
384 397
398 }
385 setText(mText); 399 setText(mText);
386} 400}
387 401
388void KOEventViewer::formatCategories(Incidence *event) 402void KOEventViewer::formatCategories(Incidence *event)
389{ 403{
390 if (!event->categoriesStr().isEmpty()) { 404 if (!event->categoriesStr().isEmpty()) {
391 if (event->categories().count() == 1) { 405 if (event->categories().count() == 1) {
392 addTag("h3",i18n("Category")); 406 addTag("h3",i18n("Category"));
393 } else { 407 } else {
394 addTag("h3",i18n("Categories")); 408 addTag("h3",i18n("Categories"));
395 } 409 }
396 addTag("p",event->categoriesStr()); 410 addTag("p",event->categoriesStr());
397 } 411 }
398} 412}
399void KOEventViewer::formatAttendees(Incidence *event) 413void KOEventViewer::formatAttendees(Incidence *event)
400{ 414{
401 QPtrList<Attendee> attendees = event->attendees(); 415 QPtrList<Attendee> attendees = event->attendees();
402 if (attendees.count()) { 416 if (attendees.count()) {
403 417
404 418
405 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 419 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
406 addTag("h3",i18n("Organizer")); 420 addTag("h3",i18n("Organizer"));
407 mText.append("<ul><li>"); 421 mText.append("<ul><li>");
408#ifndef KORG_NOKABC 422#ifndef KORG_NOKABC