summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
authorzautrix <zautrix>2005-02-06 13:44:49 (UTC)
committer zautrix <zautrix>2005-02-06 13:44:49 (UTC)
commit26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f (patch) (unidiff)
tree34c4f5e6b2d77dc1210822e1539d9516842b5691 /korganizer/koeventviewer.cpp
parent118f5aab05c9ace5612d5c4fd69e7c5a59bed67b (diff)
downloadkdepimpi-26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f.zip
kdepimpi-26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f.tar.gz
kdepimpi-26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f.tar.bz2
many small fixes
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 2faf18f..de11c13 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -400,49 +400,49 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
400 mMailSubject += i18n(" at ") + event->location(); 400 mMailSubject += i18n(" at ") + event->location();
401 } 401 }
402 if (event->hasStartDate()) { 402 if (event->hasStartDate()) {
403 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 403 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
404 } 404 }
405 if (event->hasDueDate()) { 405 if (event->hasDueDate()) {
406 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 406 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
407 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 407 mMailSubject += i18n(" - " )+event->dtDueStr( true );
408 } 408 }
409 addTag("b",i18n("Access: ")); 409 addTag("b",i18n("Access: "));
410 mText.append(event->secrecyStr()+"<br>"); 410 mText.append(event->secrecyStr()+"<br>");
411 if (!event->description().isEmpty()) { 411 if (!event->description().isEmpty()) {
412 addTag("p",i18n("<b>Details: </b>")); 412 addTag("p",i18n("<b>Details: </b>"));
413 addTag("p",event->description()); 413 addTag("p",event->description());
414 } 414 }
415 415
416 formatCategories(event); 416 formatCategories(event);
417 417
418 mText.append(i18n("<p><b>Priority:</b> %2</p>") 418 mText.append(i18n("<p><b>Priority:</b> %2</p>")
419 .arg(QString::number(event->priority()))); 419 .arg(QString::number(event->priority())));
420 420
421 formatReadOnly(event); 421 formatReadOnly(event);
422 formatAttendees(event); 422 formatAttendees(event);
423 if ( event->relatedTo() ) { 423 if ( event->relatedTo() ) {
424 addTag("b",i18n("Parent todo: ")); 424 addTag("b",i18n("Parent todo:<br>"));
425 mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); 425 mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
426 } 426 }
427 QPtrList<Incidence> Relations = event->relations(); 427 QPtrList<Incidence> Relations = event->relations();
428 Incidence *to; 428 Incidence *to;
429 if ( Relations.first() ) 429 if ( Relations.first() )
430 addTag("b",i18n("Sub todos:<br>")); 430 addTag("b",i18n("Sub todos:<br>"));
431 for (to=Relations.first();to;to=Relations.next()) { 431 for (to=Relations.first();to;to=Relations.next()) {
432 mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); 432 mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
433 433
434 } 434 }
435 setText(mText); 435 setText(mText);
436} 436}
437 437
438void KOEventViewer::formatCategories(Incidence *event) 438void KOEventViewer::formatCategories(Incidence *event)
439{ 439{
440 if (!event->categoriesStr().isEmpty()) { 440 if (!event->categoriesStr().isEmpty()) {
441 if (event->categories().count() == 1) { 441 if (event->categories().count() == 1) {
442 addTag("h3",i18n("Category")); 442 addTag("h3",i18n("Category"));
443 } else { 443 } else {
444 addTag("h3",i18n("Categories")); 444 addTag("h3",i18n("Categories"));
445 } 445 }
446 addTag("p",event->categoriesStr()); 446 addTag("p",event->categoriesStr());
447 } 447 }
448} 448}
@@ -513,81 +513,81 @@ void KOEventViewer::formatAttendees(Incidence *event)
513 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 513 mText += "<li><a href=\"uid:" + a->uid() + "\">";
514 if (!a->name().isEmpty()) mText += a->name(); 514 if (!a->name().isEmpty()) mText += a->name();
515 else mText += a->email(); 515 else mText += a->email();
516 mText += "</a>\n"; 516 mText += "</a>\n";
517 } 517 }
518#else //DESKTOP_VERSION 518#else //DESKTOP_VERSION
519 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 519 mText += "<li><a href=\"uid:" + a->uid() + "\">";
520 if (!a->name().isEmpty()) mText += a->name(); 520 if (!a->name().isEmpty()) mText += a->name();
521 else mText += a->email(); 521 else mText += a->email();
522 mText += "</a>\n"; 522 mText += "</a>\n";
523#endif //DESKTOP_VERSION 523#endif //DESKTOP_VERSION
524#else 524#else
525 //qDebug("nokabc "); 525 //qDebug("nokabc ");
526 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 526 mText += "<li><a href=\"uid:" + a->uid() + "\">";
527 if (!a->name().isEmpty()) mText += a->name(); 527 if (!a->name().isEmpty()) mText += a->name();
528 else mText += a->email(); 528 else mText += a->email();
529 mText += "</a>\n"; 529 mText += "</a>\n";
530#endif 530#endif
531 531
532 532
533 if (!a->email().isEmpty()) { 533 if (!a->email().isEmpty()) {
534 if (iconPath) { 534 if (iconPath) {
535 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; 535 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
536 if ( a->RSVP() ) { 536 if ( a->RSVP() ) {
537 ++a_count; 537 ++a_count_nr;
538 mText += "<IMG src=\"" + iconPath + "\">"; 538 mText += "<IMG src=\"" + iconPath + "\">";
539 } 539 }
540 else { 540 else {
541 ++a_count_nr; 541 ++a_count;
542 mText += "<IMG src=\"" + NOiconPath + "\">"; 542 mText += "<IMG src=\"" + NOiconPath + "\">";
543 } 543 }
544 mText += "</a>\n"; 544 mText += "</a>\n";
545 } 545 }
546 } 546 }
547 if (a->status() != Attendee::NeedsAction ) 547 if (a->status() != Attendee::NeedsAction )
548 mText +="[" + a->statusStr() + "] "; 548 mText +="[" + a->statusStr() + "] ";
549 if (a->role() == Attendee::Chair ) 549 if (a->role() == Attendee::Chair )
550 mText +="(" + a->roleStr().left(1) + ".)"; 550 mText +="(" + a->roleStr().left(1) + ".)";
551 } 551 }
552 mText.append("</li></ul>"); 552 mText.append("</li></ul>");
553 if ( a_count > 1 ) { 553 if ( (a_count+a_count_nr) > 1 ) {
554 mText += "<a href=\"mailto:ALL\">"; 554 mText += "<a href=\"mailto:ALL\">";
555 mText += i18n( "Mail to all" ); 555 mText += i18n( "Mail to all" );
556 mText += "</a> ( "; 556 mText += "</a> ( ";
557 mText += "<IMG src=\"" + iconPath + "\">"; 557 mText += "<IMG src=\"" + iconPath + "\">";
558 mText += i18n( " and " ); 558 mText += i18n( " and " );
559 mText += "<IMG src=\"" + NOiconPath + "\"> )"; 559 mText += "<IMG src=\"" + NOiconPath + "\"> )";
560 mText += "<br>\n"; 560 mText += "<br>\n";
561 561
562 562
563 } 563 }
564 if ( a_count_nr > 1 ) { 564 if ( a_count_nr > 1 ) {
565 mText += "<a href=\"mailto:RSVP\">"; 565 mText += "<a href=\"mailto:RSVP\">";
566 mText += i18n( "Mail to selected" ); 566 mText += i18n( "Mail to selected" );
567 mText += "</a> ( "; 567 mText += "</a> ( ";
568 mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); 568 mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath );
569 mText += "\n"; 569 mText += "<br>\n";
570 } 570 }
571 } 571 }
572 572
573} 573}
574void KOEventViewer::appendJournal(Journal *jour, int mode ) 574void KOEventViewer::appendJournal(Journal *jour, int mode )
575{ 575{
576 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 576 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
577 if (mode == 0 ) { 577 if (mode == 0 ) {
578 addTag("h2",i18n("Journal from: ")); 578 addTag("h2",i18n("Journal from: "));
579 } 579 }
580 else { 580 else {
581 if ( mode == 1 ) { 581 if ( mode == 1 ) {
582 addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); 582 addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
583 } else { 583 } else {
584 addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); 584 addTag("h2",i18n( "Remote: " ) +i18n("Journal from: "));
585 } 585 }
586 } 586 }
587 topLevelWidget()->setCaption("Journal Viewer"); 587 topLevelWidget()->setCaption("Journal Viewer");
588 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); 588 mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
589 addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); 589 addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
590 if (!jour->description().isEmpty()) { 590 if (!jour->description().isEmpty()) {
591 addTag("p",jour->description()); 591 addTag("p",jour->description());
592 } 592 }
593 setText(mText); 593 setText(mText);