Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 39921a0..f6c9624 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -357,96 +357,103 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
357 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 357 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
358 | { | 358 | { |
359 | mMailSubject = ""; | 359 | mMailSubject = ""; |
360 | mCurrentIncidence = event; | 360 | mCurrentIncidence = event; |
361 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 361 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
362 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 362 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
363 | if (mode == 0 ) | 363 | if (mode == 0 ) |
364 | addTag("h2",event->summary()); | 364 | addTag("h2",event->summary()); |
365 | else { | 365 | else { |
366 | if ( mColorMode == 1 ) { | 366 | if ( mColorMode == 1 ) { |
367 | mText +="<font color=\"#00A000\">"; | 367 | mText +="<font color=\"#00A000\">"; |
368 | } | 368 | } |
369 | if ( mColorMode == 2 ) { | 369 | if ( mColorMode == 2 ) { |
370 | mText +="<font color=\"#B00000\">"; | 370 | mText +="<font color=\"#B00000\">"; |
371 | } | 371 | } |
372 | if ( mode == 1 ) { | 372 | if ( mode == 1 ) { |
373 | addTag("h2",i18n( "Local: " ) +event->summary()); | 373 | addTag("h2",i18n( "Local: " ) +event->summary()); |
374 | } else { | 374 | } else { |
375 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 375 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
376 | } | 376 | } |
377 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 377 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
378 | if ( mColorMode ) | 378 | if ( mColorMode ) |
379 | mText += "</font>"; | 379 | mText += "</font>"; |
380 | } | 380 | } |
381 | mMailSubject += i18n( "Todo " )+ event->summary(); | 381 | mMailSubject += i18n( "Todo " )+ event->summary(); |
382 | 382 | ||
383 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 383 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
384 | mText +="<font color=\"#B00000\">"; | 384 | mText +="<font color=\"#B00000\">"; |
385 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 385 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
386 | mText += "</font>"; | 386 | mText += "</font>"; |
387 | } else { | 387 | } else { |
388 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 388 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
389 | .arg(event->percentComplete())); | 389 | .arg(event->percentComplete())); |
390 | } | 390 | } |
391 | 391 | ||
392 | if (event->cancelled ()) { | 392 | if (event->cancelled ()) { |
393 | mText +="<font color=\"#B00000\">"; | 393 | mText +="<font color=\"#B00000\">"; |
394 | addTag("i",i18n("This todo has been cancelled!")); | 394 | addTag("i",i18n("This todo has been cancelled!")); |
395 | mText.append("<br>"); | 395 | mText.append("<br>"); |
396 | mText += "</font>"; | 396 | mText += "</font>"; |
397 | mMailSubject += i18n("(cancelled)"); | 397 | mMailSubject += i18n("(cancelled)"); |
398 | } | 398 | } |
399 | 399 | ||
400 | if (!event->location().isEmpty()) { | 400 | if (!event->location().isEmpty()) { |
401 | addTag("b",i18n("Location: ")); | 401 | addTag("b",i18n("Location: ")); |
402 | mText.append(event->location()+"<br>"); | 402 | mText.append(event->location()+"<br>"); |
403 | mMailSubject += i18n(" at ") + event->location(); | 403 | mMailSubject += i18n(" at ") + event->location(); |
404 | } | 404 | } |
405 | |||
406 | if (event->recurrence()->doesRecur()) { | ||
407 | |||
408 | QString recurText = event->recurrence()->recurrenceText(); | ||
409 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | ||
410 | |||
411 | } | ||
405 | if (event->hasStartDate()) { | 412 | if (event->hasStartDate()) { |
406 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 413 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
407 | } | 414 | } |
408 | if (event->hasDueDate()) { | 415 | if (event->hasDueDate()) { |
409 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 416 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
410 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 417 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
411 | } | 418 | } |
412 | addTag("b",i18n("Access: ")); | 419 | addTag("b",i18n("Access: ")); |
413 | mText.append(event->secrecyStr()+"<br>"); | 420 | mText.append(event->secrecyStr()+"<br>"); |
414 | if (!event->description().isEmpty()) { | 421 | if (!event->description().isEmpty()) { |
415 | addTag("p",i18n("<b>Details: </b>")); | 422 | addTag("p",i18n("<b>Details: </b>")); |
416 | addTag("p",event->description()); | 423 | addTag("p",event->description()); |
417 | } | 424 | } |
418 | 425 | ||
419 | formatCategories(event); | 426 | formatCategories(event); |
420 | 427 | ||
421 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 428 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
422 | .arg(QString::number(event->priority()))); | 429 | .arg(QString::number(event->priority()))); |
423 | 430 | ||
424 | formatReadOnly(event); | 431 | formatReadOnly(event); |
425 | formatAttendees(event); | 432 | formatAttendees(event); |
426 | if ( event->relatedTo() ) { | 433 | if ( event->relatedTo() ) { |
427 | addTag("b",i18n("Parent todo:<br>")); | 434 | addTag("b",i18n("Parent todo:<br>")); |
428 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 435 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
429 | } | 436 | } |
430 | QPtrList<Incidence> Relations = event->relations(); | 437 | QPtrList<Incidence> Relations = event->relations(); |
431 | Incidence *to; | 438 | Incidence *to; |
432 | if ( Relations.first() ) | 439 | if ( Relations.first() ) |
433 | addTag("b",i18n("Sub todos:<br>")); | 440 | addTag("b",i18n("Sub todos:<br>")); |
434 | for (to=Relations.first();to;to=Relations.next()) { | 441 | for (to=Relations.first();to;to=Relations.next()) { |
435 | mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); | 442 | mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); |
436 | 443 | ||
437 | } | 444 | } |
438 | setText(mText); | 445 | setText(mText); |
439 | } | 446 | } |
440 | 447 | ||
441 | void KOEventViewer::formatCategories(Incidence *event) | 448 | void KOEventViewer::formatCategories(Incidence *event) |
442 | { | 449 | { |
443 | if (!event->categoriesStr().isEmpty()) { | 450 | if (!event->categoriesStr().isEmpty()) { |
444 | if (event->categories().count() == 1) { | 451 | if (event->categories().count() == 1) { |
445 | addTag("h3",i18n("Category")); | 452 | addTag("h3",i18n("Category")); |
446 | } else { | 453 | } else { |
447 | addTag("h3",i18n("Categories")); | 454 | addTag("h3",i18n("Categories")); |
448 | } | 455 | } |
449 | addTag("p",event->categoriesStr()); | 456 | addTag("p",event->categoriesStr()); |
450 | } | 457 | } |
451 | } | 458 | } |
452 | void KOEventViewer::formatAttendees(Incidence *event) | 459 | void KOEventViewer::formatAttendees(Incidence *event) |