author | zautrix <zautrix> | 2005-06-15 10:22:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-15 10:22:38 (UTC) |
commit | 13c00953a9d521873b03f861e54e83e33b30bc96 (patch) (unidiff) | |
tree | 05bc1f7b6d95b68e0d579e70a487c8a48f250a6f /korganizer/komonthview.cpp | |
parent | 37175a31a8fa8772403e9588ff3f8bd7de3979cc (diff) | |
download | kdepimpi-13c00953a9d521873b03f861e54e83e33b30bc96.zip kdepimpi-13c00953a9d521873b03f861e54e83e33b30bc96.tar.gz kdepimpi-13c00953a9d521873b03f861e54e83e33b30bc96.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/komonthview.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 96f2502..2150654 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -701,72 +701,74 @@ int MonthViewCell::insertEvent(Event *event) | |||
701 | if (event->doesFloat()) { | 701 | if (event->doesFloat()) { |
702 | text = event->summary(); | 702 | text = event->summary(); |
703 | if ( useToolTips ) | 703 | if ( useToolTips ) |
704 | mToolTipText += text; | 704 | mToolTipText += text; |
705 | } | 705 | } |
706 | else { | 706 | else { |
707 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 707 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
708 | text += " " + event->summary(); | 708 | text += " " + event->summary(); |
709 | if ( useToolTips ) | 709 | if ( useToolTips ) |
710 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 710 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); |
711 | } | 711 | } |
712 | } | 712 | } |
713 | if ( useToolTips && ! event->location().isEmpty() ) { | 713 | if ( useToolTips && ! event->location().isEmpty() ) { |
714 | mToolTipText += " (" + event->location() +")"; | 714 | mToolTipText += " (" + event->location() +")"; |
715 | } | 715 | } |
716 | MonthViewItem *item ; | 716 | MonthViewItem *item ; |
717 | 717 | ||
718 | if ( mAvailItemList.count() ) { | 718 | if ( mAvailItemList.count() ) { |
719 | item = mAvailItemList.first(); | 719 | item = mAvailItemList.first(); |
720 | mAvailItemList.remove( item ); | 720 | mAvailItemList.remove( item ); |
721 | item->recycle( event, mDate, text ); | 721 | item->recycle( event, mDate, text ); |
722 | } else { | 722 | } else { |
723 | item = new MonthViewItem( event, mDate, text ); | 723 | item = new MonthViewItem( event, mDate, text ); |
724 | } | 724 | } |
725 | 725 | ||
726 | QPalette pal; | 726 | QPalette pal; |
727 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 727 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
728 | QStringList categories = event->categories(); | 728 | QStringList categories = event->categories(); |
729 | QString cat = categories.first(); | 729 | QString cat = categories.first(); |
730 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 730 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
731 | pal = getPalette(); | 731 | pal = getPalette(); |
732 | if (cat.isEmpty()) { | 732 | if (cat.isEmpty()) { |
733 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 733 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
734 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); | ||
734 | } else { | 735 | } else { |
735 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 736 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
736 | } | 737 | } |
737 | 738 | ||
738 | } else { | 739 | } else { |
739 | if (cat.isEmpty()) { | 740 | if (cat.isEmpty()) { |
740 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 741 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
742 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); | ||
741 | } else { | 743 | } else { |
742 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 744 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
743 | } | 745 | } |
744 | } | 746 | } |
745 | 747 | ||
746 | } else { | 748 | } else { |
747 | pal = mStandardPalette ; | 749 | pal = mStandardPalette ; |
748 | } | 750 | } |
749 | item->setPalette( pal ); | 751 | item->setPalette( pal ); |
750 | item->setRecur( event->recurrence()->doesRecur() ); | 752 | item->setRecur( event->recurrence()->doesRecur() ); |
751 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); | 753 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); |
752 | item->setMoreInfo( event->description().length() > 0 ); | 754 | item->setMoreInfo( event->description().length() > 0 ); |
753 | #ifdef DESKTOP_VERSION | 755 | #ifdef DESKTOP_VERSION |
754 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 756 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
755 | KOPrefs::instance()->email()); | 757 | KOPrefs::instance()->email()); |
756 | if ( me != 0 ) { | 758 | if ( me != 0 ) { |
757 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 759 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
758 | item->setReply(true && multiday < 2); | 760 | item->setReply(true && multiday < 2); |
759 | else | 761 | else |
760 | item->setReply(false); | 762 | item->setReply(false); |
761 | } else | 763 | } else |
762 | item->setReply(false); | 764 | item->setReply(false); |
763 | #endif | 765 | #endif |
764 | item->setMultiDay( multiday ); | 766 | item->setMultiDay( multiday ); |
765 | if ( multiday ) { | 767 | if ( multiday ) { |
766 | insertItem( item ,mdayCount); | 768 | insertItem( item ,mdayCount); |
767 | ++mdayCount; | 769 | ++mdayCount; |
768 | } else { | 770 | } else { |
769 | uint i; | 771 | uint i; |
770 | int pos = mdayCount; | 772 | int pos = mdayCount; |
771 | for ( i = mdayCount; i < count();++i ) { | 773 | for ( i = mdayCount; i < count();++i ) { |
772 | QListBoxItem* it = this->item ( i ); | 774 | QListBoxItem* it = this->item ( i ); |
@@ -782,72 +784,74 @@ int MonthViewCell::insertEvent(Event *event) | |||
782 | mToolTip.append( mToolTipText ); | 784 | mToolTip.append( mToolTipText ); |
783 | } | 785 | } |
784 | return mdayCount; | 786 | return mdayCount; |
785 | } | 787 | } |
786 | void MonthViewCell::insertTodo(Todo *todo) | 788 | void MonthViewCell::insertTodo(Todo *todo) |
787 | { | 789 | { |
788 | setFocusPolicy(WheelFocus); | 790 | setFocusPolicy(WheelFocus); |
789 | QString text; | 791 | QString text; |
790 | if (todo->hasDueDate()) { | 792 | if (todo->hasDueDate()) { |
791 | if (!todo->doesFloat()) { | 793 | if (!todo->doesFloat()) { |
792 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 794 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
793 | text += " "; | 795 | text += " "; |
794 | } | 796 | } |
795 | } | 797 | } |
796 | text += todo->summary(); | 798 | text += todo->summary(); |
797 | MonthViewItem *item ; | 799 | MonthViewItem *item ; |
798 | if ( mAvailItemList.count() ) { | 800 | if ( mAvailItemList.count() ) { |
799 | item = mAvailItemList.first(); | 801 | item = mAvailItemList.first(); |
800 | mAvailItemList.remove( item ); | 802 | mAvailItemList.remove( item ); |
801 | item->recycle( todo, mDate, text ); | 803 | item->recycle( todo, mDate, text ); |
802 | } else { | 804 | } else { |
803 | item = new MonthViewItem( todo, mDate, text ); | 805 | item = new MonthViewItem( todo, mDate, text ); |
804 | } | 806 | } |
805 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 807 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
806 | //item->setPalette( mStandardPalette ); | 808 | //item->setPalette( mStandardPalette ); |
807 | QPalette pal; | 809 | QPalette pal; |
808 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 810 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
809 | QStringList categories = todo->categories(); | 811 | QStringList categories = todo->categories(); |
810 | QString cat = categories.first(); | 812 | QString cat = categories.first(); |
811 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 813 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
812 | pal = getPalette(); | 814 | pal = getPalette(); |
813 | if (cat.isEmpty()) { | 815 | if (cat.isEmpty()) { |
814 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 816 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
817 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); | ||
815 | } else { | 818 | } else { |
816 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 819 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
817 | } | 820 | } |
818 | 821 | ||
819 | } else { | 822 | } else { |
820 | if (cat.isEmpty()) { | 823 | if (cat.isEmpty()) { |
821 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 824 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
825 | pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); | ||
822 | } else { | 826 | } else { |
823 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 827 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
824 | } | 828 | } |
825 | } | 829 | } |
826 | 830 | ||
827 | } else { | 831 | } else { |
828 | pal = mStandardPalette ; | 832 | pal = mStandardPalette ; |
829 | } | 833 | } |
830 | item->setPalette( pal ); | 834 | item->setPalette( pal ); |
831 | item->setRecur( todo->recurrence()->doesRecur() ); | 835 | item->setRecur( todo->recurrence()->doesRecur() ); |
832 | item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); | 836 | item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); |
833 | item->setMoreInfo( todo->description().length() > 0 ); | 837 | item->setMoreInfo( todo->description().length() > 0 ); |
834 | insertItem( item , count()); | 838 | insertItem( item , count()); |
835 | #ifdef DESKTOP_VERSION | 839 | #ifdef DESKTOP_VERSION |
836 | mToolTip.append( text ); | 840 | mToolTip.append( text ); |
837 | #endif | 841 | #endif |
838 | } | 842 | } |
839 | void MonthViewCell::repaintfinishUpdateCell() | 843 | void MonthViewCell::repaintfinishUpdateCell() |
840 | { | 844 | { |
841 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 845 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
842 | while ( mitem ) { | 846 | while ( mitem ) { |
843 | mitem->setBlockRepaint( false ); | 847 | mitem->setBlockRepaint( false ); |
844 | updateItem ( mitem ); | 848 | updateItem ( mitem ); |
845 | mitem = (MonthViewItem *)mitem->next(); | 849 | mitem = (MonthViewItem *)mitem->next(); |
846 | } | 850 | } |
847 | } | 851 | } |
848 | void MonthViewCell::finishUpdateCell() | 852 | void MonthViewCell::finishUpdateCell() |
849 | { | 853 | { |
850 | 854 | ||
851 | 855 | ||
852 | 856 | ||
853 | #ifdef DESKTOP_VERSION | 857 | #ifdef DESKTOP_VERSION |