summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp14
-rw-r--r--korganizer/koprefsdialog.h1
2 files changed, 11 insertions, 4 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 7ba1392..ebcff33 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -661,878 +661,884 @@ void KOPrefsDialog::setupViewsTab()
661 new QLabel ( i18n("Show events that recur "), habo ); 661 new QLabel ( i18n("Show events that recur "), habo );
662 } 662 }
663 dailyRecur = 663 dailyRecur =
664 addWidBool(i18n("daily"), 664 addWidBool(i18n("daily"),
665 &(KOPrefs::instance()->mMonthDailyRecur),habo); 665 &(KOPrefs::instance()->mMonthDailyRecur),habo);
666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
667 667
668 weeklyRecur = 668 weeklyRecur =
669 addWidBool(i18n("weekly"), 669 addWidBool(i18n("weekly"),
670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
671 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 671 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
672 ii++; 672 ii++;
673 673
674 674
675 habo = new QHBox( topFrame ); 675 habo = new QHBox( topFrame );
676 if ( QApplication::desktop()->width() <= 480 ) { 676 if ( QApplication::desktop()->width() <= 480 ) {
677 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 677 lab = new QLabel (i18n("Show in every cell ") , topFrame );
678 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 678 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
679 ii++; 679 ii++;
680 680
681 } else { 681 } else {
682 new QLabel ( i18n("Show in every cell "), habo ); 682 new QLabel ( i18n("Show in every cell "), habo );
683 } 683 }
684 weeklyRecur = 684 weeklyRecur =
685 addWidBool(i18n("short month"), 685 addWidBool(i18n("short month"),
686 &(KOPrefs::instance()->mMonthShowShort),habo); 686 &(KOPrefs::instance()->mMonthShowShort),habo);
687 weeklyRecur = 687 weeklyRecur =
688 addWidBool(i18n("icons"), 688 addWidBool(i18n("icons"),
689 &(KOPrefs::instance()->mMonthShowIcons),habo); 689 &(KOPrefs::instance()->mMonthShowIcons),habo);
690 weeklyRecur = 690 weeklyRecur =
691 addWidBool(i18n("times"), 691 addWidBool(i18n("times"),
692 &(KOPrefs::instance()->mMonthShowTimes),habo); 692 &(KOPrefs::instance()->mMonthShowTimes),habo);
693 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 693 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
694 ii++; 694 ii++;
695#ifdef DESKTOP_VERSION 695#ifdef DESKTOP_VERSION
696 KPrefsDialogWidBool *enableMonthScroll = 696 KPrefsDialogWidBool *enableMonthScroll =
697 addWidBool(i18n("Enable scrollbars in month view cells"), 697 addWidBool(i18n("Enable scrollbars in month view cells"),
698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
700#endif 700#endif
701 dummy = 701 dummy =
702 addWidBool(i18n("Week view mode uses bigger font"), 702 addWidBool(i18n("Week view mode uses bigger font"),
703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); 703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame);
704 topLayout->addWidget(dummy->checkBox(),ii++,0); 704 topLayout->addWidget(dummy->checkBox(),ii++,0);
705 dummy = 705 dummy =
706 addWidBool(i18n("Show Sat/Sun together"), 706 addWidBool(i18n("Show Sat/Sun together"),
707 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 707 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
708 topLayout->addWidget(dummy->checkBox(),ii++,0); 708 topLayout->addWidget(dummy->checkBox(),ii++,0);
709 709
710 KPrefsDialogWidBool *coloredCategoriesInMonthView = 710 KPrefsDialogWidBool *coloredCategoriesInMonthView =
711 addWidBool(i18n("Month view uses category colors"), 711 addWidBool(i18n("Month view uses category colors"),
712 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 712 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
713 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 713 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
714 714
715 dummy = 715 dummy =
716 addWidBool(i18n("Category colors are applied to text"), 716 addWidBool(i18n("Category colors are applied to text"),
717 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 717 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
718 topLayout->addWidget(dummy->checkBox(),ii++,0); 718 topLayout->addWidget(dummy->checkBox(),ii++,0);
719 719
720 720
721 721
722 if ( QApplication::desktop()->height() <= 240 ) { 722 if ( QApplication::desktop()->height() <= 240 ) {
723 topFrame = addPage(i18n("Month View") +" 2",0,0); 723 topFrame = addPage(i18n("Month View") +" 2",0,0);
724 topLayout = new QGridLayout(topFrame,4,1); 724 topLayout = new QGridLayout(topFrame,4,1);
725 topLayout->setSpacing(2); 725 topLayout->setSpacing(2);
726 topLayout->setMargin(1); 726 topLayout->setMargin(1);
727 ii = 0; 727 ii = 0;
728 } 728 }
729 729
730 730
731 coloredCategoriesInMonthView = 731 coloredCategoriesInMonthView =
732 addWidBool(i18n("Month view uses day colors"), 732 addWidBool(i18n("Month view uses day colors"),
733 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 733 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
734 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 734 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
735 735
736 KPrefsDialogWidColor *holidayColor = 736 KPrefsDialogWidColor *holidayColor =
737 addWidColor(i18n("Day color odd months"), 737 addWidColor(i18n("Day color odd months"),
738 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 738 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
739 topLayout->addWidget(holidayColor->label(),ii,0); 739 topLayout->addWidget(holidayColor->label(),ii,0);
740 topLayout->addWidget(holidayColor->button(),ii++,1); 740 topLayout->addWidget(holidayColor->button(),ii++,1);
741 741
742 holidayColor = 742 holidayColor =
743 addWidColor(i18n("Day color even months"), 743 addWidColor(i18n("Day color even months"),
744 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 744 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
745 topLayout->addWidget(holidayColor->label(),ii,0); 745 topLayout->addWidget(holidayColor->label(),ii,0);
746 topLayout->addWidget(holidayColor->button(),ii++,1); 746 topLayout->addWidget(holidayColor->button(),ii++,1);
747 747
748 748
749 holidayColor = 749 holidayColor =
750 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 750 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
751 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 751 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
752 topLayout->addWidget(holidayColor->label(),ii,0); 752 topLayout->addWidget(holidayColor->label(),ii,0);
753 topLayout->addWidget(holidayColor->button(),ii++,1); 753 topLayout->addWidget(holidayColor->button(),ii++,1);
754 // *********************** What'sNext View 754 // *********************** What'sNext View
755 topFrame = addPage(i18n("What's Next View"),0,0); 755 topFrame = addPage(i18n("What's Next View"),0,0);
756 // DesktopIcon("viewmag",KIcon::SizeMedium)); 756 // DesktopIcon("viewmag",KIcon::SizeMedium));
757 757
758 topLayout = new QGridLayout(topFrame,4,1); 758 topLayout = new QGridLayout(topFrame,4,1);
759 topLayout->setSpacing(mSpacingHint); 759 topLayout->setSpacing(mSpacingHint);
760 topLayout->setMargin(mMarginHint); 760 topLayout->setMargin(mMarginHint);
761 ii = 0; 761 ii = 0;
762 762
763 763
764 QHBox* hdummy = new QHBox(topFrame); 764 QHBox* hdummy = new QHBox(topFrame);
765 new QLabel(i18n("Days in What's Next:"),hdummy); 765 new QLabel(i18n("Days in What's Next:"),hdummy);
766 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 766 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
767 767
768 topLayout->addWidget(hdummy,ii++,0); 768 topLayout->addWidget(hdummy,ii++,0);
769 769
770 QHBox *prioBox = new QHBox(topFrame); 770 QHBox *prioBox = new QHBox(topFrame);
771 // intervalBox->setSpacing(mSpacingHint); 771 // intervalBox->setSpacing(mSpacingHint);
772 topLayout->addWidget(prioBox,ii++,0); 772 topLayout->addWidget(prioBox,ii++,0);
773 773
774 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); 774 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
775 mPrioSpin = new QSpinBox(0,5,1,prioBox); 775 mPrioSpin = new QSpinBox(0,5,1,prioBox);
776 if ( QApplication::desktop()->width() < 300 ) 776 if ( QApplication::desktop()->width() < 300 )
777 mPrioSpin->setFixedWidth( 40 ); 777 mPrioSpin->setFixedWidth( 40 );
778 778
779 KPrefsDialogWidBool *passwdk = 779 KPrefsDialogWidBool *passwdk =
780 780
781 addWidBool(i18n("Show events that are done"), 781 addWidBool(i18n("Show events that are done"),
782 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 782 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
783 topLayout->addWidget(passwdk->checkBox(), ii++,0); 783 topLayout->addWidget(passwdk->checkBox(), ii++,0);
784 passwdk = 784 passwdk =
785 addWidBool(i18n("Show parent To-Do's"), 785 addWidBool(i18n("Show parent To-Do's"),
786 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 786 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
787 topLayout->addWidget(passwdk->checkBox(), ii++,0); 787 topLayout->addWidget(passwdk->checkBox(), ii++,0);
788 788
789 passwdk = 789 passwdk =
790 addWidBool(i18n("Show location"), 790 addWidBool(i18n("Show location"),
791 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 791 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
792 topLayout->addWidget(passwdk->checkBox(), ii++,0); 792 topLayout->addWidget(passwdk->checkBox(), ii++,0);
793 793
794 794
795 passwdk = 795 passwdk =
796 addWidBool(i18n("Use short date in WN+Event view"), 796 addWidBool(i18n("Use short date in WN+Event view"),
797 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 797 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
798 topLayout->addWidget(passwdk->checkBox(), ii++,0); 798 topLayout->addWidget(passwdk->checkBox(), ii++,0);
799 799
800 800
801 801
802 802
803 // *********************** Todo View 803 // *********************** Todo View
804 804
805 topFrame = addPage(i18n("Todo View"),0,0); 805 topFrame = addPage(i18n("Todo View"),0,0);
806 // DesktopIcon("viewmag",KIcon::SizeMedium)); 806 // DesktopIcon("viewmag",KIcon::SizeMedium));
807 807
808 topLayout = new QGridLayout(topFrame,4,1); 808 topLayout = new QGridLayout(topFrame,4,1);
809 topLayout->setSpacing(mSpacingHint); 809 topLayout->setSpacing(mSpacingHint);
810 topLayout->setMargin(mMarginHint); 810 topLayout->setMargin(mMarginHint);
811 ii = 0; 811 ii = 0;
812dummy = 812dummy =
813 addWidBool(i18n("Hide not running Todos in To-do view"), 813 addWidBool(i18n("Hide not running Todos in To-do view"),
814 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 814 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
815 topLayout->addWidget(dummy->checkBox(),ii++,0); 815 topLayout->addWidget(dummy->checkBox(),ii++,0);
816 816
817 817
818 KPrefsDialogWidBool *showCompletedTodo = 818 KPrefsDialogWidBool *showCompletedTodo =
819 addWidBool(i18n("To-do view shows completed Todos"), 819 addWidBool(i18n("To-do view shows completed Todos"),
820 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 820 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
821 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 821 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
822 dummy = 822 dummy =
823 addWidBool(i18n("To-do view shows complete as 'xx %'"), 823 addWidBool(i18n("To-do view shows complete as 'xx %'"),
824 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 824 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
825 topLayout->addWidget(dummy->checkBox(),ii++,0); 825 topLayout->addWidget(dummy->checkBox(),ii++,0);
826 826
827 dummy = 827 dummy =
828 addWidBool(i18n("Small To-do view uses smaller font"), 828 addWidBool(i18n("Small To-do view uses smaller font"),
829 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 829 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
830 topLayout->addWidget(dummy->checkBox(),ii++,0); 830 topLayout->addWidget(dummy->checkBox(),ii++,0);
831 831
832 832
833 833
834 dummy = 834 dummy =
835 addWidBool(i18n("Todo view uses category colors"), 835 addWidBool(i18n("Todo view uses category colors"),
836 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 836 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
837 topLayout->addWidget(dummy->checkBox(),ii++,0); 837 topLayout->addWidget(dummy->checkBox(),ii++,0);
838 838
839 839
840 QWidget* wid = new QWidget( topFrame ); 840 QWidget* wid = new QWidget( topFrame );
841 // Todo run today color 841 // Todo run today color
842 KPrefsDialogWidColor *todoRunColor = 842 KPrefsDialogWidColor *todoRunColor =
843 addWidColor(i18n("Color for running todos:"), 843 addWidColor(i18n("Color for running todos:"),
844 &(KOPrefs::instance()->mTodoRunColor),wid); 844 &(KOPrefs::instance()->mTodoRunColor),wid);
845 QHBoxLayout *widLayout = new QHBoxLayout(wid); 845 QHBoxLayout *widLayout = new QHBoxLayout(wid);
846 widLayout->addWidget( todoRunColor->label() ); 846 widLayout->addWidget( todoRunColor->label() );
847 widLayout->addWidget( todoRunColor->button() ); 847 widLayout->addWidget( todoRunColor->button() );
848 topLayout->addWidget(wid,ii++,0); 848 topLayout->addWidget(wid,ii++,0);
849 849
850 wid = new QWidget( topFrame ); 850 wid = new QWidget( topFrame );
851 // Todo due today color 851 // Todo due today color
852 KPrefsDialogWidColor *todoDueTodayColor = 852 KPrefsDialogWidColor *todoDueTodayColor =
853 addWidColor(i18n("Todo due today color:"), 853 addWidColor(i18n("Todo due today color:"),
854 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 854 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
855 widLayout = new QHBoxLayout(wid); 855 widLayout = new QHBoxLayout(wid);
856 widLayout->addWidget( todoDueTodayColor->label() ); 856 widLayout->addWidget( todoDueTodayColor->label() );
857 widLayout->addWidget( todoDueTodayColor->button() ); 857 widLayout->addWidget( todoDueTodayColor->button() );
858 topLayout->addWidget(wid,ii++,0); 858 topLayout->addWidget(wid,ii++,0);
859 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 859 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
860 860
861 // Todo overdue color 861 // Todo overdue color
862 wid = new QWidget( topFrame ); 862 wid = new QWidget( topFrame );
863 widLayout = new QHBoxLayout(wid); 863 widLayout = new QHBoxLayout(wid);
864 KPrefsDialogWidColor *todoOverdueColor = 864 KPrefsDialogWidColor *todoOverdueColor =
865 addWidColor(i18n("Todo overdue color:"), 865 addWidColor(i18n("Todo overdue color:"),
866 &(KOPrefs::instance()->mTodoOverdueColor),wid); 866 &(KOPrefs::instance()->mTodoOverdueColor),wid);
867 widLayout->addWidget(todoOverdueColor->label()); 867 widLayout->addWidget(todoOverdueColor->label());
868 widLayout->addWidget(todoOverdueColor->button()); 868 widLayout->addWidget(todoOverdueColor->button());
869 topLayout->addWidget(wid,ii++,0); 869 topLayout->addWidget(wid,ii++,0);
870 870
871 dummy = 871 dummy =
872 addWidBool(i18n("Colors are applied to text"), 872 addWidBool(i18n("Colors are applied to text"),
873 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 873 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
874 topLayout->addWidget(dummy->checkBox(),ii++,0); 874 topLayout->addWidget(dummy->checkBox(),ii++,0);
875 875
876 876
877 877
878 topFrame = addPage(i18n("View Options"),0,0); 878 topFrame = addPage(i18n("View Options"),0,0);
879 879
880 topLayout = new QGridLayout(topFrame,4,1); 880 topLayout = new QGridLayout(topFrame,4,1);
881 topLayout->setSpacing(mSpacingHint); 881 topLayout->setSpacing(mSpacingHint);
882 topLayout->setMargin(mMarginHint); 882 topLayout->setMargin(mMarginHint);
883 ii = 0; 883 ii = 0;
884 884
885 dummy = 885 dummy =
886 addWidBool(i18n("Show Sync Events"), 886 addWidBool(i18n("Show Sync Events"),
887 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 887 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
888 topLayout->addWidget(dummy->checkBox(), ii++,0); 888 topLayout->addWidget(dummy->checkBox(), ii++,0);
889 889
890 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); 890 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
891 topLayout->addWidget(lab ,ii++,0); 891 topLayout->addWidget(lab ,ii++,0);
892 892
893 dummy = addWidBool(i18n("Details"), 893 dummy = addWidBool(i18n("Details"),
894 &(KOPrefs::instance()->mEVshowDetails),topFrame); 894 &(KOPrefs::instance()->mEVshowDetails),topFrame);
895 topLayout->addWidget(dummy->checkBox(),ii++,0); 895 topLayout->addWidget(dummy->checkBox(),ii++,0);
896 dummy = addWidBool(i18n("Created time"), 896 dummy = addWidBool(i18n("Created time"),
897 &(KOPrefs::instance()->mEVshowCreated),topFrame); 897 &(KOPrefs::instance()->mEVshowCreated),topFrame);
898 topLayout->addWidget(dummy->checkBox(),ii++,0); 898 topLayout->addWidget(dummy->checkBox(),ii++,0);
899 dummy = addWidBool(i18n("Last modified time"), 899 dummy = addWidBool(i18n("Last modified time"),
900 &(KOPrefs::instance()->mEVshowChanged),topFrame); 900 &(KOPrefs::instance()->mEVshowChanged),topFrame);
901 topLayout->addWidget(dummy->checkBox(),ii++,0); 901 topLayout->addWidget(dummy->checkBox(),ii++,0);
902 902
903 903
904 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); 904 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
905 topLayout->addWidget(lab ,ii++,0); 905 topLayout->addWidget(lab ,ii++,0);
906 906
907 dummy = addWidBool(i18n("Details"), 907 dummy = addWidBool(i18n("Details"),
908 &(KOPrefs::instance()->mWTshowDetails),topFrame); 908 &(KOPrefs::instance()->mWTshowDetails),topFrame);
909 topLayout->addWidget(dummy->checkBox(),ii++,0); 909 topLayout->addWidget(dummy->checkBox(),ii++,0);
910 dummy = addWidBool(i18n("Created time"), 910 dummy = addWidBool(i18n("Created time"),
911 &(KOPrefs::instance()->mWTshowCreated),topFrame); 911 &(KOPrefs::instance()->mWTshowCreated),topFrame);
912 topLayout->addWidget(dummy->checkBox(),ii++,0); 912 topLayout->addWidget(dummy->checkBox(),ii++,0);
913 dummy = addWidBool(i18n("Last modified time"), 913 dummy = addWidBool(i18n("Last modified time"),
914 &(KOPrefs::instance()->mWTshowChanged),topFrame); 914 &(KOPrefs::instance()->mWTshowChanged),topFrame);
915 topLayout->addWidget(dummy->checkBox(),ii++,0); 915 topLayout->addWidget(dummy->checkBox(),ii++,0);
916 916
917 917
918 topFrame = addPage(i18n("Alarm"),0,0); 918 topFrame = addPage(i18n("Alarm"),0,0);
919 // DesktopIcon("viewmag",KIcon::SizeMedium)); 919 // DesktopIcon("viewmag",KIcon::SizeMedium));
920 920
921 topLayout = new QGridLayout(topFrame,2,1); 921 topLayout = new QGridLayout(topFrame,2,1);
922 topLayout->setSpacing(mSpacingHint); 922 topLayout->setSpacing(mSpacingHint);
923 topLayout->setMargin(mMarginHint); 923 topLayout->setMargin(mMarginHint);
924 int iii = 0; 924 int iii = 0;
925 925
926 dummy = 926 dummy =
927 addWidBool(i18n("Use internal alarm notification"), 927 addWidBool(i18n("Use internal alarm notification"),
928 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 928 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
929 topLayout->addWidget(dummy->checkBox(),iii++,0); 929 topLayout->addWidget(dummy->checkBox(),iii++,0);
930 930
931 if ( QApplication::desktop()->height() > 240 ) { 931 if ( QApplication::desktop()->height() > 240 ) {
932 932
933 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 933 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
934 934
935 topLayout->addWidget(lab ,iii++,0); 935 topLayout->addWidget(lab ,iii++,0);
936 } 936 }
937#ifndef DESKTOP_VERSION 937#ifndef DESKTOP_VERSION
938 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 938 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
939#else 939#else
940 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 940 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
941 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 941 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
942#endif 942#endif
943 943
944 QHBox* dummyBox = new QHBox(topFrame); 944 QHBox* dummyBox = new QHBox(topFrame);
945 new QLabel(i18n("Play beeps count:"),dummyBox); 945 new QLabel(i18n("Play beeps count:"),dummyBox);
946 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 946 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
947 topLayout->addWidget(dummyBox,iii++,0); 947 topLayout->addWidget(dummyBox,iii++,0);
948 948
949 dummyBox = new QHBox(topFrame); 949 dummyBox = new QHBox(topFrame);
950 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 950 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
951 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 951 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
952 topLayout->addWidget(dummyBox,iii++,0); 952 topLayout->addWidget(dummyBox,iii++,0);
953 953
954 dummyBox = new QHBox(topFrame); 954 dummyBox = new QHBox(topFrame);
955 new QLabel(i18n("Default suspend time in min:"),dummyBox); 955 new QLabel(i18n("Default suspend time in min:"),dummyBox);
956 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 956 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
957 topLayout->addWidget(dummyBox,iii++,0); 957 topLayout->addWidget(dummyBox,iii++,0);
958 958
959 dummyBox = new QHBox(topFrame); 959 dummyBox = new QHBox(topFrame);
960 new QLabel(i18n("Auto suspend count:"),dummyBox); 960 new QLabel(i18n("Auto suspend count:"),dummyBox);
961 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 961 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
962 topLayout->addWidget(dummyBox,iii++,0); 962 topLayout->addWidget(dummyBox,iii++,0);
963 963
964 964
965 965
966 QHBox* hbo = new QHBox ( topFrame ); 966 QHBox* hbo = new QHBox ( topFrame );
967 mDefaultAlarmFile = new QLineEdit(hbo); 967 mDefaultAlarmFile = new QLineEdit(hbo);
968 QPushButton * loadTemplate = new QPushButton(hbo); 968 QPushButton * loadTemplate = new QPushButton(hbo);
969 QPixmap icon; 969 QPixmap icon;
970 if ( QApplication::desktop()->width() < 321 ) 970 if ( QApplication::desktop()->width() < 321 )
971 icon = SmallIcon("fileimport16"); 971 icon = SmallIcon("fileimport16");
972 else 972 else
973 icon = SmallIcon("fileimport"); 973 icon = SmallIcon("fileimport");
974 loadTemplate->setIconSet (icon ) ; 974 loadTemplate->setIconSet (icon ) ;
975 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 975 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
976 int size = loadTemplate->sizeHint().height(); 976 int size = loadTemplate->sizeHint().height();
977 loadTemplate->setFixedSize( size, size ); 977 loadTemplate->setFixedSize( size, size );
978 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 978 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
979 // topLayout->addWidget(lab ,iii++,0); 979 // topLayout->addWidget(lab ,iii++,0);
980 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 980 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
981 topLayout->addWidget(lab ,iii++,0); 981 topLayout->addWidget(lab ,iii++,0);
982 topLayout->addWidget(hbo,iii++,0); 982 topLayout->addWidget(hbo,iii++,0);
983 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 983 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
984 984
985// topLayout->addWidget(lab ,iii++,0); 985// topLayout->addWidget(lab ,iii++,0);
986// #ifndef DESKTOP_VERSION 986// #ifndef DESKTOP_VERSION
987// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 987// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
988// #else 988// #else
989// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 989// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
990// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 990// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
991// #endif 991// #endif
992 992
993 993
994} 994}
995 995
996void KOPrefsDialog::selectSoundFile() 996void KOPrefsDialog::selectSoundFile()
997{ 997{
998 QString fileName = mDefaultAlarmFile->text(); 998 QString fileName = mDefaultAlarmFile->text();
999 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 999 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1000 if ( fileName.length() > 0 ) 1000 if ( fileName.length() > 0 )
1001 mDefaultAlarmFile->setText( fileName ); 1001 mDefaultAlarmFile->setText( fileName );
1002} 1002}
1003void KOPrefsDialog::setupFontsTab() 1003void KOPrefsDialog::setupFontsTab()
1004{ 1004{
1005 1005
1006 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1006 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1007 // DesktopIcon("fonts",KIcon::SizeMedium)); 1007 // DesktopIcon("fonts",KIcon::SizeMedium));
1008 1008
1009 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1009 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1010 topLayout->setSpacing(1); 1010 topLayout->setSpacing(1);
1011 topLayout->setMargin(3); 1011 topLayout->setMargin(3);
1012 KPrefsDialogWidFont * tVFont; 1012 KPrefsDialogWidFont * tVFont;
1013 int i = 0; 1013 int i = 0;
1014 KPrefsDialogWidFont *timeLabelsFont = 1014 KPrefsDialogWidFont *timeLabelsFont =
1015 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1015 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1016 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1016 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1017 topLayout->addWidget(timeLabelsFont->label(),i,0); 1017 topLayout->addWidget(timeLabelsFont->label(),i,0);
1018 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1018 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1019 topLayout->addWidget(timeLabelsFont->button(),i,2); 1019 topLayout->addWidget(timeLabelsFont->button(),i,2);
1020 ++i; 1020 ++i;
1021 1021
1022 1022
1023 timeLabelsFont = 1023 timeLabelsFont =
1024 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1024 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1025 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1025 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1026 topLayout->addWidget(timeLabelsFont->label(),i,0); 1026 topLayout->addWidget(timeLabelsFont->label(),i,0);
1027 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1027 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1028 topLayout->addWidget(timeLabelsFont->button(),i,2); 1028 topLayout->addWidget(timeLabelsFont->button(),i,2);
1029 ++i; 1029 ++i;
1030 1030
1031 KPrefsDialogWidFont *timeBarFont = 1031 KPrefsDialogWidFont *timeBarFont =
1032 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1032 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1033 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1033 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1034 topLayout->addWidget(timeBarFont->label(),i,0); 1034 topLayout->addWidget(timeBarFont->label(),i,0);
1035 topLayout->addWidget(timeBarFont->preview(),i,1); 1035 topLayout->addWidget(timeBarFont->preview(),i,1);
1036 topLayout->addWidget(timeBarFont->button(),i,2); 1036 topLayout->addWidget(timeBarFont->button(),i,2);
1037 ++i; 1037 ++i;
1038 1038
1039 1039
1040 KPrefsDialogWidFont *marcusBainsFont = 1040 KPrefsDialogWidFont *marcusBainsFont =
1041 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1041 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1042 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1042 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1043 topLayout->addWidget(marcusBainsFont->label(),i,0); 1043 topLayout->addWidget(marcusBainsFont->label(),i,0);
1044 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1044 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1045 topLayout->addWidget(marcusBainsFont->button(),i,2); 1045 topLayout->addWidget(marcusBainsFont->button(),i,2);
1046 ++i; 1046 ++i;
1047 1047
1048 tVFont = 1048 tVFont =
1049 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1049 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1050 &(KOPrefs::instance()->mEventViewFont),topFrame); 1050 &(KOPrefs::instance()->mEventViewFont),topFrame);
1051 topLayout->addWidget(tVFont->label(),i,0); 1051 topLayout->addWidget(tVFont->label(),i,0);
1052 topLayout->addWidget(tVFont->preview(),i,1); 1052 topLayout->addWidget(tVFont->preview(),i,1);
1053 topLayout->addWidget(tVFont->button(),i,2); 1053 topLayout->addWidget(tVFont->button(),i,2);
1054 ++i; 1054 ++i;
1055 1055
1056 1056
1057 1057
1058 tVFont = 1058 tVFont =
1059 addWidFont(i18n("Details"),i18n("EditorBox:"), 1059 addWidFont(i18n("Details"),i18n("EditorBox:"),
1060 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1060 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1061 topLayout->addWidget(tVFont->label(),i,0); 1061 topLayout->addWidget(tVFont->label(),i,0);
1062 topLayout->addWidget(tVFont->preview(),i,1); 1062 topLayout->addWidget(tVFont->preview(),i,1);
1063 topLayout->addWidget(tVFont->button(),i,2); 1063 topLayout->addWidget(tVFont->button(),i,2);
1064 ++i; 1064 ++i;
1065 1065
1066 1066
1067 1067
1068 topLayout->setColStretch(1,1); 1068 topLayout->setColStretch(1,1);
1069 topLayout->setRowStretch(4,1); 1069 topLayout->setRowStretch(4,1);
1070 1070
1071 1071
1072 i = 0; 1072 i = 0;
1073 topFrame = addPage(i18n("View Fonts"),0, 1073 topFrame = addPage(i18n("View Fonts"),0,
1074 DesktopIcon("fonts",KIcon::SizeMedium)); 1074 DesktopIcon("fonts",KIcon::SizeMedium));
1075 1075
1076 topLayout = new QGridLayout(topFrame,7,3); 1076 topLayout = new QGridLayout(topFrame,7,3);
1077 topLayout->setSpacing(1); 1077 topLayout->setSpacing(1);
1078 topLayout->setMargin(3); 1078 topLayout->setMargin(3);
1079 1079
1080 tVFont = 1080 tVFont =
1081 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1081 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1082 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1082 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1083 topLayout->addWidget(tVFont->label(),i,0); 1083 topLayout->addWidget(tVFont->label(),i,0);
1084 topLayout->addWidget(tVFont->preview(),i,1); 1084 topLayout->addWidget(tVFont->preview(),i,1);
1085 topLayout->addWidget(tVFont->button(),i,2); 1085 topLayout->addWidget(tVFont->button(),i,2);
1086 ++i; 1086 ++i;
1087 KPrefsDialogWidFont *agendaViewFont = 1087 KPrefsDialogWidFont *agendaViewFont =
1088 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1088 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1089 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1089 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1090 topLayout->addWidget(agendaViewFont->label(),i,0); 1090 topLayout->addWidget(agendaViewFont->label(),i,0);
1091 topLayout->addWidget(agendaViewFont->preview(),i,1); 1091 topLayout->addWidget(agendaViewFont->preview(),i,1);
1092 topLayout->addWidget(agendaViewFont->button(),i,2); 1092 topLayout->addWidget(agendaViewFont->button(),i,2);
1093 ++i; 1093 ++i;
1094 1094
1095 1095
1096 KPrefsDialogWidFont *monthViewFont = 1096 KPrefsDialogWidFont *monthViewFont =
1097 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1097 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1098 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1098 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1099 topLayout->addWidget(monthViewFont->label(),i,0); 1099 topLayout->addWidget(monthViewFont->label(),i,0);
1100 topLayout->addWidget(monthViewFont->preview(),i,1); 1100 topLayout->addWidget(monthViewFont->preview(),i,1);
1101 topLayout->addWidget(monthViewFont->button(),i,2); 1101 topLayout->addWidget(monthViewFont->button(),i,2);
1102 ++i; 1102 ++i;
1103 1103
1104 1104
1105 KPrefsDialogWidFont *lVFont = 1105 KPrefsDialogWidFont *lVFont =
1106 addWidFont(i18n("Event"),i18n("List View:"), 1106 addWidFont(i18n("Event"),i18n("List View:"),
1107 &(KOPrefs::instance()->mListViewFont),topFrame); 1107 &(KOPrefs::instance()->mListViewFont),topFrame);
1108 topLayout->addWidget(lVFont->label(),i,0); 1108 topLayout->addWidget(lVFont->label(),i,0);
1109 topLayout->addWidget(lVFont->preview(),i,1); 1109 topLayout->addWidget(lVFont->preview(),i,1);
1110 topLayout->addWidget(lVFont->button(),i,2); 1110 topLayout->addWidget(lVFont->button(),i,2);
1111 ++i; 1111 ++i;
1112 1112
1113 1113
1114 tVFont = 1114 tVFont =
1115 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1115 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1116 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1116 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1117 topLayout->addWidget(tVFont->label(),i,0); 1117 topLayout->addWidget(tVFont->label(),i,0);
1118 topLayout->addWidget(tVFont->preview(),i,1); 1118 topLayout->addWidget(tVFont->preview(),i,1);
1119 topLayout->addWidget(tVFont->button(),i,2); 1119 topLayout->addWidget(tVFont->button(),i,2);
1120 ++i; 1120 ++i;
1121 1121
1122 1122
1123 tVFont = 1123 tVFont =
1124 addWidFont(i18n("Today"),i18n("JournalView:"), 1124 addWidFont(i18n("Today"),i18n("JournalView:"),
1125 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1125 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1126 topLayout->addWidget(tVFont->label(),i,0); 1126 topLayout->addWidget(tVFont->label(),i,0);
1127 topLayout->addWidget(tVFont->preview(),i,1); 1127 topLayout->addWidget(tVFont->preview(),i,1);
1128 topLayout->addWidget(tVFont->button(),i,2); 1128 topLayout->addWidget(tVFont->button(),i,2);
1129 ++i; 1129 ++i;
1130 1130
1131 1131
1132 1132
1133 1133
1134 topLayout->setColStretch(1,1); 1134 topLayout->setColStretch(1,1);
1135 topLayout->setRowStretch(4,1); 1135 topLayout->setRowStretch(4,1);
1136 1136
1137 1137
1138 1138
1139 1139
1140} 1140}
1141 1141
1142void KOPrefsDialog::setupColorsTab() 1142void KOPrefsDialog::setupColorsTab()
1143{ 1143{
1144 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1144 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1145 // DesktopIcon("colorize",KIcon::SizeMedium)); 1145 // DesktopIcon("colorize",KIcon::SizeMedium));
1146 1146
1147 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1147 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1148 // topLayout->setSpacing(mSpacingHint); 1148 // topLayout->setSpacing(mSpacingHint);
1149 // topLayout->setMargin(mMarginHint); 1149 // topLayout->setMargin(mMarginHint);
1150 1150
1151 topLayout->setSpacing(2); 1151 topLayout->setSpacing(2);
1152 topLayout->setMargin(3); 1152 topLayout->setMargin(3);
1153 1153
1154 int ii = 1; 1154 int ii = 1;
1155 QGroupBox *categoryGroup ; 1155 QGroupBox *categoryGroup ;
1156 1156
1157 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1157 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1158 topFrame); 1158 topFrame);
1159 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1159 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1160 1160
1161 mCategoryCombo = new QComboBox(categoryGroup); 1161 mCategoryCombo = new QComboBox(categoryGroup);
1162 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1162 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1163 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1163 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1164 1164
1165 mCategoryButton = new KColorButton(categoryGroup); 1165 mCategoryButton = new KColorButton(categoryGroup);
1166 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1166 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1167 updateCategoryColor(); 1167 updateCategoryColor();
1168 1168
1169 1169
1170 // Holiday Color 1170 // Holiday Color
1171 1171
1172 KPrefsDialogWidColor *holidayColor = 1172 KPrefsDialogWidColor *holidayColor =
1173 addWidColor(i18n("Holiday color:"), 1173 addWidColor(i18n("Holiday color:"),
1174 &(KOPrefs::instance()->mHolidayColor),topFrame); 1174 &(KOPrefs::instance()->mHolidayColor),topFrame);
1175 topLayout->addWidget(holidayColor->label(),ii,0); 1175 topLayout->addWidget(holidayColor->label(),ii,0);
1176 topLayout->addWidget(holidayColor->button(),ii++,1); 1176 topLayout->addWidget(holidayColor->button(),ii++,1);
1177 1177
1178 // Highlight Color 1178 // Highlight Color
1179 KPrefsDialogWidColor *highlightColor = 1179 KPrefsDialogWidColor *highlightColor =
1180 addWidColor(i18n("Highlight color:"), 1180 addWidColor(i18n("Highlight color:"),
1181 &(KOPrefs::instance()->mHighlightColor),topFrame); 1181 &(KOPrefs::instance()->mHighlightColor),topFrame);
1182 topLayout->addWidget(highlightColor->label(),ii,0); 1182 topLayout->addWidget(highlightColor->label(),ii,0);
1183 topLayout->addWidget(highlightColor->button(),ii++,1); 1183 topLayout->addWidget(highlightColor->button(),ii++,1);
1184 1184
1185 // Event color 1185 // Event color
1186 KPrefsDialogWidColor *eventColor = 1186 KPrefsDialogWidColor *eventColor =
1187 addWidColor(i18n("Default event color:"), 1187 addWidColor(i18n("Default event color:"),
1188 &(KOPrefs::instance()->mEventColor),topFrame); 1188 &(KOPrefs::instance()->mEventColor),topFrame);
1189 topLayout->addWidget(eventColor->label(),ii,0); 1189 topLayout->addWidget(eventColor->label(),ii,0);
1190 topLayout->addWidget(eventColor->button(),ii++,1); 1190 topLayout->addWidget(eventColor->button(),ii++,1);
1191 eventColor = 1191 eventColor =
1192 addWidColor(i18n("Default todo done color:"), 1192 addWidColor(i18n("Default todo done color:"),
1193 &(KOPrefs::instance()->mTodoDoneColor),topFrame); 1193 &(KOPrefs::instance()->mTodoDoneColor),topFrame);
1194 topLayout->addWidget(eventColor->label(),ii,0); 1194 topLayout->addWidget(eventColor->label(),ii,0);
1195 topLayout->addWidget(eventColor->button(),ii++,1); 1195 topLayout->addWidget(eventColor->button(),ii++,1);
1196 1196
1197 if ( QApplication::desktop()->height() <= 240 ) { 1197 if ( QApplication::desktop()->height() <= 240 ) {
1198 topFrame = addPage(i18n("Colors") +" 2",0,0); 1198 topFrame = addPage(i18n("Colors") +" 2",0,0);
1199 // DesktopIcon("colorize",KIcon::SizeMedium)); 1199 // DesktopIcon("colorize",KIcon::SizeMedium));
1200 1200
1201 topLayout = new QGridLayout(topFrame,5,2); 1201 topLayout = new QGridLayout(topFrame,5,2);
1202 // topLayout->setSpacing(mSpacingHint); 1202 // topLayout->setSpacing(mSpacingHint);
1203 // topLayout->setMargin(mMarginHint); 1203 // topLayout->setMargin(mMarginHint);
1204 1204
1205 topLayout->setSpacing(2); 1205 topLayout->setSpacing(2);
1206 topLayout->setMargin(3); 1206 topLayout->setMargin(3);
1207 } 1207 }
1208 1208
1209 1209
1210 // agenda view background color 1210 // agenda view background color
1211 KPrefsDialogWidColor *agendaBgColor = 1211 KPrefsDialogWidColor *agendaBgColor =
1212 addWidColor(i18n("Agenda view background color:"), 1212 addWidColor(i18n("Agenda view background color:"),
1213 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1213 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1214 topLayout->addWidget(agendaBgColor->label(),ii,0); 1214 topLayout->addWidget(agendaBgColor->label(),ii,0);
1215 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1215 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1216 1216
1217 // working hours color 1217 // working hours color
1218 KPrefsDialogWidColor *workingHoursColor = 1218 KPrefsDialogWidColor *workingHoursColor =
1219 addWidColor(i18n("Working hours color:"), 1219 addWidColor(i18n("Working hours color:"),
1220 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1220 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1221 topLayout->addWidget(workingHoursColor->label(),ii,0); 1221 topLayout->addWidget(workingHoursColor->label(),ii,0);
1222 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1222 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1223 1223
1224 KPrefsDialogWidBool *sb = 1224 KPrefsDialogWidBool *sb =
1225 addWidBool(i18n("Use colors for application:"), 1225 addWidBool(i18n("Use colors for application:"),
1226 &(KOPrefs::instance()->mUseAppColors),topFrame); 1226 &(KOPrefs::instance()->mUseAppColors),topFrame);
1227 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1227 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1228 1228
1229 ii++; 1229 ii++;
1230 KPrefsDialogWidColor * workingHoursColor1 = 1230 KPrefsDialogWidColor * workingHoursColor1 =
1231 addWidColor(i18n("Buttons, menus, etc.:"), 1231 addWidColor(i18n("Buttons, menus, etc.:"),
1232 &(KOPrefs::instance()->mAppColor1),topFrame); 1232 &(KOPrefs::instance()->mAppColor1),topFrame);
1233 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1233 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1234 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1234 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1235 1235
1236 KPrefsDialogWidColor * workingHoursColor2 = 1236 KPrefsDialogWidColor * workingHoursColor2 =
1237 addWidColor(i18n("Frames, labels, etc.:"), 1237 addWidColor(i18n("Frames, labels, etc.:"),
1238 &(KOPrefs::instance()->mAppColor2),topFrame); 1238 &(KOPrefs::instance()->mAppColor2),topFrame);
1239 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1239 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1240 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1240 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1241 1241
1242 1242
1243 1243
1244} 1244}
1245 1245
1246void KOPrefsDialog::setCategoryColor() 1246void KOPrefsDialog::setCategoryColor()
1247{ 1247{
1248 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1248 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1249} 1249}
1250 1250
1251void KOPrefsDialog::updateCategoryColor() 1251void KOPrefsDialog::updateCategoryColor()
1252{ 1252{
1253 QString cat = mCategoryCombo->currentText(); 1253 QString cat = mCategoryCombo->currentText();
1254 QColor *color = mCategoryDict.find(cat); 1254 QColor *color = mCategoryDict.find(cat);
1255 if (!color) { 1255 if (!color) {
1256 color = KOPrefs::instance()->categoryColor(cat); 1256 color = KOPrefs::instance()->categoryColor(cat);
1257 } 1257 }
1258 if (color) { 1258 if (color) {
1259 mCategoryButton->setColor(*color); 1259 mCategoryButton->setColor(*color);
1260 } 1260 }
1261} 1261}
1262 1262
1263void KOPrefsDialog::setupPrinterTab() 1263void KOPrefsDialog::setupPrinterTab()
1264{ 1264{
1265 mPrinterTab = addPage(i18n("Printing"),0, 1265 mPrinterTab = addPage(i18n("Printing"),0,
1266 DesktopIcon("fileprint",KIcon::SizeMedium)); 1266 DesktopIcon("fileprint",KIcon::SizeMedium));
1267 1267
1268 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1268 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1269 topLayout->setSpacing(mSpacingHint); 1269 topLayout->setSpacing(mSpacingHint);
1270 topLayout->setMargin(mMarginHint); 1270 topLayout->setMargin(mMarginHint);
1271 1271
1272 topLayout->setRowStretch(4,1); 1272 topLayout->setRowStretch(4,1);
1273} 1273}
1274 1274
1275void KOPrefsDialog::setupGroupSchedulingTab() 1275void KOPrefsDialog::setupGroupSchedulingTab()
1276{ 1276{
1277#if 0 1277#if 0
1278 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1278 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1279 DesktopIcon("personal",KIcon::SizeMedium)); 1279 DesktopIcon("personal",KIcon::SizeMedium));
1280 1280
1281 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1281 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1282 topLayout->setSpacing(mSpacingHint); 1282 topLayout->setSpacing(mSpacingHint);
1283 topLayout->setMargin(mMarginHint); 1283 topLayout->setMargin(mMarginHint);
1284 1284
1285#if 0 1285#if 0
1286 KPrefsDialogWidRadios *schedulerGroup = 1286 KPrefsDialogWidRadios *schedulerGroup =
1287 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1287 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1288 topFrame); 1288 topFrame);
1289 schedulerGroup->addRadio("Dummy"); // Only for debugging 1289 schedulerGroup->addRadio("Dummy"); // Only for debugging
1290 schedulerGroup->addRadio(i18n("Mail client")); 1290 schedulerGroup->addRadio(i18n("Mail client"));
1291 1291
1292 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1292 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1293#endif 1293#endif
1294 1294
1295 KPrefsDialogWidRadios *sendGroup = 1295 KPrefsDialogWidRadios *sendGroup =
1296 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1296 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1297 topFrame); 1297 topFrame);
1298 sendGroup->addRadio(i18n("Send to outbox")); 1298 sendGroup->addRadio(i18n("Send to outbox"));
1299 sendGroup->addRadio(i18n("Send directly")); 1299 sendGroup->addRadio(i18n("Send directly"));
1300 1300
1301 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1301 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1302 1302
1303 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1303 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1304 mAMails = new QListView(topFrame); 1304 mAMails = new QListView(topFrame);
1305 mAMails->addColumn(i18n("Email"),300); 1305 mAMails->addColumn(i18n("Email"),300);
1306 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1306 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1307 1307
1308 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1308 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1309 aEmailsEdit = new QLineEdit(topFrame); 1309 aEmailsEdit = new QLineEdit(topFrame);
1310 aEmailsEdit->setEnabled(false); 1310 aEmailsEdit->setEnabled(false);
1311 topLayout->addWidget(aEmailsEdit,4,1); 1311 topLayout->addWidget(aEmailsEdit,4,1);
1312 1312
1313 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1313 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1314 topLayout->addWidget(add,5,0); 1314 topLayout->addWidget(add,5,0);
1315 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1315 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1316 topLayout->addWidget(del,5,1); 1316 topLayout->addWidget(del,5,1);
1317 1317
1318 //topLayout->setRowStretch(2,1); 1318 //topLayout->setRowStretch(2,1);
1319 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1319 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1320 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1320 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1321 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1321 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1322 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1322 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1323#endif 1323#endif
1324} 1324}
1325 1325
1326void KOPrefsDialog::setupGroupAutomationTab() 1326void KOPrefsDialog::setupGroupAutomationTab()
1327{ 1327{
1328 return; 1328 return;
1329 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1329 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1330 DesktopIcon("personal",KIcon::SizeMedium)); 1330 DesktopIcon("personal",KIcon::SizeMedium));
1331 1331
1332 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1332 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1333 topLayout->setSpacing(mSpacingHint); 1333 topLayout->setSpacing(mSpacingHint);
1334 topLayout->setMargin(mMarginHint); 1334 topLayout->setMargin(mMarginHint);
1335 1335
1336 KPrefsDialogWidRadios *autoRefreshGroup = 1336 KPrefsDialogWidRadios *autoRefreshGroup =
1337 addWidRadios(i18n("Auto Send Refresh"), 1337 addWidRadios(i18n("Auto Send Refresh"),
1338 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1338 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1339 autoRefreshGroup->addRadio(i18n("Never")); 1339 autoRefreshGroup->addRadio(i18n("Never"));
1340 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1340 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1341 //autoRefreshGroup->addRadio(i18n("selected emails")); 1341 //autoRefreshGroup->addRadio(i18n("selected emails"));
1342 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1342 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1343 1343
1344 KPrefsDialogWidRadios *autoInsertGroup = 1344 KPrefsDialogWidRadios *autoInsertGroup =
1345 addWidRadios(i18n("Auto Insert IMIP Replies"), 1345 addWidRadios(i18n("Auto Insert IMIP Replies"),
1346 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1346 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1347 autoInsertGroup->addRadio(i18n("Never")); 1347 autoInsertGroup->addRadio(i18n("Never"));
1348 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1348 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1349 //autoInsertGroup->addRadio(i18n("selected emails")); 1349 //autoInsertGroup->addRadio(i18n("selected emails"));
1350 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1350 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1351 1351
1352 KPrefsDialogWidRadios *autoRequestGroup = 1352 KPrefsDialogWidRadios *autoRequestGroup =
1353 addWidRadios(i18n("Auto Insert IMIP Requests"), 1353 addWidRadios(i18n("Auto Insert IMIP Requests"),
1354 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1354 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1355 autoRequestGroup->addRadio(i18n("Never")); 1355 autoRequestGroup->addRadio(i18n("Never"));
1356 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1356 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1357 //autoInsertGroup->addRadio(i18n("selected emails")); 1357 //autoInsertGroup->addRadio(i18n("selected emails"));
1358 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1358 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1359 1359
1360 KPrefsDialogWidRadios *autoFreeBusyGroup = 1360 KPrefsDialogWidRadios *autoFreeBusyGroup =
1361 addWidRadios(i18n("Auto Send FreeBusy Information"), 1361 addWidRadios(i18n("Auto Send FreeBusy Information"),
1362 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1362 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1363 autoFreeBusyGroup->addRadio(i18n("Never")); 1363 autoFreeBusyGroup->addRadio(i18n("Never"));
1364 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1364 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1365 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1365 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1366 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1366 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1367 1367
1368 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1368 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1369 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1369 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1370 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1370 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1371 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1371 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1372 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1372 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1373 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1373 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1374 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1374 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1375} 1375}
1376 1376
1377void KOPrefsDialog::showPrinterTab() 1377void KOPrefsDialog::showPrinterTab()
1378{ 1378{
1379 showPage(pageIndex(mPrinterTab)); 1379 showPage(pageIndex(mPrinterTab));
1380} 1380}
1381 1381
1382 1382
1383void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1383void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1384 const QStringList *tags) 1384 const QStringList *tags)
1385{ 1385{
1386 if (tags) { 1386 if (tags) {
1387 int i = tags->findIndex(text); 1387 int i = tags->findIndex(text);
1388 if (i > 0) combo->setCurrentItem(i); 1388 if (i > 0) combo->setCurrentItem(i);
1389 } else { 1389 } else {
1390 for(int i=0;i<combo->count();++i) { 1390 for(int i=0;i<combo->count();++i) {
1391 if (combo->text(i) == text) { 1391 if (combo->text(i) == text) {
1392 combo->setCurrentItem(i); 1392 combo->setCurrentItem(i);
1393 break; 1393 break;
1394 } 1394 }
1395 } 1395 }
1396 } 1396 }
1397} 1397}
1398 1398
1399void KOPrefsDialog::usrReadConfig() 1399void KOPrefsDialog::usrReadConfig()
1400{ 1400{
1401 1401
1402 mNameEdit->setText(KOPrefs::instance()->fullName()); 1402 mNameEdit->setText(KOPrefs::instance()->fullName());
1403 mEmailEdit->setText(KOPrefs::instance()->email()); 1403 mEmailEdit->setText(KOPrefs::instance()->email());
1404 1404
1405 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1405 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1406 1406
1407 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1407 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1408 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1408 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1409 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1409 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1410 1410
1411 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1411 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1412 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1412 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1413 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1413 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1414 // mAMails->clear(); 1414 // mAMails->clear();
1415 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1415 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1416// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1416// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1417// QListViewItem *item = new QListViewItem(mAMails); 1417// QListViewItem *item = new QListViewItem(mAMails);
1418// item->setText(0,*it); 1418// item->setText(0,*it);
1419// mAMails->insertItem(item); 1419// mAMails->insertItem(item);
1420// } 1420// }
1421 1421
1422 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1422 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1423 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1423 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1424 updateCategories(); 1424 updateCategories();
1425 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1425 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1426 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1426 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1427 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1427 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1428 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1428 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1429 1429 mCatDefaultColor = KOPrefs::instance()->mEventColor;
1430} 1430}
1431 1431
1432 1432
1433void KOPrefsDialog::usrWriteConfig() 1433void KOPrefsDialog::usrWriteConfig()
1434{ 1434{
1435
1436
1437 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1435 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1438 KOPrefs::instance()->setFullName(mNameEdit->text()); 1436 KOPrefs::instance()->setFullName(mNameEdit->text());
1439 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1437 KOPrefs::instance()->setEmail(mEmailEdit->text());
1440 1438
1441 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1439 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1442 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1440 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1443 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1441 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1444 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1442 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1445 1443 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) {
1444 QStringList cat = KOPrefs::instance()->mCustomCategories;
1445 int iii = 0;
1446 while ( iii < cat.count() ) {
1447 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor )
1448 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor );
1449 ++iii;
1450 }
1451 }
1446 QDictIterator<QColor> it(mCategoryDict); 1452 QDictIterator<QColor> it(mCategoryDict);
1447 while (it.current()) { 1453 while (it.current()) {
1448 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1454 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1449 ++it; 1455 ++it;
1450 } 1456 }
1451 1457
1452 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1458 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1453 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1459 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1454 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1460 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1455 1461
1456 KOPrefs::instance()->mAdditionalMails.clear(); 1462 KOPrefs::instance()->mAdditionalMails.clear();
1457 // QListViewItem *item; 1463 // QListViewItem *item;
1458 // item = mAMails->firstChild(); 1464 // item = mAMails->firstChild();
1459 // while (item) 1465 // while (item)
1460 // { 1466 // {
1461 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1467 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1462 // item = item->nextSibling(); 1468 // item = item->nextSibling();
1463 // } 1469 // }
1464 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1470 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1465 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1471 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1466 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1472 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1467 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1473 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1468} 1474}
1469 1475
1470void KOPrefsDialog::updateCategories() 1476void KOPrefsDialog::updateCategories()
1471{ 1477{
1472 mCategoryCombo->clear(); 1478 mCategoryCombo->clear();
1473 mCategoryDict.clear(); 1479 mCategoryDict.clear();
1474 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1480 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1475 updateCategoryColor(); 1481 updateCategoryColor();
1476} 1482}
1477 1483
1478void KOPrefsDialog::toggleEmailSettings(bool on) 1484void KOPrefsDialog::toggleEmailSettings(bool on)
1479{ 1485{
1480 if (on) { 1486 if (on) {
1481 mEmailEdit->setEnabled(false); 1487 mEmailEdit->setEnabled(false);
1482 mNameEdit->setEnabled(false); 1488 mNameEdit->setEnabled(false);
1483 mEmailLabel->setEnabled(false); 1489 mEmailLabel->setEnabled(false);
1484 mNameLabel->setEnabled(false); 1490 mNameLabel->setEnabled(false);
1485 1491
1486 KEMailSettings settings; 1492 KEMailSettings settings;
1487 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1493 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1488 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1494 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1489 } else { 1495 } else {
1490 mEmailEdit->setEnabled(true); 1496 mEmailEdit->setEnabled(true);
1491 mNameEdit->setEnabled(true); 1497 mNameEdit->setEnabled(true);
1492 mEmailLabel->setEnabled(true); 1498 mEmailLabel->setEnabled(true);
1493 mNameLabel->setEnabled(true); 1499 mNameLabel->setEnabled(true);
1494 } 1500 }
1495} 1501}
1496 1502
1497void KOPrefsDialog::addItem() 1503void KOPrefsDialog::addItem()
1498{ 1504{
1499 // aEmailsEdit->setEnabled(true); 1505 // aEmailsEdit->setEnabled(true);
1500// QListViewItem *item = new QListViewItem(mAMails); 1506// QListViewItem *item = new QListViewItem(mAMails);
1501// mAMails->insertItem(item); 1507// mAMails->insertItem(item);
1502// mAMails->setSelected(item,true); 1508// mAMails->setSelected(item,true);
1503// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1509// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1504} 1510}
1505 1511
1506void KOPrefsDialog::removeItem() 1512void KOPrefsDialog::removeItem()
1507{ 1513{
1508// QListViewItem *item; 1514// QListViewItem *item;
1509// item = mAMails->selectedItem(); 1515// item = mAMails->selectedItem();
1510// if (!item) return; 1516// if (!item) return;
1511// mAMails->takeItem(item); 1517// mAMails->takeItem(item);
1512// item = mAMails->selectedItem(); 1518// item = mAMails->selectedItem();
1513// if (!item) { 1519// if (!item) {
1514// aEmailsEdit->setText(""); 1520// aEmailsEdit->setText("");
1515// aEmailsEdit->setEnabled(false); 1521// aEmailsEdit->setEnabled(false);
1516// } 1522// }
1517// if (mAMails->childCount() == 0) { 1523// if (mAMails->childCount() == 0) {
1518// aEmailsEdit->setEnabled(false); 1524// aEmailsEdit->setEnabled(false);
1519// } 1525// }
1520} 1526}
1521 1527
1522void KOPrefsDialog::updateItem() 1528void KOPrefsDialog::updateItem()
1523{ 1529{
1524 // QListViewItem *item; 1530 // QListViewItem *item;
1525// item = mAMails->selectedItem(); 1531// item = mAMails->selectedItem();
1526// if (!item) return; 1532// if (!item) return;
1527// item->setText(0,aEmailsEdit->text()); 1533// item->setText(0,aEmailsEdit->text());
1528} 1534}
1529 1535
1530void KOPrefsDialog::updateInput() 1536void KOPrefsDialog::updateInput()
1531{ 1537{
1532// QListViewItem *item; 1538// QListViewItem *item;
1533// item = mAMails->selectedItem(); 1539// item = mAMails->selectedItem();
1534// if (!item) return; 1540// if (!item) return;
1535// aEmailsEdit->setEnabled(true); 1541// aEmailsEdit->setEnabled(true);
1536// aEmailsEdit->setText(item->text(0)); 1542// aEmailsEdit->setText(item->text(0));
1537} 1543}
1538 1544
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index 80d6545..baa6cf9 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -1,154 +1,155 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <qframe.h>
27#include <qdict.h> 27#include <qdict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <qlistview.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33#include <libkdepim/kprefsdialog.h> 33#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 34#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h> 35#include <kcmconfigs/kdepimconfigwidget.h>
36 36
37class KColorButton; 37class KColorButton;
38class QSpinBox; 38class QSpinBox;
39class QSlider; 39class QSlider;
40class KURLRequester; 40class KURLRequester;
41class QComboBox; 41class QComboBox;
42class QLineEdit; 42class QLineEdit;
43class QStringList; 43class QStringList;
44 44
45/** Dialog to change the korganizer configuration. 45/** Dialog to change the korganizer configuration.
46 */ 46 */
47class KOPrefsDialog : public KPrefsDialog 47class KOPrefsDialog : public KPrefsDialog
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 /** Initialize dialog and pages */ 51 /** Initialize dialog and pages */
52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
53 ~KOPrefsDialog(); 53 ~KOPrefsDialog();
54 54
55 public slots: 55 public slots:
56 void showPrinterTab(); 56 void showPrinterTab();
57 57
58 /** Update controls for categories */ 58 /** Update controls for categories */
59 void updateCategories(); 59 void updateCategories();
60 protected slots: 60 protected slots:
61 void selectSoundFile(); 61 void selectSoundFile();
62 void setCategoryColor(); 62 void setCategoryColor();
63 void updateCategoryColor(); 63 void updateCategoryColor();
64 void toggleEmailSettings(bool); 64 void toggleEmailSettings(bool);
65 65
66 //additional emails 66 //additional emails
67 void addItem(); 67 void addItem();
68 void removeItem(); 68 void removeItem();
69 void updateItem(); 69 void updateItem();
70 void updateInput(); 70 void updateInput();
71 71
72 protected: 72 protected:
73 void usrReadConfig(); 73 void usrReadConfig();
74 void usrWriteConfig(); 74 void usrWriteConfig();
75 void setupGlobalTab(); 75 void setupGlobalTab();
76 76
77 void setupMainTab(); 77 void setupMainTab();
78 void setupTimeTab(); 78 void setupTimeTab();
79 void setupLocaleTab(); 79 void setupLocaleTab();
80 void setupLocaleDateTab(); 80 void setupLocaleDateTab();
81 void setupFontsTab(); 81 void setupFontsTab();
82 void setupColorsTab(); 82 void setupColorsTab();
83 void setupViewsTab(); 83 void setupViewsTab();
84 void setupDisplayTab(); 84 void setupDisplayTab();
85 void setupPrinterTab(); 85 void setupPrinterTab();
86 void setupGroupSchedulingTab(); 86 void setupGroupSchedulingTab();
87 void setupGroupAutomationTab(); 87 void setupGroupAutomationTab();
88 88
89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
90 90
91 91
92 private: 92 private:
93 QColor mCatDefaultColor;
93 KPrefsDialogWidBool *mEnableGroupScheduling; 94 KPrefsDialogWidBool *mEnableGroupScheduling;
94 KPrefsDialogWidBool *mEnableProjectView; 95 KPrefsDialogWidBool *mEnableProjectView;
95 96
96 QFrame *mPrinterTab; 97 QFrame *mPrinterTab;
97 98
98 QLineEdit *nameEdit; 99 QLineEdit *nameEdit;
99 QLineEdit *emailEdit; 100 QLineEdit *emailEdit;
100 101
101 QComboBox *timeCombo; 102 QComboBox *timeCombo;
102 QComboBox *tzCombo; 103 QComboBox *tzCombo;
103 104
104 // widgets holding preferences data 105 // widgets holding preferences data
105 QLineEdit *mNameEdit; 106 QLineEdit *mNameEdit;
106 QLineEdit *mEmailEdit; 107 QLineEdit *mEmailEdit;
107 QLabel *mNameLabel; 108 QLabel *mNameLabel;
108 QLabel *mEmailLabel; 109 QLabel *mEmailLabel;
109 QLineEdit *mAdditionalEdit; 110 QLineEdit *mAdditionalEdit;
110 QSpinBox *mAutoSaveIntervalSpin; 111 QSpinBox *mAutoSaveIntervalSpin;
111 QSpinBox *mPrioSpin; 112 QSpinBox *mPrioSpin;
112 // QListView *mAMails; 113 // QListView *mAMails;
113 QLineEdit *aEmailsEdit; 114 QLineEdit *aEmailsEdit;
114 115
115 QComboBox *mTimeZoneCombo; 116 QComboBox *mTimeZoneCombo;
116 QStringList tzonenames; 117 QStringList tzonenames;
117 QSpinBox *mStartTimeSpin; 118 QSpinBox *mStartTimeSpin;
118 QSpinBox *mDefaultDurationSpin; 119 QSpinBox *mDefaultDurationSpin;
119 QComboBox *mAlarmTimeCombo; 120 QComboBox *mAlarmTimeCombo;
120 121
121 QComboBox *mCategoryCombo; 122 QComboBox *mCategoryCombo;
122 KColorButton *mCategoryButton; 123 KColorButton *mCategoryButton;
123 QDict<QColor> mCategoryDict; 124 QDict<QColor> mCategoryDict;
124 125
125 QSlider *mHourSizeSlider; 126 QSlider *mHourSizeSlider;
126 127
127 QSpinBox *mNextXDaysSpin; 128 QSpinBox *mNextXDaysSpin;
128 QSpinBox *mWhatsNextSpin; 129 QSpinBox *mWhatsNextSpin;
129 130
130 QLineEdit * mRemoteIPEdit; 131 QLineEdit * mRemoteIPEdit;
131 QLineEdit * mRemoteUser; 132 QLineEdit * mRemoteUser;
132 QLineEdit * mRemotePassWd; 133 QLineEdit * mRemotePassWd;
133 QLineEdit * mRemoteFile; 134 QLineEdit * mRemoteFile;
134 QLineEdit * mLocalTempFile; 135 QLineEdit * mLocalTempFile;
135 QWidget* mSetupSyncAlgTab; 136 QWidget* mSetupSyncAlgTab;
136 QLineEdit * mUserDateFormatLong; 137 QLineEdit * mUserDateFormatLong;
137 QLineEdit * mUserDateFormatShort; 138 QLineEdit * mUserDateFormatShort;
138 139
139 QSpinBox *mTimezoneOffsetSpin; 140 QSpinBox *mTimezoneOffsetSpin;
140 QSpinBox *mDaylightsavingStart; 141 QSpinBox *mDaylightsavingStart;
141 QSpinBox *mDaylightsavingEnd; 142 QSpinBox *mDaylightsavingEnd;
142 KDateEdit* mStartDateSavingEdit; 143 KDateEdit* mStartDateSavingEdit;
143 KDateEdit* mEndDateSavingEdit; 144 KDateEdit* mEndDateSavingEdit;
144 QSpinBox * mAlarmPlayBeeps; 145 QSpinBox * mAlarmPlayBeeps;
145 QSpinBox * mAlarmSuspendTime; 146 QSpinBox * mAlarmSuspendTime;
146 QSpinBox * mAlarmSuspendCount; 147 QSpinBox * mAlarmSuspendCount;
147 QSpinBox * mAlarmBeepInterval; 148 QSpinBox * mAlarmBeepInterval;
148 149
149 QLineEdit * mDefaultAlarmFile; 150 QLineEdit * mDefaultAlarmFile;
150 int mSpacingHint; 151 int mSpacingHint;
151 int mMarginHint; 152 int mMarginHint;
152}; 153};
153 154
154#endif 155#endif