-rw-r--r-- | korganizer/koeventviewer.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 607e549..92d2a80 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -383,32 +383,42 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
383 | addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); | 383 | addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); |
384 | } else{ | 384 | } else{ |
385 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 385 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
386 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 386 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
387 | } | 387 | } |
388 | } | 388 | } |
389 | } | 389 | } |
390 | } else { | 390 | } else { |
391 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 391 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
392 | 392 | ||
393 | } | 393 | } |
394 | 394 | ||
395 | 395 | ||
396 | if (event->isAlarmEnabled()) { | 396 | if (event->isAlarmEnabled()) { |
397 | Alarm *alarm =event->alarms().first() ; | 397 | Alarm *alarm =event->alarms().first() ; |
398 | QDateTime t = alarm->time(); | 398 | QDateTime t = alarm->time(); |
399 | |||
400 | if (event->doesRecur()) { | ||
401 | bool ok = false; | ||
402 | int offset = 0; | ||
403 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | ||
404 | if ( ok ) { | ||
405 | t = next; | ||
406 | } | ||
407 | } | ||
408 | |||
399 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 409 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
400 | if(wideScreen ){ | 410 | if(wideScreen ){ |
401 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); | 411 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); |
402 | }else{ | 412 | }else{ |
403 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 413 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
404 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 414 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
405 | } | 415 | } |
406 | //addTag("p",s); | 416 | //addTag("p",s); |
407 | if ( !(event->alarmEnabled() ) ) { | 417 | if ( !(event->alarmEnabled() ) ) { |
408 | addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>"); | 418 | addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>"); |
409 | 419 | ||
410 | } | 420 | } |
411 | } | 421 | } |
412 | 422 | ||
413 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); | 423 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); |
414 | 424 | ||
@@ -505,33 +515,41 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
505 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 515 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
506 | } | 516 | } |
507 | if (event->hasDueDate()) { | 517 | if (event->hasDueDate()) { |
508 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 518 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
509 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 519 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
510 | } | 520 | } |
511 | if (!event->location().isEmpty()) { | 521 | if (!event->location().isEmpty()) { |
512 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 522 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
513 | mMailSubject += i18n(" at ") + event->location(); | 523 | mMailSubject += i18n(" at ") + event->location(); |
514 | } | 524 | } |
515 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 525 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
516 | .arg(QString::number(event->priority()))); | 526 | .arg(QString::number(event->priority()))); |
517 | 527 | ||
518 | if (event->isAlarmEnabled()) { | 528 | if (event->isAlarmEnabled()) { |
519 | Alarm *alarm =event->alarms().first() ; | 529 | Alarm *alarm =event->alarms().first() ; |
520 | QDateTime t = alarm->time(); | 530 | QDateTime t = alarm->time(); |
521 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 531 | if (event->doesRecur()) { |
532 | bool ok = false; | ||
533 | int offset = 0; | ||
534 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | ||
535 | if ( ok ) { | ||
536 | t = next; | ||
537 | } | ||
538 | } | ||
539 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | ||
522 | if ( wideScreen ) { | 540 | if ( wideScreen ) { |
523 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); | 541 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); |
524 | } else { | 542 | } else { |
525 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 543 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
526 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 544 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
527 | } | 545 | } |
528 | if ( !(event->alarmEnabled() ) ) { | 546 | if ( !(event->alarmEnabled() ) ) { |
529 | addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>"); | 547 | addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>"); |
530 | 548 | ||
531 | } | 549 | } |
532 | } | 550 | } |
533 | 551 | ||
534 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); | 552 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); |
535 | 553 | ||
536 | formatCategories(event); | 554 | formatCategories(event); |
537 | 555 | ||