summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Unidiff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 391b3bb..18dc656 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -606,128 +606,134 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
606 tempText += "</font>"; 606 tempText += "</font>";
607 tempText += "<a "; 607 tempText += "<a ";
608 if (ev->type()=="Event") tempText += "href=\"event:"; 608 if (ev->type()=="Event") tempText += "href=\"event:";
609 if (ev->type()=="Todo") tempText += "href=\"todo:"; 609 if (ev->type()=="Todo") tempText += "href=\"todo:";
610 tempText += ev->uid() + "\">"; 610 tempText += ev->uid() + "\">";
611 if ( ev->summary().length() > 0 ) 611 if ( ev->summary().length() > 0 )
612 tempText += ev->summary(); 612 tempText += ev->summary();
613 else 613 else
614 tempText += i18n("-no summary-"); 614 tempText += i18n("-no summary-");
615 if ( bDay ) { 615 if ( bDay ) {
616 noc = ev->getNextOccurence( cdt.addDays(-1), &ok ); 616 noc = ev->getNextOccurence( cdt.addDays(-1), &ok );
617 if ( ok ) { 617 if ( ok ) {
618 int years = 0; 618 int years = 0;
619 if ( ev->type() =="Todo" ) { 619 if ( ev->type() =="Todo" ) {
620 years = noc.date().year() -((Todo*)ev)->dtDue().date().year(); 620 years = noc.date().year() -((Todo*)ev)->dtDue().date().year();
621 } else 621 } else
622 years = noc.date().year() - ev->dtStart().date().year(); 622 years = noc.date().year() - ev->dtStart().date().year();
623 tempText += i18n(" (%1 y.)"). arg( years ); 623 tempText += i18n(" (%1 y.)"). arg( years );
624 } 624 }
625 } 625 }
626 626
627 tempText += "</a>"; 627 tempText += "</a>";
628 if ( KOPrefs::instance()->mWNViewShowLocation ) 628 if ( KOPrefs::instance()->mWNViewShowLocation )
629 if ( !ev->location().isEmpty() ) 629 if ( !ev->location().isEmpty() )
630 tempText += " ("+ev->location() +")"; 630 tempText += " ("+ev->location() +")";
631 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) 631 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents)
632 tempText += " ["+ev->relatedTo()->summary() +"]"; 632 tempText += " ["+ev->relatedTo()->summary() +"]";
633 tempText += "</td></tr>\n"; 633 tempText += "</td></tr>\n";
634 mText += tempText; 634 mText += tempText;
635 return true; 635 return true;
636} 636}
637 637
638bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) 638bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
639{ 639{
640 if ( mTodos.find( ev ) != mTodos.end() ) return false; 640 if ( mTodos.find( ev ) != mTodos.end() ) return false;
641 641
642 mTodos.append( ev ); 642 mTodos.append( ev );
643 if ( !isSub ) 643 if ( !isSub )
644 mText += "<p>"; 644 mText += "<p>";
645 else 645 else
646 mText += "<li>"; 646 mText += "<li>";
647 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 647 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
648 648
649 649
650 mText += ind; 650 mText += ind;
651 bool needClose = false; 651 bool needClose = false;
652 if ( ev->cancelled() ) { 652 if ( ev->cancelled() ) {
653 mText += "<font color=\"#F00000\">[c"; 653 mText += "<font color=\"#F00000\">[c";
654 needClose =true; 654 needClose =true;
655 655
656 } 656 }
657 if ( ev->isAlarmEnabled() ) { 657 if ( ev->isAlarmEnabled() ) {
658 if ( !needClose) 658 if ( !needClose)
659 mText +="["; 659 mText +="[";
660 mText += "a"; 660 mText += "a";
661 needClose =true; 661 needClose =true;
662 662
663 } 663 }
664 664
665 if ( ev->description().length() > 0 ) { 665 if ( ev->description().length() > 0 ) {
666 if ( !needClose) 666 if ( !needClose)
667 mText +="["; 667 mText +="[";
668 mText += "i"; 668 mText += "i";
669 needClose =true; 669 needClose =true;
670 }
671 if ( ev->doesRecur() ) {
672 if ( !needClose)
673 mText +="[";
674 mText += "r";
675 needClose =true;
670 } 676 }
671 // if ( ev->recurrence()->doesRecur() ) { 677 // if ( ev->recurrence()->doesRecur() ) {
672 // if ( !needClose) 678 // if ( !needClose)
673 // mText +="("; 679 // mText +="(";
674 // mText += "r"; 680 // mText += "r";
675 // needClose =true; 681 // needClose =true;
676 // } 682 // }
677 if ( needClose ) 683 if ( needClose )
678 mText += "] "; 684 mText += "] ";
679 if ( ev->cancelled() ) 685 if ( ev->cancelled() )
680 mText += "</font>"; 686 mText += "</font>";
681 mText += "<a href=\"todo:" + ev->uid() + "\">"; 687 mText += "<a href=\"todo:" + ev->uid() + "\">";
682 if ( ev->summary().length() > 0 ) 688 if ( ev->summary().length() > 0 )
683 mText += ev->summary(); 689 mText += ev->summary();
684 else 690 else
685 mText += i18n("-no summary-"); 691 mText += i18n("-no summary-");
686 mText += "</a>"; 692 mText += "</a>";
687 if ( ((Todo*)ev)->hasDueDate () ) { 693 if ( ((Todo*)ev)->hasDueDate () ) {
688 QString year = ""; 694 QString year = "";
689 int ye = ((Todo*)ev)->dtDue().date().year(); 695 int ye = ((Todo*)ev)->dtDue().date().year();
690 if ( QDateTime::currentDateTime().date().year() != ye ) 696 if ( QDateTime::currentDateTime().date().year() != ye )
691 year = QString::number( ye ); 697 year = QString::number( ye );
692 QString dfs = KGlobal::locale()->dateFormatShort(); 698 QString dfs = KGlobal::locale()->dateFormatShort();
693 KGlobal::locale()->setDateFormatShort("%d.%b"); 699 KGlobal::locale()->setDateFormatShort("%d.%b");
694 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; 700 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
695 KGlobal::locale()->setDateFormatShort(dfs); 701 KGlobal::locale()->setDateFormatShort(dfs);
696 } 702 }
697 if ( KOPrefs::instance()->mWNViewShowLocation ) 703 if ( KOPrefs::instance()->mWNViewShowLocation )
698 if ( !ev->location().isEmpty() ) 704 if ( !ev->location().isEmpty() )
699 mText += " ("+ev->location() +")"; 705 mText += " ("+ev->location() +")";
700 if ( !isSub ) { 706 if ( !isSub ) {
701 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) 707 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
702 mText += " ["+ev->relatedTo()->summary() +"]"; 708 mText += " ["+ev->relatedTo()->summary() +"]";
703 mText += "</p>\n"; 709 mText += "</p>\n";
704 } 710 }
705 else { 711 else {
706 ind += "-"; 712 ind += "-";
707 mText += "</li>\n"; 713 mText += "</li>\n";
708 } 714 }
709 QPtrList<Incidence> Relations = ev->relations(); 715 QPtrList<Incidence> Relations = ev->relations();
710 Incidence *to; 716 Incidence *to;
711 for (to=Relations.first();to;to=Relations.next()) { 717 for (to=Relations.first();to;to=Relations.next()) {
712 if (!((Todo*)to)->isCompleted()) 718 if (!((Todo*)to)->isCompleted())
713 appendTodo( to, ind , true ); 719 appendTodo( to, ind , true );
714 } 720 }
715 721
716 return true; 722 return true;
717} 723}
718 724
719/* 725/*
720 void KOWhatsNextView::createEventViewer() 726 void KOWhatsNextView::createEventViewer()
721 { 727 {
722 if (!mEventViewer) { 728 if (!mEventViewer) {
723 729
724 mEventViewer = new KOEventViewerDialog(this); 730 mEventViewer = new KOEventViewerDialog(this);
725 } 731 }
726 } 732 }
727*/ 733*/
728void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) 734void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v )
729{ 735{
730 mEventViewer = v; 736 mEventViewer = v;
731} 737}
732 738
733// TODO: Create this function in CalendarView and remove it from here 739// TODO: Create this function in CalendarView and remove it from here