Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 2f0fa9e..36a2947 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -334,98 +334,103 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
334 | if ( mColorMode == 1 ) { | 334 | if ( mColorMode == 1 ) { |
335 | mText +="<font color=\"#00A000\">"; | 335 | mText +="<font color=\"#00A000\">"; |
336 | } | 336 | } |
337 | if ( mColorMode == 2 ) { | 337 | if ( mColorMode == 2 ) { |
338 | mText +="<font color=\"#B00000\">"; | 338 | mText +="<font color=\"#B00000\">"; |
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()) { | 363 | if (event->hasStartDate()) { |
364 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 364 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
365 | } | 365 | } |
366 | if (event->hasDueDate()) { | 366 | if (event->hasDueDate()) { |
367 | 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))); |
368 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 368 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
369 | } | 369 | } |
370 | addTag("b",i18n("Access: ")); | 370 | addTag("b",i18n("Access: ")); |
371 | mText.append(event->secrecyStr()+"<br>"); | 371 | mText.append(event->secrecyStr()+"<br>"); |
372 | if (!event->description().isEmpty()) { | 372 | if (!event->description().isEmpty()) { |
373 | addTag("p",i18n("<b>Details: </b>")); | 373 | addTag("p",i18n("<b>Details: </b>")); |
374 | addTag("p",event->description()); | 374 | addTag("p",event->description()); |
375 | } | 375 | } |
376 | 376 | ||
377 | formatCategories(event); | 377 | formatCategories(event); |
378 | 378 | ||
379 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 379 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
380 | .arg(QString::number(event->priority()))); | 380 | .arg(QString::number(event->priority()))); |
381 | 381 | ||
382 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | ||
383 | mText.append(i18n("<p><i>Completed on %1</i></p>") | ||
384 | .arg( event->completedStr() )); | ||
385 | } else { | ||
382 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 386 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
383 | .arg(event->percentComplete())); | 387 | .arg(event->percentComplete())); |
388 | } | ||
384 | 389 | ||
385 | formatReadOnly(event); | 390 | formatReadOnly(event); |
386 | formatAttendees(event); | 391 | formatAttendees(event); |
387 | if ( event->relatedTo() ) { | 392 | if ( event->relatedTo() ) { |
388 | addTag("b",i18n("Parent todo: ")); | 393 | addTag("b",i18n("Parent todo: ")); |
389 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 394 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
390 | } | 395 | } |
391 | QPtrList<Incidence> Relations = event->relations(); | 396 | QPtrList<Incidence> Relations = event->relations(); |
392 | Incidence *to; | 397 | Incidence *to; |
393 | if ( Relations.first() ) | 398 | if ( Relations.first() ) |
394 | addTag("b",i18n("Sub todos:<br>")); | 399 | addTag("b",i18n("Sub todos:<br>")); |
395 | for (to=Relations.first();to;to=Relations.next()) { | 400 | for (to=Relations.first();to;to=Relations.next()) { |
396 | mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); | 401 | mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); |
397 | 402 | ||
398 | } | 403 | } |
399 | setText(mText); | 404 | setText(mText); |
400 | } | 405 | } |
401 | 406 | ||
402 | void KOEventViewer::formatCategories(Incidence *event) | 407 | void KOEventViewer::formatCategories(Incidence *event) |
403 | { | 408 | { |
404 | if (!event->categoriesStr().isEmpty()) { | 409 | if (!event->categoriesStr().isEmpty()) { |
405 | if (event->categories().count() == 1) { | 410 | if (event->categories().count() == 1) { |
406 | addTag("h3",i18n("Category")); | 411 | addTag("h3",i18n("Category")); |
407 | } else { | 412 | } else { |
408 | addTag("h3",i18n("Categories")); | 413 | addTag("h3",i18n("Categories")); |
409 | } | 414 | } |
410 | addTag("p",event->categoriesStr()); | 415 | addTag("p",event->categoriesStr()); |
411 | } | 416 | } |
412 | } | 417 | } |
413 | void KOEventViewer::formatAttendees(Incidence *event) | 418 | void KOEventViewer::formatAttendees(Incidence *event) |
414 | { | 419 | { |
415 | QPtrList<Attendee> attendees = event->attendees(); | 420 | QPtrList<Attendee> attendees = event->attendees(); |
416 | if (attendees.count()) { | 421 | if (attendees.count()) { |
417 | 422 | ||
418 | 423 | ||
419 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 424 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
420 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 425 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
421 | addTag("h3",i18n("Organizer")); | 426 | addTag("h3",i18n("Organizer")); |
422 | mText.append("<ul><li>"); | 427 | mText.append("<ul><li>"); |
423 | #ifndef KORG_NOKABC | 428 | #ifndef KORG_NOKABC |
424 | 429 | ||
425 | #ifdef DESKTOP_VERSION | 430 | #ifdef DESKTOP_VERSION |
426 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 431 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
427 | KABC::Addressee::List addressList; | 432 | KABC::Addressee::List addressList; |
428 | addressList = add_book->findByEmail(event->organizer()); | 433 | addressList = add_book->findByEmail(event->organizer()); |
429 | KABC::Addressee o = addressList.first(); | 434 | KABC::Addressee o = addressList.first(); |
430 | if (!o.isEmpty() && addressList.size()<2) { | 435 | if (!o.isEmpty() && addressList.size()<2) { |
431 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 436 | mText += "<a href=\"uid:" + o.uid() + "\">"; |