summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Unidiff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index e8574a0..221debc 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -550,171 +550,171 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
550 550
551 } else { 551 } else {
552 if ( bDay ) { 552 if ( bDay ) {
553 553
554 if ( ev->isBirthday()) 554 if ( ev->isBirthday())
555 tempText += "<font color=\"#00B000\">" + i18n("Birthday") +":</font>"; 555 tempText += "<font color=\"#00B000\">" + i18n("Birthday") +":</font>";
556 else 556 else
557 tempText += "<font color=\"#00B0000\">" + i18n("Anniversary")+":</font>"; 557 tempText += "<font color=\"#00B0000\">" + i18n("Anniversary")+":</font>";
558 } else { 558 } else {
559 tempText += i18n("Allday:"); 559 tempText += i18n("Allday:");
560 } 560 }
561 561
562 } 562 }
563 } 563 }
564 } else { 564 } else {
565 mTodos.append( ev ); 565 mTodos.append( ev );
566 tempText += i18n("ToDo:"); 566 tempText += i18n("ToDo:");
567 if (reply) { 567 if (reply) {
568 tempText += " "; 568 tempText += " ";
569 if ( noc != cdt ) { 569 if ( noc != cdt ) {
570 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 570 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
571 } 571 }
572 } else { 572 } else {
573 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { 573 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
574 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 574 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
575 QString dfs = KGlobal::locale()->dateFormatShort(); 575 QString dfs = KGlobal::locale()->dateFormatShort();
576 KGlobal::locale()->setDateFormatShort("%d.%b"); 576 KGlobal::locale()->setDateFormatShort("%d.%b");
577 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 577 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
578 KGlobal::locale()->setDateFormatShort(dfs); 578 KGlobal::locale()->setDateFormatShort(dfs);
579 } else { 579 } else {
580 if (!ev->doesFloat() ) 580 if (!ev->doesFloat() )
581 if( ( (Todo*)ev)->dtDue() < cdt ) { 581 if( ( (Todo*)ev)->dtDue() < cdt ) {
582 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; 582 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
583 583
584 584
585 } else 585 } else
586 tempText +=((Todo*)ev)->dtDueTimeStr(); 586 tempText +=((Todo*)ev)->dtDueTimeStr();
587 mTodos.append( ev ); 587 mTodos.append( ev );
588 } 588 }
589 } 589 }
590 } 590 }
591 tempText += "</b></td><td>"; 591 tempText += "</b></td><td>";
592 bool needClose = false; 592 bool needClose = false;
593 if ( ev->cancelled() ) { 593 if ( ev->cancelled() ) {
594 tempText += "<font color=\"#F00000\">[c"; 594 tempText += "<font color=\"#F00000\">[c";
595 needClose =true; 595 needClose =true;
596 596
597 } 597 }
598 if ( ev->isAlarmEnabled() ) { 598 if ( ev->isAlarmEnabled() && ev->alarmEnabled()) {
599 if ( !needClose) 599 if ( !needClose)
600 tempText +="["; 600 tempText +="[";
601 tempText += "a"; 601 tempText += "a";
602 needClose =true; 602 needClose =true;
603 603
604 } 604 }
605 if ( ev->description().length() > 0 ) { 605 if ( ev->description().length() > 0 ) {
606 if ( !needClose) 606 if ( !needClose)
607 tempText +="["; 607 tempText +="[";
608 tempText += "i"; 608 tempText += "i";
609 needClose =true; 609 needClose =true;
610 } 610 }
611 if ( ev->recurrence()->doesRecur() ) { 611 if ( ev->recurrence()->doesRecur() ) {
612 if ( !needClose) 612 if ( !needClose)
613 tempText +="["; 613 tempText +="[";
614 tempText += "r"; 614 tempText += "r";
615 needClose =true; 615 needClose =true;
616 } 616 }
617 if ( needClose ) { 617 if ( needClose ) {
618 tempText += "] "; 618 tempText += "] ";
619 } 619 }
620 if ( ev->cancelled() ) 620 if ( ev->cancelled() )
621 tempText += "</font>"; 621 tempText += "</font>";
622 tempText += "<a "; 622 tempText += "<a ";
623 if (ev->typeID() == eventID ) tempText += "href=\"event:"; 623 if (ev->typeID() == eventID ) tempText += "href=\"event:";
624 if (ev->typeID() == todoID ) tempText += "href=\"todo:"; 624 if (ev->typeID() == todoID ) tempText += "href=\"todo:";
625 tempText += ev->uid() + "\">"; 625 tempText += ev->uid() + "\">";
626 if ( ev->summary().length() > 0 ) 626 if ( ev->summary().length() > 0 )
627 tempText += ev->summary(); 627 tempText += ev->summary();
628 else 628 else
629 tempText += i18n("-no summary-"); 629 tempText += i18n("-no summary-");
630 if ( bDay ) { 630 if ( bDay ) {
631 noc = ev->getNextOccurence( cdt.addDays(-1), &ok ); 631 noc = ev->getNextOccurence( cdt.addDays(-1), &ok );
632 if ( ok ) { 632 if ( ok ) {
633 int years = 0; 633 int years = 0;
634 if ( ev->typeID() == todoID ) { 634 if ( ev->typeID() == todoID ) {
635 years = noc.date().year() -((Todo*)ev)->dtDue().date().year(); 635 years = noc.date().year() -((Todo*)ev)->dtDue().date().year();
636 } else 636 } else
637 years = noc.date().year() - ev->dtStart().date().year(); 637 years = noc.date().year() - ev->dtStart().date().year();
638 tempText += i18n(" (%1 y.)"). arg( years ); 638 tempText += i18n(" (%1 y.)"). arg( years );
639 } 639 }
640 } 640 }
641 641
642 tempText += "</a>"; 642 tempText += "</a>";
643 if ( KOPrefs::instance()->mWNViewShowLocation ) 643 if ( KOPrefs::instance()->mWNViewShowLocation )
644 if ( !ev->location().isEmpty() ) 644 if ( !ev->location().isEmpty() )
645 tempText += " ("+ev->location() +")"; 645 tempText += " ("+ev->location() +")";
646 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) 646 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents)
647 tempText += " ["+ev->relatedTo()->summary() +"]"; 647 tempText += " ["+ev->relatedTo()->summary() +"]";
648 tempText += "</td></tr>\n"; 648 tempText += "</td></tr>\n";
649 mText += tempText; 649 mText += tempText;
650 return true; 650 return true;
651} 651}
652 652
653bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) 653bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
654{ 654{
655 if ( mTodos.find( ev ) != mTodos.end() ) return false; 655 if ( mTodos.find( ev ) != mTodos.end() ) return false;
656 656
657 mTodos.append( ev ); 657 mTodos.append( ev );
658 if ( !isSub ) 658 if ( !isSub )
659 mText += "<p>"; 659 mText += "<p>";
660 else 660 else
661 mText += "<li>"; 661 mText += "<li>";
662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
663 663
664 664
665 mText += ind; 665 mText += ind;
666 bool needClose = false; 666 bool needClose = false;
667 if ( ev->cancelled() ) { 667 if ( ev->cancelled() ) {
668 mText += "<font color=\"#F00000\">[c"; 668 mText += "<font color=\"#F00000\">[c";
669 needClose =true; 669 needClose =true;
670 670
671 } 671 }
672 if ( ev->isAlarmEnabled() ) { 672 if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) {
673 if ( !needClose) 673 if ( !needClose)
674 mText +="["; 674 mText +="[";
675 mText += "a"; 675 mText += "a";
676 needClose =true; 676 needClose =true;
677 677
678 } 678 }
679 679
680 if ( ev->description().length() > 0 ) { 680 if ( ev->description().length() > 0 ) {
681 if ( !needClose) 681 if ( !needClose)
682 mText +="["; 682 mText +="[";
683 mText += "i"; 683 mText += "i";
684 needClose =true; 684 needClose =true;
685 } 685 }
686 if ( ev->doesRecur() ) { 686 if ( ev->doesRecur() ) {
687 if ( !needClose) 687 if ( !needClose)
688 mText +="["; 688 mText +="[";
689 mText += "r"; 689 mText += "r";
690 needClose =true; 690 needClose =true;
691 } 691 }
692 // if ( ev->recurrence()->doesRecur() ) { 692 // if ( ev->recurrence()->doesRecur() ) {
693 // if ( !needClose) 693 // if ( !needClose)
694 // mText +="("; 694 // mText +="(";
695 // mText += "r"; 695 // mText += "r";
696 // needClose =true; 696 // needClose =true;
697 // } 697 // }
698 if ( needClose ) 698 if ( needClose )
699 mText += "] "; 699 mText += "] ";
700 if ( ev->cancelled() ) 700 if ( ev->cancelled() )
701 mText += "</font>"; 701 mText += "</font>";
702 mText += "<a href=\"todo:" + ev->uid() + "\">"; 702 mText += "<a href=\"todo:" + ev->uid() + "\">";
703 if ( ev->summary().length() > 0 ) 703 if ( ev->summary().length() > 0 )
704 mText += ev->summary(); 704 mText += ev->summary();
705 else 705 else
706 mText += i18n("-no summary-"); 706 mText += i18n("-no summary-");
707 mText += "</a>"; 707 mText += "</a>";
708 if ( ((Todo*)ev)->hasDueDate () ) { 708 if ( ((Todo*)ev)->hasDueDate () ) {
709 QString year = ""; 709 QString year = "";
710 int ye = ((Todo*)ev)->dtDue().date().year(); 710 int ye = ((Todo*)ev)->dtDue().date().year();
711 if ( QDateTime::currentDateTime().date().year() != ye ) 711 if ( QDateTime::currentDateTime().date().year() != ye )
712 year = QString::number( ye ); 712 year = QString::number( ye );
713 QString dfs = KGlobal::locale()->dateFormatShort(); 713 QString dfs = KGlobal::locale()->dateFormatShort();
714 KGlobal::locale()->setDateFormatShort("%d.%b"); 714 KGlobal::locale()->setDateFormatShort("%d.%b");
715 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; 715 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
716 KGlobal::locale()->setDateFormatShort(dfs); 716 KGlobal::locale()->setDateFormatShort(dfs);
717 } 717 }
718 if ( KOPrefs::instance()->mWNViewShowLocation ) 718 if ( KOPrefs::instance()->mWNViewShowLocation )
719 if ( !ev->location().isEmpty() ) 719 if ( !ev->location().isEmpty() )
720 mText += " ("+ev->location() +")"; 720 mText += " ("+ev->location() +")";