summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp7
-rw-r--r--korganizer/kodaymatrix.cpp6
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefs.h2
-rw-r--r--korganizer/koprefsdialog.cpp15
5 files changed, 29 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9928b48..14094bb 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2791,563 +2791,570 @@ void CalendarView::writeSettings()
2791 config->setGroup("WidgetLayout"); 2791 config->setGroup("WidgetLayout");
2792 QStringList list ;//= config->readListEntry("MainLayout"); 2792 QStringList list ;//= config->readListEntry("MainLayout");
2793 int x,y,w,h; 2793 int x,y,w,h;
2794 QWidget* wid; 2794 QWidget* wid;
2795 wid = topLevelWidget(); 2795 wid = topLevelWidget();
2796 x = wid->geometry().x(); 2796 x = wid->geometry().x();
2797 y = wid->geometry().y(); 2797 y = wid->geometry().y();
2798 w = wid->width(); 2798 w = wid->width();
2799 h = wid->height(); 2799 h = wid->height();
2800 list.clear(); 2800 list.clear();
2801 list << QString::number( x ); 2801 list << QString::number( x );
2802 list << QString::number( y ); 2802 list << QString::number( y );
2803 list << QString::number( w ); 2803 list << QString::number( w );
2804 list << QString::number( h ); 2804 list << QString::number( h );
2805 config->writeEntry("MainLayout",list ); 2805 config->writeEntry("MainLayout",list );
2806 2806
2807 wid = mEventEditor; 2807 wid = mEventEditor;
2808 x = wid->geometry().x(); 2808 x = wid->geometry().x();
2809 y = wid->geometry().y(); 2809 y = wid->geometry().y();
2810 w = wid->width(); 2810 w = wid->width();
2811 h = wid->height(); 2811 h = wid->height();
2812 list.clear(); 2812 list.clear();
2813 list << QString::number( x ); 2813 list << QString::number( x );
2814 list << QString::number( y ); 2814 list << QString::number( y );
2815 list << QString::number( w ); 2815 list << QString::number( w );
2816 list << QString::number( h ); 2816 list << QString::number( h );
2817 config->writeEntry("EditEventLayout",list ); 2817 config->writeEntry("EditEventLayout",list );
2818 2818
2819 wid = mTodoEditor; 2819 wid = mTodoEditor;
2820 x = wid->geometry().x(); 2820 x = wid->geometry().x();
2821 y = wid->geometry().y(); 2821 y = wid->geometry().y();
2822 w = wid->width(); 2822 w = wid->width();
2823 h = wid->height(); 2823 h = wid->height();
2824 list.clear(); 2824 list.clear();
2825 list << QString::number( x ); 2825 list << QString::number( x );
2826 list << QString::number( y ); 2826 list << QString::number( y );
2827 list << QString::number( w ); 2827 list << QString::number( w );
2828 list << QString::number( h ); 2828 list << QString::number( h );
2829 config->writeEntry("EditTodoLayout",list ); 2829 config->writeEntry("EditTodoLayout",list );
2830 wid = getEventViewerDialog(); 2830 wid = getEventViewerDialog();
2831 x = wid->geometry().x(); 2831 x = wid->geometry().x();
2832 y = wid->geometry().y(); 2832 y = wid->geometry().y();
2833 w = wid->width(); 2833 w = wid->width();
2834 h = wid->height(); 2834 h = wid->height();
2835 list.clear(); 2835 list.clear();
2836 list << QString::number( x ); 2836 list << QString::number( x );
2837 list << QString::number( y ); 2837 list << QString::number( y );
2838 list << QString::number( w ); 2838 list << QString::number( w );
2839 list << QString::number( h ); 2839 list << QString::number( h );
2840 config->writeEntry("ViewerLayout",list ); 2840 config->writeEntry("ViewerLayout",list );
2841 wid = mDialogManager->getSearchDialog(); 2841 wid = mDialogManager->getSearchDialog();
2842 if ( wid ) { 2842 if ( wid ) {
2843 x = wid->geometry().x(); 2843 x = wid->geometry().x();
2844 y = wid->geometry().y(); 2844 y = wid->geometry().y();
2845 w = wid->width(); 2845 w = wid->width();
2846 h = wid->height(); 2846 h = wid->height();
2847 list.clear(); 2847 list.clear();
2848 list << QString::number( x ); 2848 list << QString::number( x );
2849 list << QString::number( y ); 2849 list << QString::number( y );
2850 list << QString::number( w ); 2850 list << QString::number( w );
2851 list << QString::number( h ); 2851 list << QString::number( h );
2852 config->writeEntry("SearchLayout",list ); 2852 config->writeEntry("SearchLayout",list );
2853 } 2853 }
2854#endif 2854#endif
2855 2855
2856 2856
2857 config->sync(); 2857 config->sync();
2858} 2858}
2859 2859
2860void CalendarView::readFilterSettings(KConfig *config) 2860void CalendarView::readFilterSettings(KConfig *config)
2861{ 2861{
2862 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2862 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2863 2863
2864 mFilters.clear(); 2864 mFilters.clear();
2865 2865
2866 config->setGroup("General"); 2866 config->setGroup("General");
2867 QStringList filterList = config->readListEntry("CalendarFilters"); 2867 QStringList filterList = config->readListEntry("CalendarFilters");
2868 2868
2869 QStringList::ConstIterator it = filterList.begin(); 2869 QStringList::ConstIterator it = filterList.begin();
2870 QStringList::ConstIterator end = filterList.end(); 2870 QStringList::ConstIterator end = filterList.end();
2871 while(it != end) { 2871 while(it != end) {
2872 // kdDebug() << " filter: " << (*it) << endl; 2872 // kdDebug() << " filter: " << (*it) << endl;
2873 2873
2874 CalFilter *filter; 2874 CalFilter *filter;
2875 filter = new CalFilter(*it); 2875 filter = new CalFilter(*it);
2876 config->setGroup("Filter_" + (*it).utf8()); 2876 config->setGroup("Filter_" + (*it).utf8());
2877 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2877 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2878 filter->setCriteria(config->readNumEntry("Criteria",0)); 2878 filter->setCriteria(config->readNumEntry("Criteria",0));
2879 filter->setCategoryList(config->readListEntry("CategoryList")); 2879 filter->setCategoryList(config->readListEntry("CategoryList"));
2880 mFilters.append(filter); 2880 mFilters.append(filter);
2881 2881
2882 ++it; 2882 ++it;
2883 } 2883 }
2884 2884
2885 if (mFilters.count() == 0) { 2885 if (mFilters.count() == 0) {
2886 CalFilter *filter = new CalFilter(i18n("Default")); 2886 CalFilter *filter = new CalFilter(i18n("Default"));
2887 mFilters.append(filter); 2887 mFilters.append(filter);
2888 } 2888 }
2889 mFilterView->updateFilters(); 2889 mFilterView->updateFilters();
2890 config->setGroup("FilterView"); 2890 config->setGroup("FilterView");
2891 2891
2892 mFilterView->blockSignals(true); 2892 mFilterView->blockSignals(true);
2893 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2893 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2894 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2894 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2895 mFilterView->blockSignals(false); 2895 mFilterView->blockSignals(false);
2896 // We do it manually to avoid it being done twice by the above calls 2896 // We do it manually to avoid it being done twice by the above calls
2897 updateFilter(); 2897 updateFilter();
2898} 2898}
2899 2899
2900void CalendarView::writeFilterSettings(KConfig *config) 2900void CalendarView::writeFilterSettings(KConfig *config)
2901{ 2901{
2902 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2902 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2903 2903
2904 QStringList filterList; 2904 QStringList filterList;
2905 2905
2906 CalFilter *filter = mFilters.first(); 2906 CalFilter *filter = mFilters.first();
2907 while(filter) { 2907 while(filter) {
2908 // kdDebug() << " fn: " << filter->name() << endl; 2908 // kdDebug() << " fn: " << filter->name() << endl;
2909 filterList << filter->name(); 2909 filterList << filter->name();
2910 config->setGroup("Filter_" + filter->name().utf8()); 2910 config->setGroup("Filter_" + filter->name().utf8());
2911 config->writeEntry("Criteria",filter->criteria()); 2911 config->writeEntry("Criteria",filter->criteria());
2912 config->writeEntry("CategoryList",filter->categoryList()); 2912 config->writeEntry("CategoryList",filter->categoryList());
2913 filter = mFilters.next(); 2913 filter = mFilters.next();
2914 } 2914 }
2915 config->setGroup("General"); 2915 config->setGroup("General");
2916 config->writeEntry("CalendarFilters",filterList); 2916 config->writeEntry("CalendarFilters",filterList);
2917 2917
2918 config->setGroup("FilterView"); 2918 config->setGroup("FilterView");
2919 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2919 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2920 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2920 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2921} 2921}
2922 2922
2923 2923
2924void CalendarView::goToday() 2924void CalendarView::goToday()
2925{ 2925{
2926 if ( mViewManager->currentView()->isMonthView() ) 2926 if ( mViewManager->currentView()->isMonthView() )
2927 mNavigator->selectTodayMonth(); 2927 mNavigator->selectTodayMonth();
2928 else 2928 else
2929 mNavigator->selectToday(); 2929 mNavigator->selectToday();
2930} 2930}
2931 2931
2932void CalendarView::goNext() 2932void CalendarView::goNext()
2933{ 2933{
2934 mNavigator->selectNext(); 2934 mNavigator->selectNext();
2935} 2935}
2936 2936
2937void CalendarView::goPrevious() 2937void CalendarView::goPrevious()
2938{ 2938{
2939 mNavigator->selectPrevious(); 2939 mNavigator->selectPrevious();
2940} 2940}
2941void CalendarView::goNextMonth() 2941void CalendarView::goNextMonth()
2942{ 2942{
2943 mNavigator->selectNextMonth(); 2943 mNavigator->selectNextMonth();
2944} 2944}
2945 2945
2946void CalendarView::goPreviousMonth() 2946void CalendarView::goPreviousMonth()
2947{ 2947{
2948 mNavigator->selectPreviousMonth(); 2948 mNavigator->selectPreviousMonth();
2949} 2949}
2950 2950
2951void CalendarView::updateConfig() 2951void CalendarView::updateConfig()
2952{ 2952{
2953 if ( KOPrefs::instance()->mUseAppColors ) 2953 if ( KOPrefs::instance()->mUseAppColors )
2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2955 emit configChanged(); 2955 emit configChanged();
2956 mTodoList->updateConfig(); 2956 mTodoList->updateConfig();
2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2959 // To make the "fill window" configurations work 2959 // To make the "fill window" configurations work
2960 //mViewManager->raiseCurrentView(); 2960 //mViewManager->raiseCurrentView();
2961} 2961}
2962 2962
2963 2963
2964void CalendarView::eventChanged(Event *event) 2964void CalendarView::eventChanged(Event *event)
2965{ 2965{
2966 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2966 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2967 //updateUnmanagedViews(); 2967 //updateUnmanagedViews();
2968} 2968}
2969 2969
2970void CalendarView::eventAdded(Event *event) 2970void CalendarView::eventAdded(Event *event)
2971{ 2971{
2972 changeEventDisplay(event,KOGlobals::EVENTADDED); 2972 changeEventDisplay(event,KOGlobals::EVENTADDED);
2973} 2973}
2974 2974
2975void CalendarView::eventToBeDeleted(Event *) 2975void CalendarView::eventToBeDeleted(Event *)
2976{ 2976{
2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2978} 2978}
2979 2979
2980void CalendarView::eventDeleted() 2980void CalendarView::eventDeleted()
2981{ 2981{
2982 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2982 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2983} 2983}
2984void CalendarView::changeTodoDisplay(Todo *which, int action) 2984void CalendarView::changeTodoDisplay(Todo *which, int action)
2985{ 2985{
2986 changeIncidenceDisplay((Incidence *)which, action); 2986 changeIncidenceDisplay((Incidence *)which, action);
2987 mDateNavigator->updateView(); //LR 2987 mDateNavigator->updateView(); //LR
2988 //mDialogManager->updateSearchDialog(); 2988 //mDialogManager->updateSearchDialog();
2989 2989
2990 if (which) { 2990 if (which) {
2991 mViewManager->updateWNview(); 2991 mViewManager->updateWNview();
2992 //mTodoList->updateView(); 2992 //mTodoList->updateView();
2993 } 2993 }
2994 2994
2995} 2995}
2996 2996
2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2998{ 2998{
2999 updateUnmanagedViews(); 2999 updateUnmanagedViews();
3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
3001 if ( action == KOGlobals::EVENTDELETED ) { //delete 3001 if ( action == KOGlobals::EVENTDELETED ) { //delete
3002 mCalendar->checkAlarmForIncidence( 0, true ); 3002 mCalendar->checkAlarmForIncidence( 0, true );
3003 if ( mEventViewerDialog ) 3003 if ( mEventViewerDialog )
3004 mEventViewerDialog->hide(); 3004 mEventViewerDialog->hide();
3005 } 3005 }
3006 else 3006 else
3007 mCalendar->checkAlarmForIncidence( which , false ); 3007 mCalendar->checkAlarmForIncidence( which , false );
3008} 3008}
3009 3009
3010// most of the changeEventDisplays() right now just call the view's 3010// most of the changeEventDisplays() right now just call the view's
3011// total update mode, but they SHOULD be recoded to be more refresh-efficient. 3011// total update mode, but they SHOULD be recoded to be more refresh-efficient.
3012void CalendarView::changeEventDisplay(Event *which, int action) 3012void CalendarView::changeEventDisplay(Event *which, int action)
3013{ 3013{
3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
3015 changeIncidenceDisplay((Incidence *)which, action); 3015 changeIncidenceDisplay((Incidence *)which, action);
3016 static bool clearallviews = false; 3016 static bool clearallviews = false;
3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3018 if ( clearallviews ) { 3018 if ( clearallviews ) {
3019 clearAllViews(); 3019 clearAllViews();
3020 clearallviews = false; 3020 clearallviews = false;
3021 } 3021 }
3022 return; 3022 return;
3023 } 3023 }
3024 clearallviews = true; 3024 clearallviews = true;
3025 mDateNavigator->updateView(); 3025 mDateNavigator->updateView();
3026 //mDialogManager->updateSearchDialog(); 3026 //mDialogManager->updateSearchDialog();
3027 if (which) { 3027 if (which) {
3028 // If there is an event view visible update the display 3028 // If there is an event view visible update the display
3029 mViewManager->currentView()->changeEventDisplay(which,action); 3029 mViewManager->currentView()->changeEventDisplay(which,action);
3030 // TODO: check, if update needed 3030 // TODO: check, if update needed
3031 // if (which->getTodoStatus()) { 3031 // if (which->getTodoStatus()) {
3032 mTodoList->updateView(); 3032 mTodoList->updateView();
3033 if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) { 3033 if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) {
3034 mConflictingEvent = which ; 3034 mConflictingEvent = which ;
3035 int time = 1000; 3035 int time = 1000;
3036#ifdef DESKTOP_VERSION 3036#ifdef DESKTOP_VERSION
3037 time = 500; 3037 time = 500;
3038#endif 3038#endif
3039 bool checkC = false; 3039 bool checkC = false;
3040 if ( mConflictingEvent->doesFloat() ) { 3040 if ( mConflictingEvent->doesFloat() ) {
3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay 3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay
3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3043 } else { 3043 } else {
3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay 3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay
3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD; 3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD;
3046 } 3046 }
3047 if ( !KOPrefs::instance()->mIncludeFree && mConflictingEvent->transparency() == KCal::Event::Transparent )
3048 checkC = false;
3047 if ( checkC ) 3049 if ( checkC )
3048 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); 3050 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
3049 } 3051 }
3050 // } 3052 // }
3051 } else { 3053 } else {
3052 mViewManager->currentView()->updateView(); 3054 mViewManager->currentView()->updateView();
3053 } 3055 }
3054} 3056}
3055void CalendarView::checkConflictForEvent() 3057void CalendarView::checkConflictForEvent()
3056{ 3058{
3057 3059
3058 if (!KOPrefs::instance()->mConfirm) 3060 if (!KOPrefs::instance()->mConfirm)
3059 return; 3061 return;
3060 if ( ! mConflictingEvent ) return; 3062 if ( ! mConflictingEvent ) return;
3061 Event * conflictingEvent = mConflictingEvent; 3063 Event * conflictingEvent = mConflictingEvent;
3062 mConflictingEvent = 0; 3064 mConflictingEvent = 0;
3063 QDateTime current = QDateTime::currentDateTime(); 3065 QDateTime current = QDateTime::currentDateTime();
3064 if ( ! conflictingEvent->matchTime( &current, 0 ) ) { 3066 if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
3065 return; 3067 return;
3066 } 3068 }
3067 CalFilter *filterIN = 0; 3069 CalFilter *filterIN = 0;
3068 CalFilter *filterALL = 0; 3070 CalFilter *filterALL = 0;
3069 CalFilter *filter = mFilters.first(); 3071 CalFilter *filter = mFilters.first();
3070 while(filter) { 3072 while(filter) {
3071 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem) 3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
3072 filterIN = filter; 3074 filterIN = filter;
3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem ) 3075 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
3074 filterALL = filter; 3076 filterALL = filter;
3075 filter = mFilters.next(); 3077 filter = mFilters.next();
3076 } 3078 }
3077 if ( filterIN ) { 3079 if ( filterIN ) {
3078 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { 3080 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
3079 return; 3081 return;
3080 } 3082 }
3081 } 3083 }
3082 QPtrList<Event> testlist = mCalendar->events(); 3084 QPtrList<Event> testlist = mCalendar->events();
3083 Event * test = testlist.first(); 3085 Event * test = testlist.first();
3084 QDateTime conflict; 3086 QDateTime conflict;
3085 QDateTime retVal; 3087 QDateTime retVal;
3086 bool found = false; 3088 bool found = false;
3087 Event * cE = 0; 3089 Event * cE = 0;
3088 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; 3090 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
3089 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3091 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3090 if ( !conflictingEvent->doesFloat() ) { 3092 if ( !conflictingEvent->doesFloat() ) {
3091 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; 3093 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
3092 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; 3094 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
3093 } 3095 }
3094 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 3096 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
3095 while ( test ) { 3097 while ( test ) {
3096 qApp->processEvents(); 3098 qApp->processEvents();
3097 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); 3099 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
3100
3101 if ( !skip ) {
3102 if ( !KOPrefs::instance()->mIncludeFree && test->transparency() == KCal::Event::Transparent )
3103 skip = true;
3104 }
3098 if ( !skip ) { 3105 if ( !skip ) {
3099 if ( filterALL ) { 3106 if ( filterALL ) {
3100 if ( !filterALL->filterCalendarItem( test ) ) { 3107 if ( !filterALL->filterCalendarItem( test ) ) {
3101 skip = true; 3108 skip = true;
3102 } 3109 }
3103 } 3110 }
3104 if ( !skip ) { 3111 if ( !skip ) {
3105 if ( found ) 3112 if ( found )
3106 skip = !test->matchTime( &current, &conflict ); 3113 skip = !test->matchTime( &current, &conflict );
3107 else 3114 else
3108 skip = !test->matchTime( &current, 0 ); 3115 skip = !test->matchTime( &current, 0 );
3109 if ( !skip ) { 3116 if ( !skip ) {
3110 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) { 3117 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
3111 if ( ! found ) { 3118 if ( ! found ) {
3112 conflict = retVal; 3119 conflict = retVal;
3113 cE = test; 3120 cE = test;
3114 } else { 3121 } else {
3115 if ( retVal < conflict ) { 3122 if ( retVal < conflict ) {
3116 conflict = retVal; 3123 conflict = retVal;
3117 cE = test; 3124 cE = test;
3118 } 3125 }
3119 } 3126 }
3120 found = true; 3127 found = true;
3121 } 3128 }
3122 } 3129 }
3123 } 3130 }
3124 } 3131 }
3125 test = testlist.next(); 3132 test = testlist.next();
3126 } 3133 }
3127 topLevelWidget()->setCaption( i18n("KO/Pi") ); 3134 topLevelWidget()->setCaption( i18n("KO/Pi") );
3128 if ( found ) { 3135 if ( found ) {
3129 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; 3136 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;
3130 qApp->processEvents(); 3137 qApp->processEvents();
3131 int km = KMessageBox::warningContinueCancel(this,mess, 3138 int km = KMessageBox::warningContinueCancel(this,mess,
3132 i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!")); 3139 i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!"));
3133 if ( km != KMessageBox::Continue ) { 3140 if ( km != KMessageBox::Continue ) {
3134 return; 3141 return;
3135 } 3142 }
3136 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 3143 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
3137 mViewManager->showDayView(); 3144 mViewManager->showDayView();
3138 mNavigator->slotDaySelect( conflict.date() ); 3145 mNavigator->slotDaySelect( conflict.date() );
3139 int hour = conflict.time().hour(); 3146 int hour = conflict.time().hour();
3140 mViewManager->agendaView()->setStartHour( hour ); 3147 mViewManager->agendaView()->setStartHour( hour );
3141 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); 3148 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
3142 } else 3149 } else
3143 topLevelWidget()->setCaption( i18n("No conflict found") ); 3150 topLevelWidget()->setCaption( i18n("No conflict found") );
3144 return; 3151 return;
3145 3152
3146} 3153}
3147 3154
3148void CalendarView::updateTodoViews() 3155void CalendarView::updateTodoViews()
3149{ 3156{
3150 mTodoList->updateView(); 3157 mTodoList->updateView();
3151 mViewManager->currentView()->updateView(); 3158 mViewManager->currentView()->updateView();
3152 3159
3153} 3160}
3154 3161
3155 3162
3156 3163
3157void CalendarView::clearAllViews() 3164void CalendarView::clearAllViews()
3158{ 3165{
3159 mTodoList->clearList(); 3166 mTodoList->clearList();
3160 mViewManager->clearAllViews(); 3167 mViewManager->clearAllViews();
3161 SearchDialog * sd = mDialogManager->getSearchDialog(); 3168 SearchDialog * sd = mDialogManager->getSearchDialog();
3162 if ( sd ) { 3169 if ( sd ) {
3163 KOListView* kol = sd->listview(); 3170 KOListView* kol = sd->listview();
3164 if ( kol ) 3171 if ( kol )
3165 kol->clearList(); 3172 kol->clearList();
3166 } 3173 }
3167} 3174}
3168void CalendarView::updateView() 3175void CalendarView::updateView()
3169{ 3176{
3170 static bool clearallviews = false; 3177 static bool clearallviews = false;
3171 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3178 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3172 if ( clearallviews ) { 3179 if ( clearallviews ) {
3173 clearAllViews(); 3180 clearAllViews();
3174 clearallviews = false; 3181 clearallviews = false;
3175 } 3182 }
3176 return; 3183 return;
3177 } 3184 }
3178 clearallviews = true; 3185 clearallviews = true;
3179 DateList tmpList = mNavigator->selectedDates(); 3186 DateList tmpList = mNavigator->selectedDates();
3180 3187
3181 if ( KOPrefs::instance()->mHideNonStartedTodos ) 3188 if ( KOPrefs::instance()->mHideNonStartedTodos )
3182 mTodoList->updateView(); 3189 mTodoList->updateView();
3183 // We assume that the navigator only selects consecutive days. 3190 // We assume that the navigator only selects consecutive days.
3184 updateView( tmpList.first(), tmpList.last() ); 3191 updateView( tmpList.first(), tmpList.last() );
3185} 3192}
3186 3193
3187void CalendarView::updateUnmanagedViews() 3194void CalendarView::updateUnmanagedViews()
3188{ 3195{
3189 mDateNavigator->updateDayMatrix(); 3196 mDateNavigator->updateDayMatrix();
3190} 3197}
3191 3198
3192int CalendarView::msgItemDelete(const QString name) 3199int CalendarView::msgItemDelete(const QString name)
3193{ 3200{
3194 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 3201 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
3195 i18n("This item will be\npermanently deleted."), 3202 i18n("This item will be\npermanently deleted."),
3196 i18n("KO/Pi Confirmation"),i18n("Delete")); 3203 i18n("KO/Pi Confirmation"),i18n("Delete"));
3197} 3204}
3198 3205
3199 3206
3200void CalendarView::edit_cut() 3207void CalendarView::edit_cut()
3201{ 3208{
3202 Event *anEvent=0; 3209 Event *anEvent=0;
3203 3210
3204 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3211 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3205 3212
3206 if (mViewManager->currentView()->isEventView()) { 3213 if (mViewManager->currentView()->isEventView()) {
3207 if ( incidence && incidence->typeID() == eventID ) { 3214 if ( incidence && incidence->typeID() == eventID ) {
3208 anEvent = static_cast<Event *>(incidence); 3215 anEvent = static_cast<Event *>(incidence);
3209 } 3216 }
3210 } 3217 }
3211 3218
3212 if (!anEvent) { 3219 if (!anEvent) {
3213 KNotifyClient::beep(); 3220 KNotifyClient::beep();
3214 return; 3221 return;
3215 } 3222 }
3216 DndFactory factory( mCalendar ); 3223 DndFactory factory( mCalendar );
3217 factory.cutIncidence(anEvent); 3224 factory.cutIncidence(anEvent);
3218 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3225 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3219} 3226}
3220 3227
3221void CalendarView::edit_copy() 3228void CalendarView::edit_copy()
3222{ 3229{
3223 Event *anEvent=0; 3230 Event *anEvent=0;
3224 3231
3225 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3232 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3226 3233
3227 if (mViewManager->currentView()->isEventView()) { 3234 if (mViewManager->currentView()->isEventView()) {
3228 if ( incidence && incidence->typeID() == eventID ) { 3235 if ( incidence && incidence->typeID() == eventID ) {
3229 anEvent = static_cast<Event *>(incidence); 3236 anEvent = static_cast<Event *>(incidence);
3230 } 3237 }
3231 } 3238 }
3232 3239
3233 if (!anEvent) { 3240 if (!anEvent) {
3234 KNotifyClient::beep(); 3241 KNotifyClient::beep();
3235 return; 3242 return;
3236 } 3243 }
3237 DndFactory factory( mCalendar ); 3244 DndFactory factory( mCalendar );
3238 factory.copyIncidence(anEvent); 3245 factory.copyIncidence(anEvent);
3239} 3246}
3240 3247
3241void CalendarView::edit_paste() 3248void CalendarView::edit_paste()
3242{ 3249{
3243 QDate date = mNavigator->selectedDates().first(); 3250 QDate date = mNavigator->selectedDates().first();
3244 3251
3245 DndFactory factory( mCalendar ); 3252 DndFactory factory( mCalendar );
3246 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 3253 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
3247 3254
3248 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 3255 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
3249} 3256}
3250void CalendarView::edit_global_options() 3257void CalendarView::edit_global_options()
3251{ 3258{
3252 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 3259 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
3253 emit save(); 3260 emit save();
3254 emit saveStopTimer(); 3261 emit saveStopTimer();
3255 mDialogManager->showGlobalOptionsDialog(); 3262 mDialogManager->showGlobalOptionsDialog();
3256 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 3263 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
3257 emit saveStopTimer(); 3264 emit saveStopTimer();
3258 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), 3265 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
3259 i18n("Timezone settings"),i18n("Reload"))) { 3266 i18n("Timezone settings"),i18n("Reload"))) {
3260 qDebug("KO: TZ reload cancelled "); 3267 qDebug("KO: TZ reload cancelled ");
3261 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 3268 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
3262 return; 3269 return;
3263 } 3270 }
3264 qDebug("KO: Timezone change "); 3271 qDebug("KO: Timezone change ");
3265 loadCalendars(); 3272 loadCalendars();
3266 setModified(true); 3273 setModified(true);
3267 } 3274 }
3268 else 3275 else
3269 qDebug("KO: No tz change "); 3276 qDebug("KO: No tz change ");
3270} 3277}
3271void CalendarView::edit_options() 3278void CalendarView::edit_options()
3272{ 3279{
3273 mDialogManager->showOptionsDialog(); 3280 mDialogManager->showOptionsDialog();
3274} 3281}
3275 3282
3276 3283
3277void CalendarView::slotSelectPickerDate( QDate d) 3284void CalendarView::slotSelectPickerDate( QDate d)
3278{ 3285{
3279 mDateFrame->hide(); 3286 mDateFrame->hide();
3280 if ( mDatePickerMode == 1 ) { 3287 if ( mDatePickerMode == 1 ) {
3281 mNavigator->slotDaySelect( d ); 3288 mNavigator->slotDaySelect( d );
3282 } else if ( mDatePickerMode == 2 ) { 3289 } else if ( mDatePickerMode == 2 ) {
3283 if ( mMoveIncidence->typeID() == todoID ) { 3290 if ( mMoveIncidence->typeID() == todoID ) {
3284 Todo * to = (Todo *) mMoveIncidence; 3291 Todo * to = (Todo *) mMoveIncidence;
3285 QTime tim; 3292 QTime tim;
3286 int len = 0; 3293 int len = 0;
3287 if ( to->hasStartDate() && to->hasDueDate() ) 3294 if ( to->hasStartDate() && to->hasDueDate() )
3288 len = to->dtStart().secsTo( to->dtDue()); 3295 len = to->dtStart().secsTo( to->dtDue());
3289 if ( to->hasDueDate() ) 3296 if ( to->hasDueDate() )
3290 tim = to->dtDue().time(); 3297 tim = to->dtDue().time();
3291 else { 3298 else {
3292 tim = QTime ( 0,0,0 ); 3299 tim = QTime ( 0,0,0 );
3293 to->setFloats( true ); 3300 to->setFloats( true );
3294 to->setHasDueDate( true ); 3301 to->setHasDueDate( true );
3295 } 3302 }
3296 QDateTime dt ( d,tim ); 3303 QDateTime dt ( d,tim );
3297 to->setDtDue( dt ); 3304 to->setDtDue( dt );
3298 3305
3299 if ( to->hasStartDate() ) { 3306 if ( to->hasStartDate() ) {
3300 if ( len>0 ) 3307 if ( len>0 )
3301 to->setDtStart(to->dtDue().addSecs( -len )); 3308 to->setDtStart(to->dtDue().addSecs( -len ));
3302 else 3309 else
3303 if (to->dtStart() > to->dtDue() ) 3310 if (to->dtStart() > to->dtDue() )
3304 to->setDtStart(to->dtDue().addDays( -3 )); 3311 to->setDtStart(to->dtDue().addDays( -3 ));
3305 } 3312 }
3306 3313
3307 todoChanged( to ); 3314 todoChanged( to );
3308 } else if ( mMoveIncidence->typeID() == eventID ) { 3315 } else if ( mMoveIncidence->typeID() == eventID ) {
3309 if ( mMoveIncidence->doesRecur() ) { 3316 if ( mMoveIncidence->doesRecur() ) {
3310#if 0 3317#if 0
3311 // PENDING implement this 3318 // PENDING implement this
3312 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 3319 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
3313 mCalendar()->addIncidence( newInc ); 3320 mCalendar()->addIncidence( newInc );
3314 if ( mMoveIncidence->typeID() == todoID ) 3321 if ( mMoveIncidence->typeID() == todoID )
3315 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 3322 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
3316 else 3323 else
3317 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 3324 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
3318 mMoveIncidence = newInc; 3325 mMoveIncidence = newInc;
3319 3326
3320#endif 3327#endif
3321 } 3328 }
3322 QTime tim = mMoveIncidence->dtStart().time(); 3329 QTime tim = mMoveIncidence->dtStart().time();
3323 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 3330 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
3324 QDateTime dt ( d,tim ); 3331 QDateTime dt ( d,tim );
3325 mMoveIncidence->setDtStart( dt ); 3332 mMoveIncidence->setDtStart( dt );
3326 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 3333 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
3327 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 3334 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
3328 } else if ( mMoveIncidence->typeID() == journalID ) { 3335 } else if ( mMoveIncidence->typeID() == journalID ) {
3329 QTime tim = mMoveIncidence->dtStart().time(); 3336 QTime tim = mMoveIncidence->dtStart().time();
3330 QDateTime dt ( d,tim ); 3337 QDateTime dt ( d,tim );
3331 mMoveIncidence->setDtStart( dt ); 3338 mMoveIncidence->setDtStart( dt );
3332 updateView(); 3339 updateView();
3333 } 3340 }
3334 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 3341 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
3335 } 3342 }
3336} 3343}
3337 3344
3338void CalendarView::removeCategories() 3345void CalendarView::removeCategories()
3339{ 3346{
3340 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3347 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3341 QStringList catList = KOPrefs::instance()->mCustomCategories; 3348 QStringList catList = KOPrefs::instance()->mCustomCategories;
3342 QStringList catIncList; 3349 QStringList catIncList;
3343 QStringList newCatList; 3350 QStringList newCatList;
3344 Incidence* inc = incList.first(); 3351 Incidence* inc = incList.first();
3345 uint i; 3352 uint i;
3346 while ( inc ) { 3353 while ( inc ) {
3347 newCatList.clear(); 3354 newCatList.clear();
3348 catIncList = inc->categories() ; 3355 catIncList = inc->categories() ;
3349 for( i = 0; i< catIncList.count(); ++i ) { 3356 for( i = 0; i< catIncList.count(); ++i ) {
3350 if ( catList.contains (catIncList[i])) 3357 if ( catList.contains (catIncList[i]))
3351 newCatList.append( catIncList[i] ); 3358 newCatList.append( catIncList[i] );
3352 } 3359 }
3353 newCatList.sort(); 3360 newCatList.sort();
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 057df0d..7076e05 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -205,738 +205,744 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
205 } 205 }
206 mToolTip.sort(); 206 mToolTip.sort();
207 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 207 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
208 QPtrList<Todo> todolist = mCalendar->todos(mDate); 208 QPtrList<Todo> todolist = mCalendar->todos(mDate);
209 Todo *todo; 209 Todo *todo;
210 for(todo=todolist.first();todo != 0;todo=todolist.next()) { 210 for(todo=todolist.first();todo != 0;todo=todolist.next()) {
211 QString mToolTipText; 211 QString mToolTipText;
212 if ( !todo->doesFloat() ) 212 if ( !todo->doesFloat() )
213 mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; 213 mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" ";
214 mToolTipText += todo->summary(); 214 mToolTipText += todo->summary();
215 if ( !todo->location().isEmpty() ) 215 if ( !todo->location().isEmpty() )
216 mToolTipText += " (" + todo->location() + ")"; 216 mToolTipText += " (" + todo->location() + ")";
217 mToolTipText = deTag( mToolTipText); 217 mToolTipText = deTag( mToolTipText);
218 mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; 218 mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText;
219 mToolTip.append( mToolTipText ); 219 mToolTip.append( mToolTipText );
220 } 220 }
221 } 221 }
222 if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 222 if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
223 QPtrList<Journal> j_list = mCalendar->journals4Date( mDate ); 223 QPtrList<Journal> j_list = mCalendar->journals4Date( mDate );
224 Journal *j = j_list.first(); 224 Journal *j = j_list.first();
225 while ( j ) { 225 while ( j ) {
226 QString mToolTipText; 226 QString mToolTipText;
227 if ( !j->summary().isEmpty() ) { 227 if ( !j->summary().isEmpty() ) {
228 mToolTipText = j->summary().left(30); 228 mToolTipText = j->summary().left(30);
229 if ( j->summary().length() > 30 ) 229 if ( j->summary().length() > 30 )
230 mToolTipText += " ..."; 230 mToolTipText += " ...";
231 } else { 231 } else {
232 mToolTipText = j->description().left(25); 232 mToolTipText = j->description().left(25);
233 if ( j->description().length() > 25 ) 233 if ( j->description().length() > 25 )
234 mToolTipText += " ..."; 234 mToolTipText += " ...";
235 mToolTipText = deTag( mToolTipText); 235 mToolTipText = deTag( mToolTipText);
236 } 236 }
237 mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText; 237 mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText;
238 mToolTip.append( mToolTipText ); 238 mToolTip.append( mToolTipText );
239 j = j_list.next(); 239 j = j_list.next();
240 } 240 }
241 } 241 }
242 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); 242 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
243} 243}
244 244
245 245
246QString KODayMatrix::deTag( QString mToolTipText ) 246QString KODayMatrix::deTag( QString mToolTipText )
247{ 247{
248 248
249#if QT_VERSION >= 0x030000 249#if QT_VERSION >= 0x030000
250 mToolTipText.replace( '<' , "&lt;" ); 250 mToolTipText.replace( '<' , "&lt;" );
251 mToolTipText.replace( '>' , "&gt;" ); 251 mToolTipText.replace( '>' , "&gt;" );
252#else 252#else
253 if ( mToolTipText.find ('<') >= 0 ) { 253 if ( mToolTipText.find ('<') >= 0 ) {
254 mToolTipText.replace( QRegExp("<") , "&lt;" ); 254 mToolTipText.replace( QRegExp("<") , "&lt;" );
255 } 255 }
256 if ( mToolTipText.find ('>') >= 0 ) { 256 if ( mToolTipText.find ('>') >= 0 ) {
257 mToolTipText.replace( QRegExp(">") , "&gt;" ); 257 mToolTipText.replace( QRegExp(">") , "&gt;" );
258 } 258 }
259#endif 259#endif
260 return mToolTipText; 260 return mToolTipText;
261} 261}
262void KODayMatrix::setCalendar( Calendar *cal ) 262void KODayMatrix::setCalendar( Calendar *cal )
263{ 263{
264 mCalendar = cal; 264 mCalendar = cal;
265 265
266 setAcceptDrops( mCalendar ); 266 setAcceptDrops( mCalendar );
267 267
268 updateEvents(); 268 updateEvents();
269} 269}
270 270
271QColor KODayMatrix::getShadedColor(QColor color) 271QColor KODayMatrix::getShadedColor(QColor color)
272{ 272{
273 QColor shaded; 273 QColor shaded;
274 int h=0; 274 int h=0;
275 int s=0; 275 int s=0;
276 int v=0; 276 int v=0;
277 color.hsv(&h,&s,&v); 277 color.hsv(&h,&s,&v);
278 s = s/4; 278 s = s/4;
279 v = 192+v/4; 279 v = 192+v/4;
280 shaded.setHsv(h,s,v); 280 shaded.setHsv(h,s,v);
281 281
282 return shaded; 282 return shaded;
283} 283}
284 284
285KODayMatrix::~KODayMatrix() 285KODayMatrix::~KODayMatrix()
286{ 286{
287#if QT_VERSION >= 0x030000 287#if QT_VERSION >= 0x030000
288 288
289#else 289#else
290 delete mKODaymatrixWhatsThis; 290 delete mKODaymatrixWhatsThis;
291#endif 291#endif
292 292
293 // delete mKODaymatrixWhatsThis; 293 // delete mKODaymatrixWhatsThis;
294 delete [] days; 294 delete [] days;
295 delete [] daylbls; 295 delete [] daylbls;
296 //delete [] events; 296 //delete [] events;
297 delete mToolTip; 297 delete mToolTip;
298} 298}
299 299
300/* 300/*
301void KODayMatrix::setStartDate(QDate start) 301void KODayMatrix::setStartDate(QDate start)
302{ 302{
303 updateView(start); 303 updateView(start);
304} 304}
305*/ 305*/
306 306
307void KODayMatrix::addSelectedDaysTo(DateList& selDays) 307void KODayMatrix::addSelectedDaysTo(DateList& selDays)
308{ 308{
309 309
310 if (mSelStart == NOSELECTION) { 310 if (mSelStart == NOSELECTION) {
311 return; 311 return;
312 } 312 }
313 313
314 //cope with selection being out of matrix limits at top (< 0) 314 //cope with selection being out of matrix limits at top (< 0)
315 int i0 = mSelStart; 315 int i0 = mSelStart;
316 if (i0 < 0) { 316 if (i0 < 0) {
317 for (int i = i0; i < 0; i++) { 317 for (int i = i0; i < 0; i++) {
318 selDays.append(days[0].addDays(i)); 318 selDays.append(days[0].addDays(i));
319 } 319 }
320 i0 = 0; 320 i0 = 0;
321 } 321 }
322 322
323 //cope with selection being out of matrix limits at bottom (> NUMDAYS-1) 323 //cope with selection being out of matrix limits at bottom (> NUMDAYS-1)
324 if (mSelEnd > NUMDAYS-1) { 324 if (mSelEnd > NUMDAYS-1) {
325 for (int i = i0; i <= NUMDAYS-1; i++) { 325 for (int i = i0; i <= NUMDAYS-1; i++) {
326 selDays.append(days[i]); 326 selDays.append(days[i]);
327 } 327 }
328 for (int i = NUMDAYS; i < mSelEnd; i++) { 328 for (int i = NUMDAYS; i < mSelEnd; i++) {
329 selDays.append(days[0].addDays(i)); 329 selDays.append(days[0].addDays(i));
330 } 330 }
331 331
332 // apply normal routine to selection being entirely within matrix limits 332 // apply normal routine to selection being entirely within matrix limits
333 } else { 333 } else {
334 for (int i = i0; i <= mSelEnd; i++) { 334 for (int i = i0; i <= mSelEnd; i++) {
335 selDays.append(days[i]); 335 selDays.append(days[i]);
336 } 336 }
337 } 337 }
338} 338}
339 339
340bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) 340bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
341{ 341{
342 mRedrawNeeded = true; 342 mRedrawNeeded = true;
343 bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION ); 343 bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION );
344 mSelStart = startdate.daysTo(start); 344 mSelStart = startdate.daysTo(start);
345 if ( mSelStart < 0 ) 345 if ( mSelStart < 0 )
346 mSelStart = 0; 346 mSelStart = 0;
347 mSelEnd = startdate.daysTo(end); 347 mSelEnd = startdate.daysTo(end);
348 if ( mSelEnd > NUMDAYS-1 ) 348 if ( mSelEnd > NUMDAYS-1 )
349 mSelEnd = NUMDAYS-1; 349 mSelEnd = NUMDAYS-1;
350 if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) { 350 if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) {
351 clearSelection(); 351 clearSelection();
352 if ( noSel ) 352 if ( noSel )
353 return false; 353 return false;
354 } 354 }
355 355
356 return true; 356 return true;
357} 357}
358void KODayMatrix::clearSelection() 358void KODayMatrix::clearSelection()
359{ 359{
360 mSelEnd = mSelStart = NOSELECTION; 360 mSelEnd = mSelStart = NOSELECTION;
361} 361}
362 362
363 363
364void KODayMatrix::recalculateToday() 364void KODayMatrix::recalculateToday()
365{ 365{
366 today = -1; 366 today = -1;
367 for (int i=0; i<NUMDAYS; i++) { 367 for (int i=0; i<NUMDAYS; i++) {
368 //events[i] = 0; 368 //events[i] = 0;
369 days[i] = startdate.addDays(i); 369 days[i] = startdate.addDays(i);
370 daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); 370 daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] ));
371 371
372 // if today is in the currently displayed month, hilight today 372 // if today is in the currently displayed month, hilight today
373 if (days[i].year() == QDate::currentDate().year() && 373 if (days[i].year() == QDate::currentDate().year() &&
374 days[i].month() == QDate::currentDate().month() && 374 days[i].month() == QDate::currentDate().month() &&
375 days[i].day() == QDate::currentDate().day()) { 375 days[i].day() == QDate::currentDate().day()) {
376 today = i; 376 today = i;
377 } 377 }
378 } 378 }
379 // qDebug(QString("Today is visible at %1.").arg(today)); 379 // qDebug(QString("Today is visible at %1.").arg(today));
380} 380}
381 381
382void KODayMatrix::updateView() 382void KODayMatrix::updateView()
383{ 383{
384 updateView(startdate); 384 updateView(startdate);
385} 385}
386void KODayMatrix::repaintViewTimed() 386void KODayMatrix::repaintViewTimed()
387{ 387{
388 mRedrawNeeded = true; 388 mRedrawNeeded = true;
389 // bDays.fill( false); 389 // bDays.fill( false);
390 //pDays.fill( false); 390 //pDays.fill( false);
391 //hDays.fill( false); 391 //hDays.fill( false);
392 //eDays.fill( false); 392 //eDays.fill( false);
393 mRepaintTimer->stop(); 393 mRepaintTimer->stop();
394 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday 394 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
395 int i; 395 int i;
396 for(i = 0; i < NUMDAYS; i++) { 396 for(i = 0; i < NUMDAYS; i++) {
397 if ( ( (i+startDay) % 7 == 0 ) ) { 397 if ( ( (i+startDay) % 7 == 0 ) ) {
398 pDays.setBit(i); 398 pDays.setBit(i);
399 } 399 }
400 } 400 }
401 repaint(false); 401 repaint(false);
402} 402}
403void KODayMatrix::computeEvent(Event *event, int i ) 403void KODayMatrix::computeEvent(Event *event, int i )
404{ 404{
405 QString holiStr = mHolidays[i]; 405 QString holiStr = mHolidays[i];
406 if ( event->isHoliday()) { 406 if ( event->isHoliday()) {
407 pDays.setBit(i); 407 pDays.setBit(i);
408 hDays.setBit(i); 408 hDays.setBit(i);
409 if ( !holiStr.isEmpty() ) 409 if ( !holiStr.isEmpty() )
410 holiStr += "\n"; 410 holiStr += "\n";
411 holiStr += event->summary(); 411 holiStr += event->summary();
412 if ( !event->location().isEmpty() ) 412 if ( !event->location().isEmpty() )
413 holiStr += " (" + event->location() + ")"; 413 holiStr += " (" + event->location() + ")";
414 mHolidays[i] =holiStr ; 414 mHolidays[i] =holiStr ;
415 eDays.setBit(i); 415 eDays.setBit(i);
416 } 416 }
417 if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) { 417 if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) {
418 if ( event->isBirthday()) { 418 if ( event->isBirthday()) {
419 pDays.setBit(i); 419 pDays.setBit(i);
420 if ( !holiStr.isEmpty() ) 420 if ( !holiStr.isEmpty() )
421 holiStr += "\n"; 421 holiStr += "\n";
422 holiStr += i18n("Birthday") + ": "+event->summary(); 422 holiStr += i18n("Birthday") + ": "+event->summary();
423 if ( !event->location().isEmpty() ) 423 if ( !event->location().isEmpty() )
424 holiStr += " (" + event->location() + ")"; 424 holiStr += " (" + event->location() + ")";
425 bDays.setBit(i); 425 bDays.setBit(i);
426 mHolidays[i] =holiStr ; 426 mHolidays[i] =holiStr ;
427 } 427 }
428 } 428 }
429 if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) 429 if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW )
430 eDays.setBit(i); 430 eDays.setBit(i);
431} 431}
432void KODayMatrix::updateViewTimed() 432void KODayMatrix::updateViewTimed()
433{ 433{
434 mUpdateTimer->stop(); 434 mUpdateTimer->stop();
435 if ( !mCalendar ) { 435 if ( !mCalendar ) {
436 qDebug("NOT CAL "); 436 qDebug("NOT CAL ");
437 return; 437 return;
438 } 438 }
439#if 1 439#if 1
440 440
441 441
442 int i; 442 int i;
443 int timeSpan = NUMDAYS-1; 443 int timeSpan = NUMDAYS-1;
444 QPtrList<Event> events = mCalendar->events(); 444 QPtrList<Event> events = mCalendar->events();
445 Event *event; 445 Event *event;
446 QDateTime dt; 446 QDateTime dt;
447 bool ok; 447 bool ok;
448 bDays.fill( false); 448 bDays.fill( false);
449 pDays.fill( false); 449 pDays.fill( false);
450 hDays.fill( false); 450 hDays.fill( false);
451 eDays.fill( false); 451 eDays.fill( false);
452 mHolidays.clear(); 452 mHolidays.clear();
453 QDate mStartDate = days[0]; 453 QDate mStartDate = days[0];
454 QDate endDate = mStartDate.addDays( timeSpan ); 454 QDate endDate = mStartDate.addDays( timeSpan );
455 for( event = events.first(); event; event = events.next() ) { // for event 455 for( event = events.first(); event; event = events.next() ) { // for event
456 ushort recurType = event->doesRecur(); 456 ushort recurType = event->doesRecur();
457 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || 457 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
458 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 458 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
459 continue; 459 continue;
460 } 460 }
461 if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
462 continue;
463 }
461 if ( event->doesRecur() ) { 464 if ( event->doesRecur() ) {
462 bool last; 465 bool last;
463 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); 466 QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
464 QDateTime incidenceEnd; 467 QDateTime incidenceEnd;
465 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); 468 int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
466 bool invalid = false; 469 bool invalid = false;
467 while( true ) { 470 while( true ) {
468 if ( incidenceStart.isValid() ) { 471 if ( incidenceStart.isValid() ) {
469 incidenceEnd = incidenceStart.addDays( eventlen ); 472 incidenceEnd = incidenceStart.addDays( eventlen );
470 int st = incidenceStart.date().daysTo( endDate ); 473 int st = incidenceStart.date().daysTo( endDate );
471 if ( st >= 0 ) { // start before timeend 474 if ( st >= 0 ) { // start before timeend
472 int end = mStartDate.daysTo( incidenceEnd.date() ); 475 int end = mStartDate.daysTo( incidenceEnd.date() );
473 if ( end >= 0 ) { // end after timestart --- got one! 476 if ( end >= 0 ) { // end after timestart --- got one!
474 //normalize 477 //normalize
475 st = timeSpan - st; 478 st = timeSpan - st;
476 if ( st < 0 ) st = 0; 479 if ( st < 0 ) st = 0;
477 if ( end > timeSpan ) end = timeSpan; 480 if ( end > timeSpan ) end = timeSpan;
478 int iii; 481 int iii;
479 //qDebug("found %s %d %d ",event->summary().latin1(), st, end ); 482 //qDebug("found %s %d %d ",event->summary().latin1(), st, end );
480 for ( iii = st;iii<= end;++iii) { 483 for ( iii = st;iii<= end;++iii) {
481 computeEvent( event, iii ); 484 computeEvent( event, iii );
482 } 485 }
483 } 486 }
484 } 487 }
485 } else { 488 } else {
486 if ( invalid ) 489 if ( invalid )
487 break; 490 break;
488 invalid = true; 491 invalid = true;
489 //qDebug("invalid %s", event->summary().latin1()); 492 //qDebug("invalid %s", event->summary().latin1());
490 incidenceStart = QDateTime( mStartDate ).addSecs( -2 );; 493 incidenceStart = QDateTime( mStartDate ).addSecs( -2 );;
491 } 494 }
492 if ( last ) 495 if ( last )
493 break; 496 break;
494 bool ok; 497 bool ok;
495 incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok ); 498 incidenceStart = event->getNextOccurence( incidenceStart.addSecs( 1 ) ,&ok );
496 if ( ! ok ) 499 if ( ! ok )
497 break; 500 break;
498 if ( incidenceStart.date() > endDate ) 501 if ( incidenceStart.date() > endDate )
499 break; 502 break;
500 } 503 }
501 } else { // no recur 504 } else { // no recur
502 int st = event->dtStart().date().daysTo( endDate ); 505 int st = event->dtStart().date().daysTo( endDate );
503 if ( st >= 0 ) { // start before timeend 506 if ( st >= 0 ) { // start before timeend
504 int end = mStartDate.daysTo( event->dtEnd().date() ); 507 int end = mStartDate.daysTo( event->dtEnd().date() );
505 if ( end >= 0 ) { // end after timestart --- got one! 508 if ( end >= 0 ) { // end after timestart --- got one!
506 //normalize 509 //normalize
507 st = timeSpan - st; 510 st = timeSpan - st;
508 if ( st < 0 ) st = 0; 511 if ( st < 0 ) st = 0;
509 if ( end > timeSpan ) end = timeSpan; 512 if ( end > timeSpan ) end = timeSpan;
510 int iii; 513 int iii;
511 for ( iii = st;iii<= end;++iii) 514 for ( iii = st;iii<= end;++iii)
512 computeEvent( event, iii ); 515 computeEvent( event, iii );
513 } 516 }
514 } 517 }
515 } 518 }
516 } 519 }
517 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday 520 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
518 for(i = 0; i < NUMDAYS; i++) { 521 for(i = 0; i < NUMDAYS; i++) {
519 if ( ( (i+startDay) % 7 == 0 ) ) { 522 if ( ( (i+startDay) % 7 == 0 ) ) {
520 pDays.setBit(i); 523 pDays.setBit(i);
521 } 524 }
522 } 525 }
523 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 526 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
524 bDays.fill( false); 527 bDays.fill( false);
525 // insert due todos 528 // insert due todos
526 QPtrList<Todo> todos = mCalendar->todos( ); 529 QPtrList<Todo> todos = mCalendar->todos( );
527 Todo *todo; 530 Todo *todo;
528 for(todo = todos.first(); todo; todo = todos.next()) { 531 for(todo = todos.first(); todo; todo = todos.next()) {
529 //insertTodo( todo ); 532 //insertTodo( todo );
530 if ( todo->hasDueDate() ) { 533 if ( todo->hasDueDate() ) {
531 int day = mStartDate.daysTo( todo->dtDue().date() ); 534 int day = mStartDate.daysTo( todo->dtDue().date() );
532 if ( day >= 0 && day < timeSpan + 1) { 535 if ( day >= 0 && day < timeSpan + 1) {
533 int i = day; 536 int i = day;
534 QString holiStr = mHolidays[i]; 537 QString holiStr = mHolidays[i];
535 pDays.setBit(i); 538 pDays.setBit(i);
536 if ( !holiStr.isEmpty() ) 539 if ( !holiStr.isEmpty() )
537 holiStr += "\n"; 540 holiStr += "\n";
538 holiStr += i18n("Todo") + ": "+todo->summary(); 541 holiStr += i18n("Todo") + ": "+todo->summary();
539 if ( !todo->location().isEmpty() ) 542 if ( !todo->location().isEmpty() )
540 holiStr += " (" + todo->location() + ")"; 543 holiStr += " (" + todo->location() + ")";
541 bDays.setBit(i); 544 bDays.setBit(i);
542 mHolidays[i] =holiStr ; 545 mHolidays[i] =holiStr ;
543 eDays.setBit(i); 546 eDays.setBit(i);
544 } 547 }
545 } 548 }
546 } 549 }
547 } 550 }
548 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 551 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
549 bDays.fill( false); 552 bDays.fill( false);
550 // insert due todos 553 // insert due todos
551 QPtrList<Journal> todos = mCalendar->journals( ); 554 QPtrList<Journal> todos = mCalendar->journals( );
552 Journal *todo; 555 Journal *todo;
553 for(todo = todos.first(); todo; todo = todos.next()) { 556 for(todo = todos.first(); todo; todo = todos.next()) {
554 int day = mStartDate.daysTo( todo->dtStart().date() ); 557 int day = mStartDate.daysTo( todo->dtStart().date() );
555 if ( day >= 0 && day < timeSpan + 1) { 558 if ( day >= 0 && day < timeSpan + 1) {
556 int i = day; 559 int i = day;
557 QString holiStr = mHolidays[i]; 560 QString holiStr = mHolidays[i];
558 pDays.setBit(i); 561 pDays.setBit(i);
559 if ( !holiStr.isEmpty() ) 562 if ( !holiStr.isEmpty() )
560 holiStr += "\n"; 563 holiStr += "\n";
561 holiStr += i18n("Journal: ")+todo->summary().left(25); 564 holiStr += i18n("Journal: ")+todo->summary().left(25);
562 if ( todo->summary().length() > 25 ) 565 if ( todo->summary().length() > 25 )
563 holiStr +="..."; 566 holiStr +="...";
564 bDays.setBit(i); 567 bDays.setBit(i);
565 mHolidays[i] =holiStr ; 568 mHolidays[i] =holiStr ;
566 eDays.setBit(i); 569 eDays.setBit(i);
567 570
568 } 571 }
569 } 572 }
570 } 573 }
571#else 574#else
572 //qDebug("KODayMatrix::updateViewTimed "); 575 //qDebug("KODayMatrix::updateViewTimed ");
573 for(int i = 0; i < NUMDAYS; i++) { 576 for(int i = 0; i < NUMDAYS; i++) {
574 // if events are set for the day then remember to draw it bold 577 // if events are set for the day then remember to draw it bold
575 QPtrList<Event> eventlist = mCalendar->events(days[i]); 578 QPtrList<Event> eventlist = mCalendar->events(days[i]);
576 Event *event; 579 Event *event;
577 int numEvents = eventlist.count(); 580 int numEvents = eventlist.count();
578 QString holiStr = ""; 581 QString holiStr = "";
579 bDays.clearBit(i); 582 bDays.clearBit(i);
580 hDays.clearBit(i); 583 hDays.clearBit(i);
581 eDays.clearBit(i); 584 eDays.clearBit(i);
582 for(event=eventlist.first();event != 0;event=eventlist.next()) { 585 for(event=eventlist.first();event != 0;event=eventlist.next()) {
583 ushort recurType = event->recurrence()->doesRecur(); 586 ushort recurType = event->recurrence()->doesRecur();
584 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || 587 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
585 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 588 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
586 numEvents--; 589 numEvents--;
587 } 590 }
588 if ( event->isHoliday()) { 591 if ( event->isHoliday()) {
589 hDays.setBit(i); 592 hDays.setBit(i);
590 if ( !holiStr.isEmpty() ) 593 if ( !holiStr.isEmpty() )
591 holiStr += "\n"; 594 holiStr += "\n";
592 holiStr += event->summary(); 595 holiStr += event->summary();
593 if ( !event->location().isEmpty() ) 596 if ( !event->location().isEmpty() )
594 holiStr += " (" + event->location() + ")"; 597 holiStr += " (" + event->location() + ")";
595 } 598 }
596 if ( event->isBirthday()) { 599 if ( event->isBirthday()) {
597 if ( !holiStr.isEmpty() ) 600 if ( !holiStr.isEmpty() )
598 holiStr += "\n"; 601 holiStr += "\n";
599 holiStr += i18n("Birthday") + ": "+event->summary(); 602 holiStr += i18n("Birthday") + ": "+event->summary();
600 if ( !event->location().isEmpty() ) 603 if ( !event->location().isEmpty() )
601 holiStr += " (" + event->location() + ")"; 604 holiStr += " (" + event->location() + ")";
602 bDays.setBit(i); 605 bDays.setBit(i);
603 } 606 }
604 } 607 }
605 if ( numEvents ) 608 if ( numEvents )
606 eDays.setBit(i); 609 eDays.setBit(i);
607 //if it is a holy day then draw it red. Sundays are consider holidays, too 610 //if it is a holy day then draw it red. Sundays are consider holidays, too
608 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || 611 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) ||
609 !holiStr.isEmpty()) { 612 !holiStr.isEmpty()) {
610 mHolidays[i] = holiStr; 613 mHolidays[i] = holiStr;
611 } else { 614 } else {
612 mHolidays[i] = QString::null; 615 mHolidays[i] = QString::null;
613 } 616 }
614 } 617 }
615#endif 618#endif
616 mRedrawNeeded = true; 619 mRedrawNeeded = true;
617 if ( ! mPendingUpdateBeforeRepaint ) 620 if ( ! mPendingUpdateBeforeRepaint )
618 repaint(false); 621 repaint(false);
619} 622}
620void KODayMatrix::updateView(QDate actdate) 623void KODayMatrix::updateView(QDate actdate)
621{ 624{
622 if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView ) 625 if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView )
623 mRedrawNeeded = true; 626 mRedrawNeeded = true;
624 mLastView = KOPrefs::instance()->mCurrentDisplayedView; 627 mLastView = KOPrefs::instance()->mCurrentDisplayedView;
625 if ( ! actdate.isValid() ) { 628 if ( ! actdate.isValid() ) {
626 //qDebug("date not valid "); 629 //qDebug("date not valid ");
627 return; 630 return;
628 } 631 }
629 mDayChanged = false; 632 mDayChanged = false;
630 //flag to indicate if the starting day of the matrix has changed by this call 633 //flag to indicate if the starting day of the matrix has changed by this call
631 //mDayChanged = false; 634 //mDayChanged = false;
632 // if a new startdate is to be set then apply Cornelius's calculation 635 // if a new startdate is to be set then apply Cornelius's calculation
633 // of the first day to be shown 636 // of the first day to be shown
634 if (actdate != startdate) { 637 if (actdate != startdate) {
635 // reset index of selection according to shift of starting date from startdate to actdate 638 // reset index of selection according to shift of starting date from startdate to actdate
636 if (mSelStart != NOSELECTION) { 639 if (mSelStart != NOSELECTION) {
637 int tmp = actdate.daysTo(startdate); 640 int tmp = actdate.daysTo(startdate);
638 //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; 641 //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl;
639 // shift selection if new one would be visible at least partly ! 642 // shift selection if new one would be visible at least partly !
640 643
641 if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { 644 if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) {
642 // nested if is required for next X display pushed from a different month - correction required 645 // nested if is required for next X display pushed from a different month - correction required
643 // otherwise, for month forward and backward, it must be avoided 646 // otherwise, for month forward and backward, it must be avoided
644 if( mSelStart > NUMDAYS || mSelStart < 0 ) 647 if( mSelStart > NUMDAYS || mSelStart < 0 )
645 mSelStart = mSelStart + tmp; 648 mSelStart = mSelStart + tmp;
646 if( mSelEnd > NUMDAYS || mSelEnd < 0 ) 649 if( mSelEnd > NUMDAYS || mSelEnd < 0 )
647 mSelEnd = mSelEnd + tmp; 650 mSelEnd = mSelEnd + tmp;
648 } 651 }
649 } 652 }
650 startdate = actdate; 653 startdate = actdate;
651 mDayChanged = true; 654 mDayChanged = true;
652 recalculateToday(); 655 recalculateToday();
653 mRedrawNeeded = true; 656 mRedrawNeeded = true;
654 } 657 }
655 //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); 658 //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
656 if ( !isVisible() ) { 659 if ( !isVisible() ) {
657 mPendingUpdateBeforeRepaint = true; 660 mPendingUpdateBeforeRepaint = true;
658 } else { 661 } else {
659#ifdef DESKTOP_VERSION 662#ifdef DESKTOP_VERSION
660 //mRepaintTimer->start( 100 ); 663 //mRepaintTimer->start( 100 );
661 //updateViewTimed(); 664 //updateViewTimed();
662 mUpdateTimer->start( 50 ); 665 mUpdateTimer->start( 50 );
663#else 666#else
664 mRepaintTimer->start( 350 ); 667 mRepaintTimer->start( 350 );
665 mUpdateTimer->start( 800 ); 668 mUpdateTimer->start( 800 );
666#endif 669#endif
667 } 670 }
668} 671}
669void KODayMatrix::updateEvents() 672void KODayMatrix::updateEvents()
670{ 673{
671 if ( !mCalendar ) return; 674 if ( !mCalendar ) return;
672 675
673 for( int i = 0; i < NUMDAYS; i++ ) { 676 for( int i = 0; i < NUMDAYS; i++ ) {
674 // if events are set for the day then remember to draw it bold 677 // if events are set for the day then remember to draw it bold
675 QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); 678 QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
676 int numEvents = eventlist.count(); 679 int numEvents = eventlist.count();
677 Event *event; 680 Event *event;
678 for( event = eventlist.first(); event != 0;event=eventlist.next()) { 681 for( event = eventlist.first(); event != 0;event=eventlist.next()) {
679 ushort recurType = event->doesRecur(); 682 ushort recurType = event->doesRecur();
680 683
681 if ( ( recurType == Recurrence::rDaily && 684 if ( ( recurType == Recurrence::rDaily &&
682 !KOPrefs::instance()->mDailyRecur ) || 685 !KOPrefs::instance()->mDailyRecur ) ||
683 ( recurType == Recurrence::rWeekly && 686 ( recurType == Recurrence::rWeekly &&
684 !KOPrefs::instance()->mWeeklyRecur ) ) { 687 !KOPrefs::instance()->mWeeklyRecur ) ) {
685 numEvents--; 688 numEvents--;
686 } 689 }
690 if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
691 numEvents--;
692 }
687 } 693 }
688 if ( numEvents ) 694 if ( numEvents )
689 eDays.setBit(i); 695 eDays.setBit(i);
690 else 696 else
691 eDays.clearBit(i); 697 eDays.clearBit(i);
692 } 698 }
693} 699}
694 700
695const QDate& KODayMatrix::getDate(int offset) 701const QDate& KODayMatrix::getDate(int offset)
696{ 702{
697 if (offset < 0 || offset > NUMDAYS-1) { 703 if (offset < 0 || offset > NUMDAYS-1) {
698 qDebug("Wrong offset2 %d", offset); 704 qDebug("Wrong offset2 %d", offset);
699 return days[0]; 705 return days[0];
700 } 706 }
701 return days[offset]; 707 return days[offset];
702} 708}
703 709
704QString KODayMatrix::getHolidayLabel(int offset) 710QString KODayMatrix::getHolidayLabel(int offset)
705{ 711{
706 if (offset < 0 || offset > NUMDAYS-1) { 712 if (offset < 0 || offset > NUMDAYS-1) {
707 qDebug("Wrong offset1 %d", offset); 713 qDebug("Wrong offset1 %d", offset);
708 return QString(); 714 return QString();
709 } 715 }
710 return mHolidays[offset]; 716 return mHolidays[offset];
711} 717}
712 718
713int KODayMatrix::getDayIndexFrom(int x, int y) 719int KODayMatrix::getDayIndexFrom(int x, int y)
714{ 720{
715 int colModulo = (width()-2) % 7; 721 int colModulo = (width()-2) % 7;
716 int rowModulo = (height()-2) % 6; 722 int rowModulo = (height()-2) % 6;
717#if 0 723#if 0
718 return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? 724 return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ?
719 6 - x/daysize.width() : x/daysize.width()); 725 6 - x/daysize.width() : x/daysize.width());
720#endif 726#endif
721 int xVal = (x-colModulo/2-2)/daysize.width(); 727 int xVal = (x-colModulo/2-2)/daysize.width();
722 int yVal = (y-rowModulo/2-2)/daysize.height(); 728 int yVal = (y-rowModulo/2-2)/daysize.height();
723 729
724 730
725 return 7*(yVal) + xVal; 731 return 7*(yVal) + xVal;
726 732
727} 733}
728 734
729// ---------------------------------------------------------------------------- 735// ----------------------------------------------------------------------------
730// M O U S E E V E N T H A N D L I N G 736// M O U S E E V E N T H A N D L I N G
731// ---------------------------------------------------------------------------- 737// ----------------------------------------------------------------------------
732 738
733void KODayMatrix::mousePressEvent (QMouseEvent* e) 739void KODayMatrix::mousePressEvent (QMouseEvent* e)
734{ 740{
735 741
736 if ( e->button() == LeftButton ) 742 if ( e->button() == LeftButton )
737 mouseDown = true; 743 mouseDown = true;
738 mSelStart = getDayIndexFrom(e->x(), e->y()); 744 mSelStart = getDayIndexFrom(e->x(), e->y());
739 if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; 745 if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1;
740 mSelInit = mSelStart; 746 mSelInit = mSelStart;
741 mSelEnd = mSelStart; 747 mSelEnd = mSelStart;
742 mRedrawNeeded = true; 748 mRedrawNeeded = true;
743 repaint(false); 749 repaint(false);
744} 750}
745 751
746void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) 752void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
747{ 753{
748 mRedrawNeeded = true; 754 mRedrawNeeded = true;
749 if ( e->button() == LeftButton ) 755 if ( e->button() == LeftButton )
750 if ( ! mouseDown ) { 756 if ( ! mouseDown ) {
751 return; 757 return;
752 } 758 }
753 else 759 else
754 mouseDown = false; 760 mouseDown = false;
755 int tmp = getDayIndexFrom(e->x(), e->y()); 761 int tmp = getDayIndexFrom(e->x(), e->y());
756 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1; 762 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
757 763
758 if (mSelInit > tmp) { 764 if (mSelInit > tmp) {
759 mSelEnd = mSelInit; 765 mSelEnd = mSelInit;
760 if (tmp != mSelStart) { 766 if (tmp != mSelStart) {
761 mSelStart = tmp; 767 mSelStart = tmp;
762 repaint(false); 768 repaint(false);
763 } 769 }
764 } else { 770 } else {
765 mSelStart = mSelInit; 771 mSelStart = mSelInit;
766 772
767 //repaint only if selection has changed 773 //repaint only if selection has changed
768 if (tmp != mSelEnd) { 774 if (tmp != mSelEnd) {
769 mSelEnd = tmp; 775 mSelEnd = tmp;
770 repaint(false); 776 repaint(false);
771 } 777 }
772 } 778 }
773 779
774 DateList daylist; 780 DateList daylist;
775 if ( mSelStart < 0 ) 781 if ( mSelStart < 0 )
776 mSelStart = 0; 782 mSelStart = 0;
777 for (int i = mSelStart; i <= mSelEnd; i++) { 783 for (int i = mSelStart; i <= mSelEnd; i++) {
778 daylist.append(days[i]); 784 daylist.append(days[i]);
779 } 785 }
780 emit selected((const DateList)daylist); 786 emit selected((const DateList)daylist);
781 787
782} 788}
783 789
784void KODayMatrix::mouseMoveEvent (QMouseEvent* e) 790void KODayMatrix::mouseMoveEvent (QMouseEvent* e)
785{ 791{
786 if ( ! mouseDown ) { 792 if ( ! mouseDown ) {
787 return; 793 return;
788 } 794 }
789 mRedrawNeeded = true; 795 mRedrawNeeded = true;
790 int tmp = getDayIndexFrom(e->x(), e->y()); 796 int tmp = getDayIndexFrom(e->x(), e->y());
791 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1; 797 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
792 798
793 if (mSelInit > tmp) { 799 if (mSelInit > tmp) {
794 mSelEnd = mSelInit; 800 mSelEnd = mSelInit;
795 if (tmp != mSelStart) { 801 if (tmp != mSelStart) {
796 mSelStart = tmp; 802 mSelStart = tmp;
797 repaint(false); 803 repaint(false);
798 } 804 }
799 } else { 805 } else {
800 mSelStart = mSelInit; 806 mSelStart = mSelInit;
801 807
802 //repaint only if selection has changed 808 //repaint only if selection has changed
803 if (tmp != mSelEnd) { 809 if (tmp != mSelEnd) {
804 mSelEnd = tmp; 810 mSelEnd = tmp;
805 repaint(false); 811 repaint(false);
806 } 812 }
807 } 813 }
808} 814}
809 815
810// ---------------------------------------------------------------------------- 816// ----------------------------------------------------------------------------
811// D R A G ' N D R O P H A N D L I N G 817// D R A G ' N D R O P H A N D L I N G
812// ---------------------------------------------------------------------------- 818// ----------------------------------------------------------------------------
813 819
814void KODayMatrix::dragEnterEvent(QDragEnterEvent *e) 820void KODayMatrix::dragEnterEvent(QDragEnterEvent *e)
815{ 821{
816#ifndef KORG_NODND 822#ifndef KORG_NODND
817 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) { 823 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
818 e->ignore(); 824 e->ignore();
819 return; 825 return;
820 } 826 }
821 827
822 // some visual feedback 828 // some visual feedback
823// oldPalette = palette(); 829// oldPalette = palette();
824// setPalette(my_HilitePalette); 830// setPalette(my_HilitePalette);
825// update(); 831// update();
826#endif 832#endif
827} 833}
828 834
829void KODayMatrix::dragMoveEvent(QDragMoveEvent *e) 835void KODayMatrix::dragMoveEvent(QDragMoveEvent *e)
830{ 836{
831#ifndef KORG_NODND 837#ifndef KORG_NODND
832 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) { 838 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
833 e->ignore(); 839 e->ignore();
834 return; 840 return;
835 } 841 }
836 842
837 e->accept(); 843 e->accept();
838#endif 844#endif
839} 845}
840 846
841void KODayMatrix::dragLeaveEvent(QDragLeaveEvent */*dl*/) 847void KODayMatrix::dragLeaveEvent(QDragLeaveEvent */*dl*/)
842{ 848{
843#ifndef KORG_NODND 849#ifndef KORG_NODND
844// setPalette(oldPalette); 850// setPalette(oldPalette);
845// update(); 851// update();
846#endif 852#endif
847} 853}
848 854
849void KODayMatrix::dropEvent(QDropEvent *e) 855void KODayMatrix::dropEvent(QDropEvent *e)
850{ 856{
851#ifndef KORG_NODND 857#ifndef KORG_NODND
852// kdDebug() << "KODayMatrix::dropEvent(e) begin" << endl; 858// kdDebug() << "KODayMatrix::dropEvent(e) begin" << endl;
853 859
854 if (!mCalendar || !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) { 860 if (!mCalendar || !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
855 e->ignore(); 861 e->ignore();
856 return; 862 return;
857 } 863 }
858 864
859 DndFactory factory( mCalendar ); 865 DndFactory factory( mCalendar );
860 Event *event = factory.createDrop(e); 866 Event *event = factory.createDrop(e);
861 867
862 if (event) { 868 if (event) {
863 e->acceptAction(); 869 e->acceptAction();
864 870
865 Event *existingEvent = mCalendar->event(event->uid()); 871 Event *existingEvent = mCalendar->event(event->uid());
866 872
867 if(existingEvent) { 873 if(existingEvent) {
868 // uniquify event 874 // uniquify event
869 event->recreate(); 875 event->recreate();
870/* 876/*
871 KMessageBox::sorry(this, 877 KMessageBox::sorry(this,
872 i18n("Event already exists in this calendar."), 878 i18n("Event already exists in this calendar."),
873 i18n("Drop Event")); 879 i18n("Drop Event"));
874 delete event; 880 delete event;
875 return; 881 return;
876*/ 882*/
877 } 883 }
878// kdDebug() << "Drop new Event" << endl; 884// kdDebug() << "Drop new Event" << endl;
879 // Adjust date 885 // Adjust date
880 QDateTime start = event->dtStart(); 886 QDateTime start = event->dtStart();
881 QDateTime end = event->dtEnd(); 887 QDateTime end = event->dtEnd();
882 int duration = start.daysTo(end); 888 int duration = start.daysTo(end);
883 int idx = getDayIndexFrom(e->pos().x(), e->pos().y()); 889 int idx = getDayIndexFrom(e->pos().x(), e->pos().y());
884 890
885 start.setDate(days[idx]); 891 start.setDate(days[idx]);
886 end.setDate(days[idx].addDays(duration)); 892 end.setDate(days[idx].addDays(duration));
887 893
888 event->setDtStart(start); 894 event->setDtStart(start);
889 event->setDtEnd(end); 895 event->setDtEnd(end);
890 mCalendar->addEvent(event); 896 mCalendar->addEvent(event);
891 897
892 emit eventDropped(event); 898 emit eventDropped(event);
893 } else { 899 } else {
894// kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl; 900// kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl;
895 e->ignore(); 901 e->ignore();
896 } 902 }
897#endif 903#endif
898} 904}
899 905
900// ---------------------------------------------------------------------------- 906// ----------------------------------------------------------------------------
901// P A I N T E V E N T H A N D L I N G 907// P A I N T E V E N T H A N D L I N G
902// ---------------------------------------------------------------------------- 908// ----------------------------------------------------------------------------
903 909
904void KODayMatrix::paintEvent(QPaintEvent * pevent) 910void KODayMatrix::paintEvent(QPaintEvent * pevent)
905{ 911{
906 912
907 if ( width() <= 0 || height() <= 0 ) 913 if ( width() <= 0 || height() <= 0 )
908 return; 914 return;
909 if ( mPendingUpdateBeforeRepaint ) { 915 if ( mPendingUpdateBeforeRepaint ) {
910 updateViewTimed(); 916 updateViewTimed();
911 mPendingUpdateBeforeRepaint = false; 917 mPendingUpdateBeforeRepaint = false;
912 } 918 }
913#if 0 919#if 0
914 if ( myPix.width() != width() || myPix.height()!=height() ) { 920 if ( myPix.width() != width() || myPix.height()!=height() ) {
915 myPix.resize(size() ); 921 myPix.resize(size() );
916 mRedrawNeeded = true; 922 mRedrawNeeded = true;
917 } 923 }
918#endif 924#endif
919 if ( oldW != width() || oldH !=height() ) 925 if ( oldW != width() || oldH !=height() )
920 mRedrawNeeded = true; 926 mRedrawNeeded = true;
921 927
922 oldH = height() ; 928 oldH = height() ;
923 oldW = width(); 929 oldW = width();
924 if ( myPix.width() < width() || myPix.height() < height() ) { 930 if ( myPix.width() < width() || myPix.height() < height() ) {
925 myPix.resize(size() ); 931 myPix.resize(size() );
926 mRedrawNeeded = true; 932 mRedrawNeeded = true;
927 933
928 } 934 }
929 935
930 if ( mRedrawNeeded ) { 936 if ( mRedrawNeeded ) {
931 //qDebug("REDRAW "); 937 //qDebug("REDRAW ");
932 QPainter p(&myPix); 938 QPainter p(&myPix);
933 p.setFont(font()); 939 p.setFont(font());
934 940
935 941
936 int dheight = daysize.height(); 942 int dheight = daysize.height();
937 int dwidth = daysize.width(); 943 int dwidth = daysize.width();
938 int row,col; 944 int row,col;
939 int selw, selh; 945 int selw, selh;
940 int xyOff = frameWidth(); 946 int xyOff = frameWidth();
941 int colModulo = (width()-2) % 7; 947 int colModulo = (width()-2) % 7;
942 int rowModulo = (height()-2) % 6; 948 int rowModulo = (height()-2) % 6;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 571ca11..1b0e5f4 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,502 +1,504 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 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 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kglobalsettings.h> 39#include <kglobalsettings.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kdebug.h> 42#include <kdebug.h>
43#include <kemailsettings.h> 43#include <kemailsettings.h>
44#include <kstaticdeleter.h> 44#include <kstaticdeleter.h>
45#include <libkdepim/kpimglobalprefs.h> 45#include <libkdepim/kpimglobalprefs.h>
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48#include "mainwindow.h" 48#include "mainwindow.h"
49 49
50KOPrefs *KOPrefs::mInstance = 0; 50KOPrefs *KOPrefs::mInstance = 0;
51static KStaticDeleter<KOPrefs> insd; 51static KStaticDeleter<KOPrefs> insd;
52 52
53KOPrefs::KOPrefs() : 53KOPrefs::KOPrefs() :
54 KPimPrefs("korganizerrc") 54 KPimPrefs("korganizerrc")
55{ 55{
56 mGlobalUpdateDisabled = false; 56 mGlobalUpdateDisabled = false;
57 mCategoryColors.setAutoDelete(true); 57 mCategoryColors.setAutoDelete(true);
58 fillMailDefaults(); 58 fillMailDefaults();
59 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 59 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
60 QColor defaultHolidayColor = QColor(255,0,0); 60 QColor defaultHolidayColor = QColor(255,0,0);
61 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 61 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
62 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 62 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
63 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 63 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
64 QColor defaultTodoDueTodayColor = QColor(255,220,100); 64 QColor defaultTodoDueTodayColor = QColor(255,220,100);
65 QColor defaultTodoOverdueColor = QColor(255,153,125); 65 QColor defaultTodoOverdueColor = QColor(255,153,125);
66 QColor defaultTodoRunColor = QColor(99,194,30); 66 QColor defaultTodoRunColor = QColor(99,194,30);
67 KPrefs::setCurrentGroup("General"); 67 KPrefs::setCurrentGroup("General");
68 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 68 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
69 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 69 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
70 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 70 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
71 addItemBool("ShowIconSearch",&mShowIconSearch,true); 71 addItemBool("ShowIconSearch",&mShowIconSearch,true);
72 addItemBool("ShowIconList",&mShowIconList,true); 72 addItemBool("ShowIconList",&mShowIconList,true);
73 addItemBool("ShowIconDay1",&mShowIconDay1,true); 73 addItemBool("ShowIconDay1",&mShowIconDay1,true);
74 addItemBool("ShowIconDay5",&mShowIconDay5,true); 74 addItemBool("ShowIconDay5",&mShowIconDay5,true);
75 addItemBool("ShowIconDay6",&mShowIconDay6,true); 75 addItemBool("ShowIconDay6",&mShowIconDay6,true);
76 addItemBool("ShowIconDay7",&mShowIconDay7,true); 76 addItemBool("ShowIconDay7",&mShowIconDay7,true);
77 addItemBool("ShowIconMonth",&mShowIconMonth,true); 77 addItemBool("ShowIconMonth",&mShowIconMonth,true);
78 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 78 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
79 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 79 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
80 addItemBool("ShowIconBack",&mShowIconBack,true); 80 addItemBool("ShowIconBack",&mShowIconBack,true);
81 addItemBool("ShowIconToday",&mShowIconToday,true); 81 addItemBool("ShowIconToday",&mShowIconToday,true);
82 addItemBool("ShowIconForward",&mShowIconForward,true); 82 addItemBool("ShowIconForward",&mShowIconForward,true);
83 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 83 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
84 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 84 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
85 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); 85 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true);
86 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 86 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
87 addItemBool("ShowIconNext",&mShowIconNext,true); 87 addItemBool("ShowIconNext",&mShowIconNext,true);
88 addItemBool("ShowIconJournal",&mShowIconJournal,true); 88 addItemBool("ShowIconJournal",&mShowIconJournal,true);
89 addItemBool("ShowIconStretch",&mShowIconStretch,true); 89 addItemBool("ShowIconStretch",&mShowIconStretch,true);
90 addItemBool("ShowIconFilter",&mShowIconFilter,false); 90 addItemBool("ShowIconFilter",&mShowIconFilter,false);
91 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); 91 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true);
92 92
93 bool addIcons = false; 93 bool addIcons = false;
94#ifdef DESKTOP_VERSION 94#ifdef DESKTOP_VERSION
95 addIcons = true; 95 addIcons = true;
96#endif 96#endif
97 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); 97 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons);
98 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); 98 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons);
99 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); 99 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons);
100 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); 100 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons);
101 101
102 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 102 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
103 103
104 addItemBool("AskForQuit",&mAskForQuit,false); 104 addItemBool("AskForQuit",&mAskForQuit,false);
105 105
106#ifndef DESKTOP_VERSION 106#ifndef DESKTOP_VERSION
107 addItemBool("ShowFullMenu",&mShowFullMenu,false); 107 addItemBool("ShowFullMenu",&mShowFullMenu,false);
108#else 108#else
109 addItemBool("ShowFullMenu",&mShowFullMenu,true); 109 addItemBool("ShowFullMenu",&mShowFullMenu,true);
110#endif 110#endif
111 addItemBool("ToolBarHor",&mToolBarHor, true ); 111 addItemBool("ToolBarHor",&mToolBarHor, true );
112 addItemBool("ToolBarUp",&mToolBarUp, false ); 112 addItemBool("ToolBarUp",&mToolBarUp, false );
113 addItemBool("ToolBarHorV",&mToolBarHorV, true ); 113 addItemBool("ToolBarHorV",&mToolBarHorV, true );
114 addItemBool("ToolBarUpV",&mToolBarUpV, false ); 114 addItemBool("ToolBarUpV",&mToolBarUpV, false );
115 addItemBool("ToolBarHorN",&mToolBarHorN, true ); 115 addItemBool("ToolBarHorN",&mToolBarHorN, true );
116 addItemBool("ToolBarUpN",&mToolBarUpN, false ); 116 addItemBool("ToolBarUpN",&mToolBarUpN, false );
117 addItemBool("ToolBarHorF",&mToolBarHorF, true ); 117 addItemBool("ToolBarHorF",&mToolBarHorF, true );
118 addItemBool("ToolBarUpF",&mToolBarUpF, false ); 118 addItemBool("ToolBarUpF",&mToolBarUpF, false );
119 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 119 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
120 addItemBool("WhatsNextTime2Lines",&mWhatsNextTime2Lines, false ); 120 addItemBool("WhatsNextTime2Lines",&mWhatsNextTime2Lines, false );
121 addItemInt("Whats Next Days",&mWhatsNextDays,3); 121 addItemInt("Whats Next Days",&mWhatsNextDays,3);
122 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 122 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
123 123
124 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 124 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
125 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); 125 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true);
126 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 126 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
127 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 127 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
128 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 128 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
129 addItemInt("AllDay Size",&mAllDaySize,28); 129 addItemInt("AllDay Size",&mAllDaySize,28);
130 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 130 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
131 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 131 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
132 132
133 addItemStringList("LocationDefaults",&mLocationDefaults ); 133 addItemStringList("LocationDefaults",&mLocationDefaults );
134 addItemStringList("EventSummary User",&mEventSummaryUser); 134 addItemStringList("EventSummary User",&mEventSummaryUser);
135 addItemStringList("TodoSummary User",&mTodoSummaryUser); 135 addItemStringList("TodoSummary User",&mTodoSummaryUser);
136 addItemStringList("JournalSummary User",&mJournalSummaryUser); 136 addItemStringList("JournalSummary User",&mJournalSummaryUser);
137 137
138 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 138 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
139 addItemBool("Enable Project View",&mEnableProjectView,false); 139 addItemBool("Enable Project View",&mEnableProjectView,false);
140 addItemBool("Auto Save",&mAutoSave,false); 140 addItemBool("Auto Save",&mAutoSave,false);
141 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 141 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
142 addItemBool("Confirm Deletes",&mConfirm,true); 142 addItemBool("Confirm Deletes",&mConfirm,true);
143 addItemString("Archive File",&mArchiveFile); 143 addItemString("Archive File",&mArchiveFile);
144 addItemString("Html Export File",&mHtmlExportFile, 144 addItemString("Html Export File",&mHtmlExportFile,
145 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 145 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
146 addItemBool("Html With Save",&mHtmlWithSave,false); 146 addItemBool("Html With Save",&mHtmlWithSave,false);
147 147
148 KPrefs::setCurrentGroup("Personal Settings"); 148 KPrefs::setCurrentGroup("Personal Settings");
149 149
150 addItemInt("Mail Client",&mMailClient,MailClientKMail); 150 addItemInt("Mail Client",&mMailClient,MailClientKMail);
151 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 151 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
152 addItemBool("Bcc",&mBcc,false); 152 addItemBool("Bcc",&mBcc,false);
153 153
154 KPrefs::setCurrentGroup("Time & Date"); 154 KPrefs::setCurrentGroup("Time & Date");
155 155
156 156
157 addItemInt("Default Start Time",&mStartTime,10); 157 addItemInt("Default Start Time",&mStartTime,10);
158 addItemInt("Default Duration",&mDefaultDuration,2); 158 addItemInt("Default Duration",&mDefaultDuration,2);
159 addItemInt("Default Alarm Time",&mAlarmTime,3); 159 addItemInt("Default Alarm Time",&mAlarmTime,3);
160 KPrefs::setCurrentGroup("AlarmSettings"); 160 KPrefs::setCurrentGroup("AlarmSettings");
161 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 161 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
162 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 162 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
163 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 163 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
164 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 164 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
165 165
166 166
167 KPrefs::setCurrentGroup("Calendar"); 167 KPrefs::setCurrentGroup("Calendar");
168 168
169 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 169 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
170 170
171 KPrefs::setCurrentGroup("Fonts"); 171 KPrefs::setCurrentGroup("Fonts");
172 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 172 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
173 QFont fon = KGlobalSettings::generalFont(); 173 QFont fon = KGlobalSettings::generalFont();
174 addItemFont("TimeBar Font",&mTimeBarFont,fon ); 174 addItemFont("TimeBar Font",&mTimeBarFont,fon );
175 addItemFont("MonthView Font",&mMonthViewFont,fon); 175 addItemFont("MonthView Font",&mMonthViewFont,fon);
176 addItemFont("AgendaView Font",&mAgendaViewFont,fon); 176 addItemFont("AgendaView Font",&mAgendaViewFont,fon);
177 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); 177 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon);
178 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); 178 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon);
179 addItemFont("TodoView Font",&mTodoViewFont,fon); 179 addItemFont("TodoView Font",&mTodoViewFont,fon);
180 addItemFont("ListView Font",&mListViewFont,fon); 180 addItemFont("ListView Font",&mListViewFont,fon);
181 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); 181 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon);
182 addItemFont("EditBox Font",&mEditBoxFont,fon); 182 addItemFont("EditBox Font",&mEditBoxFont,fon);
183 addItemFont("JournalView Font",&mJornalViewFont,fon); 183 addItemFont("JournalView Font",&mJornalViewFont,fon);
184 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); 184 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon);
185 addItemFont("EventView Font",&mEventViewFont,fon); 185 addItemFont("EventView Font",&mEventViewFont,fon);
186 186
187 KPrefs::setCurrentGroup("RemoteSyncing"); 187 KPrefs::setCurrentGroup("RemoteSyncing");
188 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 188 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
189 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 189 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
191 addItemInt("LastSyncTime",&mLastSyncTime,0); 191 addItemInt("LastSyncTime",&mLastSyncTime,0);
192 192
193#ifdef _WIN32_ 193#ifdef _WIN32_
194 QString hdp= locateLocal("data","korganizer")+"\\\\"; 194 QString hdp= locateLocal("data","korganizer")+"\\\\";
195#else 195#else
196 QString hdp= locateLocal("data","korganizer")+"/"; 196 QString hdp= locateLocal("data","korganizer")+"/";
197#endif 197#endif
198 198
199 KPrefs::setCurrentGroup("LoadSaveFileNames"); 199 KPrefs::setCurrentGroup("LoadSaveFileNames");
200 200
201 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 201 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
202 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 202 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
203 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 203 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
204 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 204 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
205 205
206 206
207 KPrefs::setCurrentGroup("Locale"); 207 KPrefs::setCurrentGroup("Locale");
208 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 208 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
209 209
210 210
211 KPrefs::setCurrentGroup("Colors"); 211 KPrefs::setCurrentGroup("Colors");
212 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 212 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
213 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 213 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
214 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 214 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
215 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 215 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
216 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 216 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
217 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 217 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
218 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 218 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
219 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 219 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
220 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); 220 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
221 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 221 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
222 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 222 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
223 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 223 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
224 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 224 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
225 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 225 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
226 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 226 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
227 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 227 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
228 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 228 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
229 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 229 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
230 addItemBool("UseAppColors",&mUseAppColors,false); 230 addItemBool("UseAppColors",&mUseAppColors,false);
231 231
232 232
233 KPrefs::setCurrentGroup("Conflicts"); 233 KPrefs::setCurrentGroup("Conflicts");
234 addItemBool("EnableAutoDetect",&mDetectConflicts,true); 234 addItemBool("EnableAutoDetect",&mDetectConflicts,true);
235 addItemBool("CheckConflictsFree",&mIncludeFree,true);
235 addItemBool("CheckConflictsAllDayAllDay",&mCheckConflictsAllDayAllDay,false); 236 addItemBool("CheckConflictsAllDayAllDay",&mCheckConflictsAllDayAllDay,false);
236 addItemBool("CheckConflictsAllDayNonAD",&mCheckConflictsAllDayNonAD,false); 237 addItemBool("CheckConflictsAllDayNonAD",&mCheckConflictsAllDayNonAD,false);
237 addItemBool("CheckConflictsNonADAllDay",&mCheckConflictsNonADAllDay,false); 238 addItemBool("CheckConflictsNonADAllDay",&mCheckConflictsNonADAllDay,false);
238 addItemBool("CheckConflictsNonADNonAD",&mCheckConflictsNonADNonAD,true); 239 addItemBool("CheckConflictsNonADNonAD",&mCheckConflictsNonADNonAD,true);
239 addItemString("FilterConflictEditItem", &mFilterConflictEditItem ,"nofilter" ); 240 addItemString("FilterConflictEditItem", &mFilterConflictEditItem ,"nofilter" );
240 addItemString("FilterConflictAllItem", &mFilterConflictAllItem ,"nofilter" ); 241 addItemString("FilterConflictAllItem", &mFilterConflictAllItem ,"nofilter" );
241 242
242 KPrefs::setCurrentGroup("Views"); 243 KPrefs::setCurrentGroup("Views");
243 addItemBool("Block Popup Menu",&mBlockPopupMenu,false); 244 addItemBool("Block Popup Menu",&mBlockPopupMenu,false);
244 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 245 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
245 addItemInt("Hour Size",&mHourSize,8); 246 addItemInt("Hour Size",&mHourSize,8);
246 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 247 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
248 addItemBool("ShowLongAllday",&mLongAllday,true);
247 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 249 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
248 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 250 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
249 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 251 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
250 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 252 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
251 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 253 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
252 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); 254 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
253#ifdef DESKTOP_VERION 255#ifdef DESKTOP_VERION
254 addItemBool("Enable ToolTips",&mEnableToolTips,true); 256 addItemBool("Enable ToolTips",&mEnableToolTips,true);
255#else 257#else
256 addItemBool("Enable ToolTips",&mEnableToolTips,false); 258 addItemBool("Enable ToolTips",&mEnableToolTips,false);
257#endif 259#endif
258 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 260 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
259 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 261 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
260 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 262 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
261 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 263 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
262 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 264 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
263 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 265 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
264 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 266 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
265 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 267 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
266 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 268 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
267 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 269 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
268 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 270 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
269 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 271 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
270 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 272 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
271 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 273 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
272 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 274 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
273 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 275 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
274 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 276 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
275 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 277 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
276 addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false); 278 addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false);
277 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 279 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
278 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 280 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
279#ifdef DESKTOP_VERSION 281#ifdef DESKTOP_VERSION
280 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 282 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
281#else 283#else
282 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 284 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
283#endif 285#endif
284 addItemInt("Day Begins",&mDayBegins,7); 286 addItemInt("Day Begins",&mDayBegins,7);
285 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 287 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
286 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 288 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
287 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 289 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
288 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 290 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
289 291
290 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 292 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
291 addItemBool("Full View Month",&mFullViewMonth,true); 293 addItemBool("Full View Month",&mFullViewMonth,true);
292 addItemBool("Full View Todo",&mFullViewTodo,true); 294 addItemBool("Full View Todo",&mFullViewTodo,true);
293 addItemBool("Quick Todo",&mEnableQuickTodo,false); 295 addItemBool("Quick Todo",&mEnableQuickTodo,false);
294 296
295 addItemInt("Next X Days",&mNextXDays,3); 297 addItemInt("Next X Days",&mNextXDays,3);
296 298
297 KPrefs::setCurrentGroup("Printer"); 299 KPrefs::setCurrentGroup("Printer");
298 300
299 KPrefs::setCurrentGroup("Layout"); 301 KPrefs::setCurrentGroup("Layout");
300 302
301 addItemBool("CompactDialogs",&mCompactDialogs,false); 303 addItemBool("CompactDialogs",&mCompactDialogs,false);
302 addItemBool("VerticalScreen",&mVerticalScreen,true); 304 addItemBool("VerticalScreen",&mVerticalScreen,true);
303 305
304 KPrefs::setCurrentGroup("KOrganizer Plugins"); 306 KPrefs::setCurrentGroup("KOrganizer Plugins");
305 307
306 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 308 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
307 309
308 KPrefs::setCurrentGroup("Group Scheduling"); 310 KPrefs::setCurrentGroup("Group Scheduling");
309 311
310 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 312 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
311 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 313 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
312 addItemStringList("AdditionalMails",&mAdditionalMails,""); 314 addItemStringList("AdditionalMails",&mAdditionalMails,"");
313 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 315 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
314 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 316 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
315 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 317 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
316 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 318 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
317 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 319 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
318 320
319 KPrefs::setCurrentGroup( "Editors" ); 321 KPrefs::setCurrentGroup( "Editors" );
320 322
321 addItemStringList( "EventTemplates", &mEventTemplates ); 323 addItemStringList( "EventTemplates", &mEventTemplates );
322 addItemStringList( "TodoTemplates", &mTodoTemplates ); 324 addItemStringList( "TodoTemplates", &mTodoTemplates );
323 325
324 addItemInt("DestinationPolicy",&mDestination,standardDestination); 326 addItemInt("DestinationPolicy",&mDestination,standardDestination);
325 327
326 KPrefs::setCurrentGroup( "ViewOptions" ); 328 KPrefs::setCurrentGroup( "ViewOptions" );
327 addItemBool("EVshowDetails",&mEVshowDetails,true); 329 addItemBool("EVshowDetails",&mEVshowDetails,true);
328 addItemBool("EVshowCreated",&mEVshowCreated,true); 330 addItemBool("EVshowCreated",&mEVshowCreated,true);
329 addItemBool("EVshowChanged",&mEVshowChanged,true); 331 addItemBool("EVshowChanged",&mEVshowChanged,true);
330 addItemBool("WTshowDetails",&mWTshowDetails,false); 332 addItemBool("WTshowDetails",&mWTshowDetails,false);
331 addItemBool("WTshowCreated",&mWTshowCreated,false); 333 addItemBool("WTshowCreated",&mWTshowCreated,false);
332 addItemBool("WTshowChanged",&mWTshowChanged,false); 334 addItemBool("WTshowChanged",&mWTshowChanged,false);
333 mCalendars.setAutoDelete( true ); 335 mCalendars.setAutoDelete( true );
334} 336}
335 337
336 338
337KOPrefs::~KOPrefs() 339KOPrefs::~KOPrefs()
338{ 340{
339 if (mInstance == this) 341 if (mInstance == this)
340 mInstance = insd.setObject(0); 342 mInstance = insd.setObject(0);
341 mCalendars.setAutoDelete( true ); 343 mCalendars.setAutoDelete( true );
342 mCalendars.clear(); 344 mCalendars.clear();
343 //qDebug("KOPrefs::~KOPrefs() "); 345 //qDebug("KOPrefs::~KOPrefs() ");
344} 346}
345 347
346 348
347KOPrefs *KOPrefs::instance() 349KOPrefs *KOPrefs::instance()
348{ 350{
349 if (!mInstance) { 351 if (!mInstance) {
350 mInstance = insd.setObject(new KOPrefs()); 352 mInstance = insd.setObject(new KOPrefs());
351 mInstance->readConfig(); 353 mInstance->readConfig();
352 } 354 }
353 355
354 return mInstance; 356 return mInstance;
355} 357}
356 358
357void KOPrefs::usrSetDefaults() 359void KOPrefs::usrSetDefaults()
358{ 360{
359 361
360} 362}
361 363
362void KOPrefs::fillMailDefaults() 364void KOPrefs::fillMailDefaults()
363{ 365{
364 if (mName.isEmpty()) mName = i18n("Anonymous"); 366 if (mName.isEmpty()) mName = i18n("Anonymous");
365 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 367 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
366} 368}
367 369
368void KOPrefs::setTimeZoneIdDefault() 370void KOPrefs::setTimeZoneIdDefault()
369{ 371{
370 ; 372 ;
371} 373}
372 374
373void KOPrefs::setAllDefaults() 375void KOPrefs::setAllDefaults()
374{ 376{
375 setCategoryDefaults(); 377 setCategoryDefaults();
376 mEventSummaryUser = getDefaultList() ; 378 mEventSummaryUser = getDefaultList() ;
377 mTodoSummaryUser = getDefaultList() ; 379 mTodoSummaryUser = getDefaultList() ;
378 mJournalSummaryUser = getDefaultList() ; 380 mJournalSummaryUser = getDefaultList() ;
379 mLocationDefaults = getLocationDefaultList(); 381 mLocationDefaults = getLocationDefaultList();
380} 382}
381 383
382void KOPrefs::setCategoryDefaults() 384void KOPrefs::setCategoryDefaults()
383{ 385{
384 mCustomCategories.clear(); 386 mCustomCategories.clear();
385 mCustomCategories = getDefaultList(); 387 mCustomCategories = getDefaultList();
386 388
387 QStringList::Iterator it; 389 QStringList::Iterator it;
388 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 390 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
389 setCategoryColor(*it,mDefaultCategoryColor); 391 setCategoryColor(*it,mDefaultCategoryColor);
390 } 392 }
391} 393}
392QStringList KOPrefs::getLocationDefaultList() 394QStringList KOPrefs::getLocationDefaultList()
393{ 395{
394 QStringList retval ; 396 QStringList retval ;
395 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 397 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
396 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 398 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
397 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 399 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
398 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 400 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
399 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 401 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
400 402
401 retval.sort(); 403 retval.sort();
402 return retval; 404 return retval;
403} 405}
404QStringList KOPrefs::getDefaultList() 406QStringList KOPrefs::getDefaultList()
405{ 407{
406 QStringList retval ; 408 QStringList retval ;
407 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") 409 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer")
408 << i18n("Break") 410 << i18n("Break")
409 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") 411 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts")
410 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") 412 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts")
411 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") 413 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal")
412 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") 414 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping")
413 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") 415 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
414 << i18n("Vacation") ; 416 << i18n("Vacation") ;
415 retval.sort(); 417 retval.sort();
416 //qDebug("cat %s ", retval.join("-").latin1()); 418 //qDebug("cat %s ", retval.join("-").latin1());
417 return retval; 419 return retval;
418} 420}
419// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema") 421// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema")
420void KOPrefs::usrReadConfig() 422void KOPrefs::usrReadConfig()
421{ 423{
422 config()->setGroup("General"); 424 config()->setGroup("General");
423 425
424 //qDebug("KOPrefs::usrReadConfig() "); 426 //qDebug("KOPrefs::usrReadConfig() ");
425 mCustomCategories = config()->readListEntry("Custom Categories"); 427 mCustomCategories = config()->readListEntry("Custom Categories");
426 mOldLoadedLanguage = mOldLanguage ; 428 mOldLoadedLanguage = mOldLanguage ;
427 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 429 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
428 if (mLocationDefaults.isEmpty()) { 430 if (mLocationDefaults.isEmpty()) {
429 mLocationDefaults = getLocationDefaultList(); 431 mLocationDefaults = getLocationDefaultList();
430 } 432 }
431 433
432 if (mEventSummaryUser.isEmpty()) { 434 if (mEventSummaryUser.isEmpty()) {
433 mEventSummaryUser = getDefaultList() ; 435 mEventSummaryUser = getDefaultList() ;
434 } 436 }
435 if (mTodoSummaryUser.isEmpty()) { 437 if (mTodoSummaryUser.isEmpty()) {
436 mTodoSummaryUser = getDefaultList() ; 438 mTodoSummaryUser = getDefaultList() ;
437 } 439 }
438 440
439 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 441 if (mCustomCategories.isEmpty()) setCategoryDefaults();
440 442
441 config()->setGroup("Personal Settings"); 443 config()->setGroup("Personal Settings");
442 mName = config()->readEntry("user_name",""); 444 mName = config()->readEntry("user_name","");
443 mEmail = config()->readEntry("user_email",""); 445 mEmail = config()->readEntry("user_email","");
444 fillMailDefaults(); 446 fillMailDefaults();
445 447
446 config()->setGroup("Category Colors"); 448 config()->setGroup("Category Colors");
447 QStringList::Iterator it; 449 QStringList::Iterator it;
448 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 450 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
449 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 451 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
450 452
451 } 453 }
452 KConfig fc (locateLocal("config","kopicalendarrc")); 454 KConfig fc (locateLocal("config","kopicalendarrc"));
453 fc.setGroup("CC"); 455 fc.setGroup("CC");
454 int numCals = fc.readNumEntry("NumberCalendars",0 ); 456 int numCals = fc.readNumEntry("NumberCalendars",0 );
455 mNextAvailableCalendar = 1; 457 mNextAvailableCalendar = 1;
456 if ( numCals == 0 ) { 458 if ( numCals == 0 ) {
457 KopiCalendarFile *kkf = getNewCalendar(); 459 KopiCalendarFile *kkf = getNewCalendar();
458 kkf->isStandard = true; 460 kkf->isStandard = true;
459 kkf->mName = i18n("Standard"); 461 kkf->mName = i18n("Standard");
460 kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) ); 462 kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) );
461 } 463 }
462 while ( mNextAvailableCalendar <= numCals ) { 464 while ( mNextAvailableCalendar <= numCals ) {
463 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 465 //qDebug("Read cal #%d ", mNextAvailableCalendar );
464 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 466 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
465 KopiCalendarFile *kkf = getNewCalendar(); 467 KopiCalendarFile *kkf = getNewCalendar();
466 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 468 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
467 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 469 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
468 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); 470 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false );
469 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); 471 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
470 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); 472 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
471 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); 473 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
472 kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) ); 474 kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) );
473 kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) ); 475 kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) );
474 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); 476 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
475 if ( kkf->mCalNumber == 1 ) { 477 if ( kkf->mCalNumber == 1 ) {
476 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 478 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
477 } 479 }
478 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); 480 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
479 if ( kkf->mName == i18n("Birthdays") ) { 481 if ( kkf->mName == i18n("Birthdays") ) {
480 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); 482 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
481 } 483 }
482 if ( kkf->isRelative ) 484 if ( kkf->isRelative )
483 kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName ); 485 kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName );
484 } 486 }
485 487
486 KPimPrefs::usrReadConfig(); 488 KPimPrefs::usrReadConfig();
487} 489}
488 490
489KopiCalendarFile * KOPrefs::getCalendar( int num ) 491KopiCalendarFile * KOPrefs::getCalendar( int num )
490{ 492{
491 return mDefCalColors[num-1]; 493 return mDefCalColors[num-1];
492} 494}
493 495
494KopiCalendarFile * KOPrefs::getNewCalendar() 496KopiCalendarFile * KOPrefs::getNewCalendar()
495{ 497{
496 KopiCalendarFile * kkf = new KopiCalendarFile(); 498 KopiCalendarFile * kkf = new KopiCalendarFile();
497 kkf->mCalNumber = mNextAvailableCalendar; 499 kkf->mCalNumber = mNextAvailableCalendar;
498 mDefCalColors.resize( mNextAvailableCalendar ); 500 mDefCalColors.resize( mNextAvailableCalendar );
499 mDefCalColors[mNextAvailableCalendar-1] = kkf; 501 mDefCalColors[mNextAvailableCalendar-1] = kkf;
500 ++mNextAvailableCalendar; 502 ++mNextAvailableCalendar;
501 kkf->mDefaultColor = mEventColor; 503 kkf->mDefaultColor = mEventColor;
502 kkf->mName = i18n("New Calendar"); 504 kkf->mName = i18n("New Calendar");
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 576edf9..bac8010 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -1,374 +1,376 @@
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 KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <qdict.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qobject.h> 30#include <qobject.h>
31 31
32class KConfig; 32class KConfig;
33class QFont; 33class QFont;
34class QColor; 34class QColor;
35class QStringList; 35class QStringList;
36 36
37#define VIEW_WN_VIEW 1 37#define VIEW_WN_VIEW 1
38#define VIEW_NX_VIEW 2 38#define VIEW_NX_VIEW 2
39#define VIEW_J_VIEW 3 39#define VIEW_J_VIEW 3
40#define VIEW_A_VIEW 4 40#define VIEW_A_VIEW 4
41#define VIEW_ML_VIEW 5 41#define VIEW_ML_VIEW 5
42#define VIEW_M_VIEW 6 42#define VIEW_M_VIEW 6
43#define VIEW_L_VIEW 7 43#define VIEW_L_VIEW 7
44#define VIEW_T_VIEW 8 44#define VIEW_T_VIEW 8
45 45
46class KopiCalendarFile : public QObject 46class KopiCalendarFile : public QObject
47{ 47{
48 public: 48 public:
49 KopiCalendarFile( ) : QObject( ) 49 KopiCalendarFile( ) : QObject( )
50 { 50 {
51 isStandard = false; 51 isStandard = false;
52 isEnabled = true; 52 isEnabled = true;
53 isAlarmEnabled = true; 53 isAlarmEnabled = true;
54 isReadOnly = false; 54 isReadOnly = false;
55 mName = "Calendar"; 55 mName = "Calendar";
56 mFileName = QDir::homeDirPath() + "/icalfile.ics"; 56 mFileName = QDir::homeDirPath() + "/icalfile.ics";
57 mSavedFileName = "icalfile.ics"; 57 mSavedFileName = "icalfile.ics";
58 mCalNumber = 0; 58 mCalNumber = 0;
59 mDefaultColor = Qt::red; 59 mDefaultColor = Qt::red;
60 mErrorOnLoad = false; 60 mErrorOnLoad = false;
61 isRelative = false; 61 isRelative = false;
62 } 62 }
63 bool isStandard; 63 bool isStandard;
64 bool isEnabled; 64 bool isEnabled;
65 bool isAlarmEnabled; 65 bool isAlarmEnabled;
66 bool isReadOnly; 66 bool isReadOnly;
67 bool mErrorOnLoad; 67 bool mErrorOnLoad;
68 QString mName; 68 QString mName;
69 QString mFileName; 69 QString mFileName;
70 QString mSavedFileName; 70 QString mSavedFileName;
71 bool isRelative; 71 bool isRelative;
72 int mCalNumber; 72 int mCalNumber;
73 QColor mDefaultColor; 73 QColor mDefaultColor;
74 QDateTime mLoadDt; 74 QDateTime mLoadDt;
75}; 75};
76class KOPrefs : public KPimPrefs 76class KOPrefs : public KPimPrefs
77{ 77{
78 public: 78 public:
79 enum { FormatVCalendar, FormatICalendar }; 79 enum { FormatVCalendar, FormatICalendar };
80 enum { MailClientKMail, MailClientSendmail }; 80 enum { MailClientKMail, MailClientSendmail };
81 enum { IMIPDummy, IMIPKMail }; 81 enum { IMIPDummy, IMIPKMail };
82 enum { IMIPOutbox, IMIPdirectsend }; 82 enum { IMIPOutbox, IMIPdirectsend };
83 enum { neverAuto, addressbookAuto, selectedAuto }; 83 enum { neverAuto, addressbookAuto, selectedAuto };
84 enum { standardDestination, askDestination }; 84 enum { standardDestination, askDestination };
85 85
86 virtual ~KOPrefs(); 86 virtual ~KOPrefs();
87 87
88 /** Get instance of KOPrefs. It is made sure that there is only one 88 /** Get instance of KOPrefs. It is made sure that there is only one
89 instance. */ 89 instance. */
90 static KOPrefs *instance(); 90 static KOPrefs *instance();
91 91
92 /** Set preferences to default values */ 92 /** Set preferences to default values */
93 void usrSetDefaults(); 93 void usrSetDefaults();
94 94
95 /** Read preferences from config file */ 95 /** Read preferences from config file */
96 void usrReadConfig(); 96 void usrReadConfig();
97 97
98 /** Write preferences to config file */ 98 /** Write preferences to config file */
99 void usrWriteConfig(); 99 void usrWriteConfig();
100 void setCategoryDefaults(); 100 void setCategoryDefaults();
101 void setAllDefaults(); 101 void setAllDefaults();
102 KopiCalendarFile * getNewCalendar(); 102 KopiCalendarFile * getNewCalendar();
103 KopiCalendarFile * getCalendar( int ); 103 KopiCalendarFile * getCalendar( int );
104 void deleteCalendar( int ); 104 void deleteCalendar( int );
105 QColor defaultColor( int ) const; 105 QColor defaultColor( int ) const;
106 QString calName( int ) const; 106 QString calName( int ) const;
107 int getCalendarID( const QString & name ); 107 int getCalendarID( const QString & name );
108 protected: 108 protected:
109 void setTimeZoneIdDefault(); 109 void setTimeZoneIdDefault();
110 110
111 /** Fill empty mail fields with default values. */ 111 /** Fill empty mail fields with default values. */
112 void fillMailDefaults(); 112 void fillMailDefaults();
113 113
114 private: 114 private:
115 /** Constructor disabled for public. Use instance() to create a KOPrefs 115 /** Constructor disabled for public. Use instance() to create a KOPrefs
116 object. */ 116 object. */
117 KOPrefs(); 117 KOPrefs();
118 118
119 static KOPrefs *mInstance; 119 static KOPrefs *mInstance;
120 QStringList getDefaultList(); 120 QStringList getDefaultList();
121 QStringList getLocationDefaultList(); 121 QStringList getLocationDefaultList();
122 public: 122 public:
123 // preferences data 123 // preferences data
124 KConfig* getConfig(); 124 KConfig* getConfig();
125 void setFullName(const QString &); 125 void setFullName(const QString &);
126 QString fullName(); 126 QString fullName();
127 void setEmail(const QString &); 127 void setEmail(const QString &);
128 QString email(); 128 QString email();
129 129
130 QString mAdditional; 130 QString mAdditional;
131 131
132 bool mEmailControlCenter; 132 bool mEmailControlCenter;
133 133
134 bool mBcc; 134 bool mBcc;
135 bool mAutoSave; 135 bool mAutoSave;
136 int mAutoSaveInterval; 136 int mAutoSaveInterval;
137 bool mConfirm; 137 bool mConfirm;
138 138
139 bool mEnableGroupScheduling; 139 bool mEnableGroupScheduling;
140 bool mEnableProjectView; 140 bool mEnableProjectView;
141 141
142 int mDefaultFormat; 142 int mDefaultFormat;
143 int mMailClient; 143 int mMailClient;
144 144
145 int mStartTime; 145 int mStartTime;
146 int mDefaultDuration; 146 int mDefaultDuration;
147 int mAlarmTime; 147 int mAlarmTime;
148 148
149 int mWorkingHoursStart; 149 int mWorkingHoursStart;
150 int mWorkingHoursEnd; 150 int mWorkingHoursEnd;
151 bool mExcludeHolidays; 151 bool mExcludeHolidays;
152 bool mExcludeSaturdays; 152 bool mExcludeSaturdays;
153 bool mMarcusBainsShowSeconds; 153 bool mMarcusBainsShowSeconds;
154 154
155 QFont mTimeBarFont; 155 QFont mTimeBarFont;
156 QFont mMonthViewFont; 156 QFont mMonthViewFont;
157 QFont mAgendaViewFont; 157 QFont mAgendaViewFont;
158 QFont mMarcusBainsFont; 158 QFont mMarcusBainsFont;
159 QFont mTimeLabelsFont; 159 QFont mTimeLabelsFont;
160 QFont mTodoViewFont; 160 QFont mTodoViewFont;
161 QFont mListViewFont; 161 QFont mListViewFont;
162 QFont mDateNavigatorFont; 162 QFont mDateNavigatorFont;
163 QFont mEditBoxFont; 163 QFont mEditBoxFont;
164 QFont mJornalViewFont; 164 QFont mJornalViewFont;
165 QFont mWhatsNextFont; 165 QFont mWhatsNextFont;
166 QFont mEventViewFont; 166 QFont mEventViewFont;
167 167
168 168
169 169
170 170
171 QColor mHolidayColor; 171 QColor mHolidayColor;
172 QColor mHighlightColor; 172 QColor mHighlightColor;
173 QColor mEventColor; 173 QColor mEventColor;
174 QColor mTodoDoneColor; 174 QColor mTodoDoneColor;
175 QColor mAgendaBgColor; 175 QColor mAgendaBgColor;
176 QColor mWorkingHoursColor; 176 QColor mWorkingHoursColor;
177 QColor mTodoDueTodayColor; 177 QColor mTodoDueTodayColor;
178 QColor mTodoOverdueColor; 178 QColor mTodoOverdueColor;
179 QColor mTodoRunColor; 179 QColor mTodoRunColor;
180 QColor mMonthViewEvenColor; 180 QColor mMonthViewEvenColor;
181 QColor mMonthViewOddColor; 181 QColor mMonthViewOddColor;
182 QColor mMonthViewHolidayColor; 182 QColor mMonthViewHolidayColor;
183 bool mMonthViewUsesDayColors; 183 bool mMonthViewUsesDayColors;
184 bool mMonthViewSatSunTog; 184 bool mMonthViewSatSunTog;
185 bool mMonthViewWeek; 185 bool mMonthViewWeek;
186 bool mMonthViewWeekRowlayout; 186 bool mMonthViewWeekRowlayout;
187 QColor mAppColor1; 187 QColor mAppColor1;
188 QColor mAppColor2; 188 QColor mAppColor2;
189 bool mUseAppColors; 189 bool mUseAppColors;
190 190
191 int mDayBegins; 191 int mDayBegins;
192 int mHourSize; 192 int mHourSize;
193 int mAllDaySize; 193 int mAllDaySize;
194 bool mShowFullMenu; 194 bool mShowFullMenu;
195 bool mDailyRecur; 195 bool mDailyRecur;
196 bool mWeeklyRecur; 196 bool mWeeklyRecur;
197 bool mLongAllday;
197 bool mMonthDailyRecur; 198 bool mMonthDailyRecur;
198 bool mMonthWeeklyRecur; 199 bool mMonthWeeklyRecur;
199 bool mMonthShowIcons; 200 bool mMonthShowIcons;
200 bool mMonthShowTimes; 201 bool mMonthShowTimes;
201 bool mMonthShowShort; 202 bool mMonthShowShort;
202 bool mEnableToolTips; 203 bool mEnableToolTips;
203 bool mEnableMonthScroll; 204 bool mEnableMonthScroll;
204 bool mFullViewMonth; 205 bool mFullViewMonth;
205 bool mMonthViewUsesCategoryColor; 206 bool mMonthViewUsesCategoryColor;
206 bool mFullViewTodo; 207 bool mFullViewTodo;
207 bool mShowCompletedTodo; 208 bool mShowCompletedTodo;
208 bool mMarcusBainsEnabled; 209 bool mMarcusBainsEnabled;
209 int mNextXDays; 210 int mNextXDays;
210 int mWhatsNextDays; 211 int mWhatsNextDays;
211 bool mWhatsNextTime2Lines; 212 bool mWhatsNextTime2Lines;
212 int mWhatsNextPrios; 213 int mWhatsNextPrios;
213 bool mEnableQuickTodo; 214 bool mEnableQuickTodo;
214 215
215 bool mCompactDialogs; 216 bool mCompactDialogs;
216 bool mVerticalScreen; 217 bool mVerticalScreen;
217 218
218 bool mShowIconNewTodo; 219 bool mShowIconNewTodo;
219 bool mShowIconNewEvent; 220 bool mShowIconNewEvent;
220 bool mShowIconSearch; 221 bool mShowIconSearch;
221 bool mShowIconList; 222 bool mShowIconList;
222 bool mShowIconDay1; 223 bool mShowIconDay1;
223 bool mShowIconDay5; 224 bool mShowIconDay5;
224 bool mShowIconDay6; 225 bool mShowIconDay6;
225 bool mShowIconDay7; 226 bool mShowIconDay7;
226 bool mShowIconMonth; 227 bool mShowIconMonth;
227 bool mShowIconTodoview; 228 bool mShowIconTodoview;
228 bool mShowIconBackFast; 229 bool mShowIconBackFast;
229 bool mShowIconBack; 230 bool mShowIconBack;
230 bool mShowIconToday; 231 bool mShowIconToday;
231 bool mShowIconForward; 232 bool mShowIconForward;
232 bool mShowIconForwardFast; 233 bool mShowIconForwardFast;
233 bool mShowIconWhatsThis; 234 bool mShowIconWhatsThis;
234 bool mShowIconWeekNum; 235 bool mShowIconWeekNum;
235 bool mShowIconNextDays; 236 bool mShowIconNextDays;
236 bool mShowIconNext; 237 bool mShowIconNext;
237 bool mShowIconJournal; 238 bool mShowIconJournal;
238 bool mShowIconFilter; 239 bool mShowIconFilter;
239 bool mShowIconOnetoolbar; 240 bool mShowIconOnetoolbar;
240 bool mShowIconNavigator; 241 bool mShowIconNavigator;
241 bool mShowIconAllday; 242 bool mShowIconAllday;
242 bool mShowIconFilterview; 243 bool mShowIconFilterview;
243 bool mShowIconToggleFull; 244 bool mShowIconToggleFull;
244 245
245 bool mShowIconStretch; 246 bool mShowIconStretch;
246 247
247 bool mToolBarHor; 248 bool mToolBarHor;
248 bool mToolBarUp; 249 bool mToolBarUp;
249 bool mToolBarHorV; 250 bool mToolBarHorV;
250 bool mToolBarUpV; 251 bool mToolBarUpV;
251 bool mToolBarHorN; 252 bool mToolBarHorN;
252 bool mToolBarUpN; 253 bool mToolBarUpN;
253 bool mToolBarHorF; 254 bool mToolBarHorF;
254 bool mToolBarUpF; 255 bool mToolBarUpF;
255 bool mToolBarMiniIcons; 256 bool mToolBarMiniIcons;
256 257
257 bool mAskForQuit; 258 bool mAskForQuit;
258 bool mUsePassWd; 259 bool mUsePassWd;
259 bool mShowSyncEvents; 260 bool mShowSyncEvents;
260 bool mShowTodoInAgenda; 261 bool mShowTodoInAgenda;
261 bool mShowCompletedTodoInAgenda; 262 bool mShowCompletedTodoInAgenda;
262 bool mShowTimeInAgenda; 263 bool mShowTimeInAgenda;
263 bool mHideNonStartedTodos; 264 bool mHideNonStartedTodos;
264 265
265 bool mBlockPopupMenu; 266 bool mBlockPopupMenu;
266 267
267 int mLastSyncTime; 268 int mLastSyncTime;
268 void setCategoryColor(QString cat,const QColor & color); 269 void setCategoryColor(QString cat,const QColor & color);
269 QColor *categoryColor(QString cat); 270 QColor *categoryColor(QString cat);
270 271
271 QString mArchiveFile; 272 QString mArchiveFile;
272 QString mHtmlExportFile; 273 QString mHtmlExportFile;
273 bool mHtmlWithSave; 274 bool mHtmlWithSave;
274 275
275 QStringList mSelectedPlugins; 276 QStringList mSelectedPlugins;
276 277
277 QString mLastImportFile; 278 QString mLastImportFile;
278 QString mLastVcalFile; 279 QString mLastVcalFile;
279 QString mLastSaveFile; 280 QString mLastSaveFile;
280 QString mLastLoadFile; 281 QString mLastLoadFile;
281 282
282 283
283 QString mDefaultAlarmFile; 284 QString mDefaultAlarmFile;
284 int mIMIPScheduler; 285 int mIMIPScheduler;
285 int mIMIPSend; 286 int mIMIPSend;
286 QStringList mAdditionalMails; 287 QStringList mAdditionalMails;
287 int mIMIPAutoRefresh; 288 int mIMIPAutoRefresh;
288 int mIMIPAutoInsertReply; 289 int mIMIPAutoInsertReply;
289 int mIMIPAutoInsertRequest; 290 int mIMIPAutoInsertRequest;
290 int mIMIPAutoFreeBusy; 291 int mIMIPAutoFreeBusy;
291 int mIMIPAutoFreeBusyReply; 292 int mIMIPAutoFreeBusyReply;
292 293
293 QStringList mTodoTemplates; 294 QStringList mTodoTemplates;
294 QStringList mEventTemplates; 295 QStringList mEventTemplates;
295 296
296 int mDestination; 297 int mDestination;
297 298
298 299
299 bool mEditOnDoubleClick; 300 bool mEditOnDoubleClick;
300 bool mViewChangeHoldFullscreen; 301 bool mViewChangeHoldFullscreen;
301 bool mViewChangeHoldNonFullscreen; 302 bool mViewChangeHoldNonFullscreen;
302 bool mCenterOnCurrentTime; 303 bool mCenterOnCurrentTime;
303 bool mSetTimeToDayStartAt; 304 bool mSetTimeToDayStartAt;
304 bool mHighlightCurrentDay; 305 bool mHighlightCurrentDay;
305 bool mUseHighlightLightColor; 306 bool mUseHighlightLightColor;
306 bool mListViewMonthTimespan; 307 bool mListViewMonthTimespan;
307 bool mWNViewShowsParents; 308 bool mWNViewShowsParents;
308 bool mWNViewShowsPast; 309 bool mWNViewShowsPast;
309 bool mWNViewShowLocation; 310 bool mWNViewShowLocation;
310 bool mTodoViewShowsPercentage; 311 bool mTodoViewShowsPercentage;
311 bool mTodoViewUsesCatColors; 312 bool mTodoViewUsesCatColors;
312 bool mMonthViewUsesBigFont; 313 bool mMonthViewUsesBigFont;
313 bool mTodoViewUsesSmallFont; 314 bool mTodoViewUsesSmallFont;
314 bool mTodoViewUsesForegroundColor; 315 bool mTodoViewUsesForegroundColor;
315 bool mMonthViewUsesForegroundColor; 316 bool mMonthViewUsesForegroundColor;
316 317
317 bool mHightlightDateTimeEdit; 318 bool mHightlightDateTimeEdit;
318 bool mShortDateInViewer; 319 bool mShortDateInViewer;
319 320
320 bool mShowDateNavigator; 321 bool mShowDateNavigator;
321 322
322 QStringList mLocationDefaults; 323 QStringList mLocationDefaults;
323 QStringList mEventSummaryUser; 324 QStringList mEventSummaryUser;
324 QStringList mTodoSummaryUser; 325 QStringList mTodoSummaryUser;
325 QStringList mJournalSummaryUser; 326 QStringList mJournalSummaryUser;
326 327
327 bool mUseInternalAlarmNotification; 328 bool mUseInternalAlarmNotification;
328 int mAlarmPlayBeeps; 329 int mAlarmPlayBeeps;
329 int mAlarmSuspendTime; 330 int mAlarmSuspendTime;
330 int mAlarmSuspendCount; 331 int mAlarmSuspendCount;
331 int mAlarmBeepInterval; 332 int mAlarmBeepInterval;
332 int mOldLanguage; 333 int mOldLanguage;
333 int mOldLoadedLanguage; 334 int mOldLoadedLanguage;
334 335
335 336
336 QString mActiveSyncPort; 337 QString mActiveSyncPort;
337 QString mActiveSyncIP; 338 QString mActiveSyncIP;
338 339
339 // settings for eventviewer 340 // settings for eventviewer
340 bool mEVshowDetails; 341 bool mEVshowDetails;
341 bool mEVshowCreated; 342 bool mEVshowCreated;
342 bool mEVshowChanged; 343 bool mEVshowChanged;
343 bool mWTshowDetails; 344 bool mWTshowDetails;
344 bool mWTshowCreated; 345 bool mWTshowCreated;
345 bool mWTshowChanged; 346 bool mWTshowChanged;
346 347
347 int mCurrentDisplayedView; 348 int mCurrentDisplayedView;
348 QPtrList<KopiCalendarFile> mCalendars; 349 QPtrList<KopiCalendarFile> mCalendars;
349 int mNextAvailableCalendar; 350 int mNextAvailableCalendar;
350 bool mGlobalUpdateDisabled; 351 bool mGlobalUpdateDisabled;
351 352
352 353
353 bool mDetectConflicts; 354 bool mDetectConflicts;
355 bool mIncludeFree;
354 bool mCheckConflictsAllDayAllDay; 356 bool mCheckConflictsAllDayAllDay;
355 bool mCheckConflictsAllDayNonAD; 357 bool mCheckConflictsAllDayNonAD;
356 bool mCheckConflictsNonADAllDay; 358 bool mCheckConflictsNonADAllDay;
357 bool mCheckConflictsNonADNonAD; 359 bool mCheckConflictsNonADNonAD;
358 QString mFilterConflictEditItem; 360 QString mFilterConflictEditItem;
359 QString mFilterConflictAllItem; 361 QString mFilterConflictAllItem;
360 362
361 private: 363 private:
362 QDict<QColor> mCategoryColors; 364 QDict<QColor> mCategoryColors;
363 QArray<KopiCalendarFile*> mDefCalColors; 365 QArray<KopiCalendarFile*> mDefCalColors;
364 QColor mDefaultCategoryColor; 366 QColor mDefaultCategoryColor;
365 367
366 QFont mDefaultTimeBarFont; 368 QFont mDefaultTimeBarFont;
367 QFont mDefaultViewFont; 369 QFont mDefaultViewFont;
368 QFont mDefaultMonthViewFont; 370 QFont mDefaultMonthViewFont;
369 371
370 QString mName; 372 QString mName;
371 QString mEmail; 373 QString mEmail;
372}; 374};
373 375
374#endif 376#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index bbdf508..f1a6c3d 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -325,874 +325,883 @@ void KOPrefsDialog::setupMainTab()
325 325
326 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 326 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
327 327
328 328
329 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 329 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
330 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 330 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
331 */ 331 */
332 332
333 333
334 KPrefsDialogWidBool *ask = 334 KPrefsDialogWidBool *ask =
335 addWidBool(i18n("Ask for quit when closing KO/Pi"), 335 addWidBool(i18n("Ask for quit when closing KO/Pi"),
336 &(KOPrefs::instance()->mAskForQuit),topFrame); 336 &(KOPrefs::instance()->mAskForQuit),topFrame);
337 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); 337 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1);
338 ++iii; 338 ++iii;
339 339
340 340
341 /* 341 /*
342 KPrefsDialogWidBool *confirmCheck = 342 KPrefsDialogWidBool *confirmCheck =
343 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 343 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
344 topFrame); 344 topFrame);
345 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 345 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
346 346
347 347
348 mEnableGroupScheduling = 348 mEnableGroupScheduling =
349 addWidBool(i18n("Enable group scheduling"), 349 addWidBool(i18n("Enable group scheduling"),
350 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 350 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
351 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 351 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
352 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 352 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
353 SLOT(warningGroupScheduling())); 353 SLOT(warningGroupScheduling()));
354 354
355 mEnableProjectView = 355 mEnableProjectView =
356 addWidBool(i18n("Enable project view"), 356 addWidBool(i18n("Enable project view"),
357 &(KOPrefs::instance()->mEnableProjectView),topFrame); 357 &(KOPrefs::instance()->mEnableProjectView),topFrame);
358 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 358 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
359 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 359 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
360 SLOT(warningProjectView())); 360 SLOT(warningProjectView()));
361 361
362 // Can't be disabled anymore 362 // Can't be disabled anymore
363 mEnableGroupScheduling->checkBox()->hide(); 363 mEnableGroupScheduling->checkBox()->hide();
364 364
365 // Disable setting, because this feature now becomes stable 365 // Disable setting, because this feature now becomes stable
366 mEnableProjectView->checkBox()->hide(); 366 mEnableProjectView->checkBox()->hide();
367 367
368 KPrefsDialogWidRadios *defaultFormatGroup = 368 KPrefsDialogWidRadios *defaultFormatGroup =
369 addWidRadios(i18n("Default Calendar Format"), 369 addWidRadios(i18n("Default Calendar Format"),
370 &(KOPrefs::instance()->mDefaultFormat),topFrame); 370 &(KOPrefs::instance()->mDefaultFormat),topFrame);
371 defaultFormatGroup->addRadio(i18n("vCalendar")); 371 defaultFormatGroup->addRadio(i18n("vCalendar"));
372 defaultFormatGroup->addRadio(i18n("iCalendar")); 372 defaultFormatGroup->addRadio(i18n("iCalendar"));
373 373
374 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 374 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
375 375
376 // Default format unconditionally is iCalendar 376 // Default format unconditionally is iCalendar
377 defaultFormatGroup->groupBox()->hide(); 377 defaultFormatGroup->groupBox()->hide();
378 378
379 KPrefsDialogWidRadios *mailClientGroup = 379 KPrefsDialogWidRadios *mailClientGroup =
380 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 380 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
381 topFrame); 381 topFrame);
382 mailClientGroup->addRadio(i18n("KMail")); 382 mailClientGroup->addRadio(i18n("KMail"));
383 mailClientGroup->addRadio(i18n("Sendmail")); 383 mailClientGroup->addRadio(i18n("Sendmail"));
384 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 384 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
385 385
386 KPrefsDialogWidBool *htmlsave = 386 KPrefsDialogWidBool *htmlsave =
387 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 387 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
388 topFrame); 388 topFrame);
389 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 389 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
390 390
391 KPrefsDialogWidRadios *destinationGroup = 391 KPrefsDialogWidRadios *destinationGroup =
392 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 392 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
393 topFrame); 393 topFrame);
394 destinationGroup->addRadio(i18n("be added to the standard resource")); 394 destinationGroup->addRadio(i18n("be added to the standard resource"));
395 destinationGroup->addRadio(i18n("be asked which resource to use")); 395 destinationGroup->addRadio(i18n("be asked which resource to use"));
396 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 396 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
397 397
398 topLayout->setRowStretch(14,1); 398 topLayout->setRowStretch(14,1);
399 */ 399 */
400} 400}
401 401
402 402
403void KOPrefsDialog::setupTimeTab() 403void KOPrefsDialog::setupTimeTab()
404{ 404{
405 QFrame *topFrame = addPage(i18n("Time"),0,0); 405 QFrame *topFrame = addPage(i18n("Time"),0,0);
406 // DesktopIcon("clock",KIcon::SizeMedium)); 406 // DesktopIcon("clock",KIcon::SizeMedium));
407 407
408 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 408 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
409 topLayout->setSpacing(mSpacingHint); 409 topLayout->setSpacing(mSpacingHint);
410 topLayout->setMargin(mMarginHint); 410 topLayout->setMargin(mMarginHint);
411 411
412 QHBox *dummy = new QHBox(topFrame); 412 QHBox *dummy = new QHBox(topFrame);
413 KPrefsDialogWidTime *dayBegins = 413 KPrefsDialogWidTime *dayBegins =
414 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 414 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
415 dummy); 415 dummy);
416 //topLayout->addWidget(dayBegins->label(),2,0); 416 //topLayout->addWidget(dayBegins->label(),2,0);
417 417
418 //topLayout->addWidget(dayBegins->spinBox(),2,1); 418 //topLayout->addWidget(dayBegins->spinBox(),2,1);
419 topLayout->addMultiCellWidget(dummy,0,0,0,1); 419 topLayout->addMultiCellWidget(dummy,0,0,0,1);
420 420
421 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 421 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
422 topFrame),1,0); 422 topFrame),1,0);
423 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 423 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
424 mStartTimeSpin->setSuffix(":00"); 424 mStartTimeSpin->setSuffix(":00");
425 topLayout->addWidget(mStartTimeSpin,1,1); 425 topLayout->addWidget(mStartTimeSpin,1,1);
426 426
427 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 427 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
428 topFrame),2,0); 428 topFrame),2,0);
429 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 429 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
430 mDefaultDurationSpin->setSuffix(":00"); 430 mDefaultDurationSpin->setSuffix(":00");
431 topLayout->addWidget(mDefaultDurationSpin,2,1); 431 topLayout->addWidget(mDefaultDurationSpin,2,1);
432 432
433 QStringList alarmList; 433 QStringList alarmList;
434 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 434 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
435 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 435 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
436 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 436 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
437 3,0); 437 3,0);
438 mAlarmTimeCombo = new QComboBox(topFrame); 438 mAlarmTimeCombo = new QComboBox(topFrame);
439 mAlarmTimeCombo->insertStringList(alarmList); 439 mAlarmTimeCombo->insertStringList(alarmList);
440 topLayout->addWidget(mAlarmTimeCombo,3,1); 440 topLayout->addWidget(mAlarmTimeCombo,3,1);
441 int iii = 4; 441 int iii = 4;
442 if ( QApplication::desktop()->height() <= 240 ) { 442 if ( QApplication::desktop()->height() <= 240 ) {
443 topFrame = addPage(i18n("Time") +" 2",0,0); 443 topFrame = addPage(i18n("Time") +" 2",0,0);
444 topLayout = new QGridLayout(topFrame,1,2); 444 topLayout = new QGridLayout(topFrame,1,2);
445 topLayout->setSpacing(2); 445 topLayout->setSpacing(2);
446 topLayout->setMargin(3); 446 topLayout->setMargin(3);
447 iii = 0; 447 iii = 0;
448 } 448 }
449 449
450 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 450 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
451 i18n("Working Hours"), 451 i18n("Working Hours"),
452 topFrame); 452 topFrame);
453 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); 453 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1);
454 workingHoursGroup->layout()->setSpacing( 0 ); 454 workingHoursGroup->layout()->setSpacing( 0 );
455 workingHoursGroup->layout()->setMargin( 4 ); 455 workingHoursGroup->layout()->setMargin( 4 );
456 QHBox *workStartBox = new QHBox(workingHoursGroup); 456 QHBox *workStartBox = new QHBox(workingHoursGroup);
457 // workStartBox->setMargin( 0 ); 457 // workStartBox->setMargin( 0 );
458 addWidTime(i18n("Daily starting hour:"), 458 addWidTime(i18n("Daily starting hour:"),
459 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 459 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
460 460
461 QHBox *workEndBox = new QHBox(workingHoursGroup); 461 QHBox *workEndBox = new QHBox(workingHoursGroup);
462 //workEndBox->setMargin( 0 ); 462 //workEndBox->setMargin( 0 );
463 addWidTime(i18n("Daily ending hour:"), 463 addWidTime(i18n("Daily ending hour:"),
464 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 464 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
465 QVBox *excludeBox = new QVBox(workingHoursGroup); 465 QVBox *excludeBox = new QVBox(workingHoursGroup);
466 //excludeBox->setMargin( 0 ); 466 //excludeBox->setMargin( 0 );
467 addWidBool(i18n("Exclude holidays"), 467 addWidBool(i18n("Exclude holidays"),
468 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 468 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
469 469
470 addWidBool(i18n("Exclude Saturdays"), 470 addWidBool(i18n("Exclude Saturdays"),
471 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 471 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
472 472
473// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 473// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
474 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 474 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
475 // topFrame); 475 // topFrame);
476// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 476// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
477 477
478 // topLayout->setRowStretch(6,1); 478 // topLayout->setRowStretch(6,1);
479} 479}
480 480
481 481
482void KOPrefsDialog::setupViewsTab() 482void KOPrefsDialog::setupViewsTab()
483{ 483{
484 484
485 QFrame *topFrame = addPage(i18n("Views"),0,0); 485 QFrame *topFrame = addPage(i18n("Views"),0,0);
486 // DesktopIcon("viewmag",KIcon::SizeMedium)); 486 // DesktopIcon("viewmag",KIcon::SizeMedium));
487 487
488 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 488 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
489 topLayout->setSpacing(mSpacingHint); 489 topLayout->setSpacing(mSpacingHint);
490 topLayout->setMargin(mMarginHint); 490 topLayout->setMargin(mMarginHint);
491 491
492// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 492// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
493// topLayout->addLayout(dayBeginsLayout,0,0); 493// topLayout->addLayout(dayBeginsLayout,0,0);
494 494
495// KPrefsDialogWidTime *dayBegins = 495// KPrefsDialogWidTime *dayBegins =
496// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 496// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
497// topFrame); 497// topFrame);
498// dayBeginsLayout->addWidget(dayBegins->label()); 498// dayBeginsLayout->addWidget(dayBegins->label());
499// dayBeginsLayout->addStretch(1); 499// dayBeginsLayout->addStretch(1);
500// dayBeginsLayout->addWidget(dayBegins->spinBox()); 500// dayBeginsLayout->addWidget(dayBegins->spinBox());
501 501
502// QBoxLayout *nextDaysLayout = new QHBoxLayout; 502// QBoxLayout *nextDaysLayout = new QHBoxLayout;
503// topLayout->addLayout(nextDaysLayout,1,0); 503// topLayout->addLayout(nextDaysLayout,1,0);
504// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 504// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
505// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 505// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
506// nextDaysLayout->addStretch(1); 506// nextDaysLayout->addStretch(1);
507// nextDaysLayout->addWidget(mNextXDaysSpin); 507// nextDaysLayout->addWidget(mNextXDaysSpin);
508 508
509 509
510 int ii = 0; 510 int ii = 0;
511 KPrefsDialogWidBool *dummy = 511 KPrefsDialogWidBool *dummy =
512 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 512 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
513 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 513 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
514 topLayout->addWidget(dummy->checkBox(),ii++,0); 514 topLayout->addWidget(dummy->checkBox(),ii++,0);
515 515
516 516
517 517
518 518
519 519
520 520
521 // topLayout->addWidget(hourSizeGroup,ii++,0); 521 // topLayout->addWidget(hourSizeGroup,ii++,0);
522 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 522 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
523 //topLayout->setRowStretch(11,1); 523 //topLayout->setRowStretch(11,1);
524 524
525 525
526 526
527 527
528#if 0 528#if 0
529 529
530 topFrame = addPage(i18n("ViewChange"),0,0); 530 topFrame = addPage(i18n("ViewChange"),0,0);
531 // DesktopIcon("viewmag",KIcon::SizeMedium)); 531 // DesktopIcon("viewmag",KIcon::SizeMedium));
532 532
533 topLayout = new QGridLayout(topFrame,6,1); 533 topLayout = new QGridLayout(topFrame,6,1);
534 topLayout->setSpacing(mSpacingHint); 534 topLayout->setSpacing(mSpacingHint);
535 topLayout->setMargin(mMarginHint); 535 topLayout->setMargin(mMarginHint);
536 ii = 0; 536 ii = 0;
537 537
538#endif 538#endif
539 539
540 dummy = 540 dummy =
541 addWidBool(i18n("Hold fullscreen on view change"), 541 addWidBool(i18n("Hold fullscreen on view change"),
542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
543 topLayout->addWidget(dummy->checkBox(),ii++,0); 543 topLayout->addWidget(dummy->checkBox(),ii++,0);
544 544
545 dummy = 545 dummy =
546 addWidBool(i18n("Hold non-fullscreen on view change"), 546 addWidBool(i18n("Hold non-fullscreen on view change"),
547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
548 topLayout->addWidget(dummy->checkBox(),ii++,0); 548 topLayout->addWidget(dummy->checkBox(),ii++,0);
549 549
550 550
551 551
552 KPrefsDialogWidBool *fullViewMonth = 552 KPrefsDialogWidBool *fullViewMonth =
553 addWidBool(i18n("Next days view uses full window"), 553 addWidBool(i18n("Next days view uses full window"),
554 &(KOPrefs::instance()->mFullViewMonth),topFrame); 554 &(KOPrefs::instance()->mFullViewMonth),topFrame);
555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
556 556
557 557
558 KPrefsDialogWidBool *fullViewTodo = 558 KPrefsDialogWidBool *fullViewTodo =
559 addWidBool(i18n("Event list view uses full window"), 559 addWidBool(i18n("Event list view uses full window"),
560 &(KOPrefs::instance()->mFullViewTodo),topFrame); 560 &(KOPrefs::instance()->mFullViewTodo),topFrame);
561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
562 dummy = 562 dummy =
563 addWidBool(i18n("Listview uses monthly timespan"), 563 addWidBool(i18n("Listview uses monthly timespan"),
564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
565 topLayout->addWidget(dummy->checkBox(),ii++,0); 565 topLayout->addWidget(dummy->checkBox(),ii++,0);
566 dummy = 566 dummy =
567 addWidBool(i18n("Highlight selection in Time Edit"), 567 addWidBool(i18n("Highlight selection in Time Edit"),
568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
569 topLayout->addWidget( dummy->checkBox(), ii++,0); 569 topLayout->addWidget( dummy->checkBox(), ii++,0);
570 570
571 KPrefsDialogWidBool *dailyRecur = 571 KPrefsDialogWidBool *dailyRecur =
572 addWidBool(i18n("Show events that recur daily in date nav."), 572 addWidBool(i18n("Show events that recur daily in date nav."),
573 &(KOPrefs::instance()->mDailyRecur),topFrame); 573 &(KOPrefs::instance()->mDailyRecur),topFrame);
574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
575 575
576 KPrefsDialogWidBool *weeklyRecur = 576 KPrefsDialogWidBool *weeklyRecur =
577 addWidBool(i18n("Show ev. that recur weekly in date nav."), 577 addWidBool(i18n("Show ev. that recur weekly in date nav."),
578 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 578 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
580 580
581 weeklyRecur =
582 addWidBool(i18n("Show multiday allday ev. in date nav."),
583 &(KOPrefs::instance()->mLongAllday),topFrame);
584 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
585
581#ifdef DESKTOP_VERSION 586#ifdef DESKTOP_VERSION
582 KPrefsDialogWidBool *enableToolTips = 587 KPrefsDialogWidBool *enableToolTips =
583 addWidBool(i18n("Enable tooltips displaying summary of ev."), 588 addWidBool(i18n("Enable tooltips displaying summary of ev."),
584 &(KOPrefs::instance()->mEnableToolTips),topFrame); 589 &(KOPrefs::instance()->mEnableToolTips),topFrame);
585 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 590 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
586#endif 591#endif
587 // ********************************************************* 592 // *********************************************************
588 593
589 topFrame = addPage(i18n("Agenda View"),0,0); 594 topFrame = addPage(i18n("Agenda View"),0,0);
590 // DesktopIcon("viewmag",KIcon::SizeMedium)); 595 // DesktopIcon("viewmag",KIcon::SizeMedium));
591 596
592 topLayout = new QGridLayout(topFrame,5,1); 597 topLayout = new QGridLayout(topFrame,5,1);
593 topLayout->setSpacing(mSpacingHint); 598 topLayout->setSpacing(mSpacingHint);
594 topLayout->setMargin(mMarginHint); 599 topLayout->setMargin(mMarginHint);
595 ii = 0; 600 ii = 0;
596 601
597 602
598 dummy = 603 dummy =
599 addWidBool(i18n("Show time in agenda items"), 604 addWidBool(i18n("Show time in agenda items"),
600 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 605 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
601 topLayout->addWidget(dummy->checkBox(),ii++,0); 606 topLayout->addWidget(dummy->checkBox(),ii++,0);
602 607
603 dummy = 608 dummy =
604 addWidBool(i18n("Highlight current day in agenda"), 609 addWidBool(i18n("Highlight current day in agenda"),
605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 610 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
606 topLayout->addWidget(dummy->checkBox(),ii++,0); 611 topLayout->addWidget(dummy->checkBox(),ii++,0);
607 612
608 dummy = 613 dummy =
609 addWidBool(i18n("Use light color for highlight current day"), 614 addWidBool(i18n("Use light color for highlight current day"),
610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 615 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
611 topLayout->addWidget(dummy->checkBox(),ii++,0); 616 topLayout->addWidget(dummy->checkBox(),ii++,0);
612 617
613 618
614 KPrefsDialogWidBool *marcusBainsEnabled = 619 KPrefsDialogWidBool *marcusBainsEnabled =
615 addWidBool(i18n("Show current time"), 620 addWidBool(i18n("Show current time"),
616 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 621 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
617 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 622 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
618 623
619 624
620 dummy = 625 dummy =
621 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 626 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
622 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 627 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
623 topLayout->addWidget(dummy->checkBox(),ii++,0); 628 topLayout->addWidget(dummy->checkBox(),ii++,0);
624 629
625 dummy = 630 dummy =
626 addWidBool(i18n("Set agenda to current time on change"), 631 addWidBool(i18n("Set agenda to current time on change"),
627 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 632 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
628 topLayout->addWidget(dummy->checkBox(),ii++,0); 633 topLayout->addWidget(dummy->checkBox(),ii++,0);
629 634
630 635
631 dummy = 636 dummy =
632 addWidBool(i18n("Allday Agenda view shows todos"), 637 addWidBool(i18n("Allday Agenda view shows todos"),
633 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 638 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
634 topLayout->addWidget(dummy->checkBox(),ii++,0); 639 topLayout->addWidget(dummy->checkBox(),ii++,0);
635 640
636 641
637 642
638 dummy = 643 dummy =
639 addWidBool(i18n("Agenda view shows completed todos"), 644 addWidBool(i18n("Agenda view shows completed todos"),
640 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame); 645 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame);
641 topLayout->addWidget(dummy->checkBox(),ii++,0); 646 topLayout->addWidget(dummy->checkBox(),ii++,0);
642 647
643 648
644 649
645 650
646 651
647 topFrame = addPage(i18n("Month View"),0,0); 652 topFrame = addPage(i18n("Month View"),0,0);
648 // DesktopIcon("viewmag",KIcon::SizeMedium)); 653 // DesktopIcon("viewmag",KIcon::SizeMedium));
649 654
650 topLayout = new QGridLayout(topFrame,5,1); 655 topLayout = new QGridLayout(topFrame,5,1);
651 topLayout->setSpacing(mSpacingHint); 656 topLayout->setSpacing(mSpacingHint);
652 topLayout->setMargin(mMarginHint); 657 topLayout->setMargin(mMarginHint);
653 ii = 0; 658 ii = 0;
654 QLabel *lab; 659 QLabel *lab;
655 QHBox *habo = new QHBox( topFrame ); 660 QHBox *habo = new QHBox( topFrame );
656 if ( QApplication::desktop()->width() <= 480 ) { 661 if ( QApplication::desktop()->width() <= 480 ) {
657 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 662 lab = new QLabel ( i18n("Show events that recur "), topFrame );
658 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 663 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
659 ii++; 664 ii++;
660 } else { 665 } else {
661 new QLabel ( i18n("Show events that recur "), habo ); 666 new QLabel ( i18n("Show events that recur "), habo );
662 } 667 }
663 dailyRecur = 668 dailyRecur =
664 addWidBool(i18n("daily"), 669 addWidBool(i18n("daily"),
665 &(KOPrefs::instance()->mMonthDailyRecur),habo); 670 &(KOPrefs::instance()->mMonthDailyRecur),habo);
666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 671 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
667 672
668 weeklyRecur = 673 weeklyRecur =
669 addWidBool(i18n("weekly"), 674 addWidBool(i18n("weekly"),
670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 675 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
671 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 676 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
672 ii++; 677 ii++;
673 678
674 679
675 habo = new QHBox( topFrame ); 680 habo = new QHBox( topFrame );
676 if ( QApplication::desktop()->width() <= 480 ) { 681 if ( QApplication::desktop()->width() <= 480 ) {
677 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 682 lab = new QLabel (i18n("Show in every cell ") , topFrame );
678 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 683 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
679 ii++; 684 ii++;
680 685
681 } else { 686 } else {
682 new QLabel ( i18n("Show in every cell "), habo ); 687 new QLabel ( i18n("Show in every cell "), habo );
683 } 688 }
684 weeklyRecur = 689 weeklyRecur =
685 addWidBool(i18n("short month"), 690 addWidBool(i18n("short month"),
686 &(KOPrefs::instance()->mMonthShowShort),habo); 691 &(KOPrefs::instance()->mMonthShowShort),habo);
687 weeklyRecur = 692 weeklyRecur =
688 addWidBool(i18n("icons"), 693 addWidBool(i18n("icons"),
689 &(KOPrefs::instance()->mMonthShowIcons),habo); 694 &(KOPrefs::instance()->mMonthShowIcons),habo);
690 weeklyRecur = 695 weeklyRecur =
691 addWidBool(i18n("times"), 696 addWidBool(i18n("times"),
692 &(KOPrefs::instance()->mMonthShowTimes),habo); 697 &(KOPrefs::instance()->mMonthShowTimes),habo);
693 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 698 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
694 ii++; 699 ii++;
695#ifdef DESKTOP_VERSION 700#ifdef DESKTOP_VERSION
696 KPrefsDialogWidBool *enableMonthScroll = 701 KPrefsDialogWidBool *enableMonthScroll =
697 addWidBool(i18n("Enable scrollbars in month view cells"), 702 addWidBool(i18n("Enable scrollbars in month view cells"),
698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 703 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 704 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
700#endif 705#endif
701 dummy = 706 dummy =
702 addWidBool(i18n("Week view mode uses bigger font"), 707 addWidBool(i18n("Week view mode uses bigger font"),
703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); 708 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame);
704 topLayout->addWidget(dummy->checkBox(),ii++,0); 709 topLayout->addWidget(dummy->checkBox(),ii++,0);
705 dummy = 710 dummy =
706 addWidBool(i18n("Week view mode uses row layout"), 711 addWidBool(i18n("Week view mode uses row layout"),
707 &(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame); 712 &(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame);
708 topLayout->addWidget(dummy->checkBox(),ii++,0); 713 topLayout->addWidget(dummy->checkBox(),ii++,0);
709 dummy = 714 dummy =
710 addWidBool(i18n("Show Sat/Sun together"), 715 addWidBool(i18n("Show Sat/Sun together"),
711 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 716 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
712 topLayout->addWidget(dummy->checkBox(),ii++,0); 717 topLayout->addWidget(dummy->checkBox(),ii++,0);
713 718
714 KPrefsDialogWidBool *coloredCategoriesInMonthView = 719 KPrefsDialogWidBool *coloredCategoriesInMonthView =
715 addWidBool(i18n("Month view uses category colors"), 720 addWidBool(i18n("Month view uses category colors"),
716 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 721 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
717 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 722 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
718 723
719 dummy = 724 dummy =
720 addWidBool(i18n("Category colors are applied to text"), 725 addWidBool(i18n("Category colors are applied to text"),
721 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 726 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
722 topLayout->addWidget(dummy->checkBox(),ii++,0); 727 topLayout->addWidget(dummy->checkBox(),ii++,0);
723 728
724 729
725 730
726 if ( QApplication::desktop()->height() <= 240 ) { 731 if ( QApplication::desktop()->height() <= 240 ) {
727 topFrame = addPage(i18n("Month View") +" 2",0,0); 732 topFrame = addPage(i18n("Month View") +" 2",0,0);
728 topLayout = new QGridLayout(topFrame,4,1); 733 topLayout = new QGridLayout(topFrame,4,1);
729 topLayout->setSpacing(2); 734 topLayout->setSpacing(2);
730 topLayout->setMargin(1); 735 topLayout->setMargin(1);
731 ii = 0; 736 ii = 0;
732 } 737 }
733 738
734 739
735 coloredCategoriesInMonthView = 740 coloredCategoriesInMonthView =
736 addWidBool(i18n("Month view uses day colors"), 741 addWidBool(i18n("Month view uses day colors"),
737 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 742 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
738 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 743 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
739 744
740 KPrefsDialogWidColor *holidayColor = 745 KPrefsDialogWidColor *holidayColor =
741 addWidColor(i18n("Day color odd months"), 746 addWidColor(i18n("Day color odd months"),
742 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 747 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
743 topLayout->addWidget(holidayColor->label(),ii,0); 748 topLayout->addWidget(holidayColor->label(),ii,0);
744 topLayout->addWidget(holidayColor->button(),ii++,1); 749 topLayout->addWidget(holidayColor->button(),ii++,1);
745 750
746 holidayColor = 751 holidayColor =
747 addWidColor(i18n("Day color even months"), 752 addWidColor(i18n("Day color even months"),
748 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 753 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
749 topLayout->addWidget(holidayColor->label(),ii,0); 754 topLayout->addWidget(holidayColor->label(),ii,0);
750 topLayout->addWidget(holidayColor->button(),ii++,1); 755 topLayout->addWidget(holidayColor->button(),ii++,1);
751 756
752 757
753 holidayColor = 758 holidayColor =
754 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 759 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
755 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 760 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
756 topLayout->addWidget(holidayColor->label(),ii,0); 761 topLayout->addWidget(holidayColor->label(),ii,0);
757 topLayout->addWidget(holidayColor->button(),ii++,1); 762 topLayout->addWidget(holidayColor->button(),ii++,1);
758 // *********************** What'sNext View 763 // *********************** What'sNext View
759 topFrame = addPage(i18n("What's Next View"),0,0); 764 topFrame = addPage(i18n("What's Next View"),0,0);
760 // DesktopIcon("viewmag",KIcon::SizeMedium)); 765 // DesktopIcon("viewmag",KIcon::SizeMedium));
761 766
762 topLayout = new QGridLayout(topFrame,4,1); 767 topLayout = new QGridLayout(topFrame,4,1);
763 topLayout->setSpacing(mSpacingHint); 768 topLayout->setSpacing(mSpacingHint);
764 topLayout->setMargin(mMarginHint); 769 topLayout->setMargin(mMarginHint);
765 ii = 0; 770 ii = 0;
766 771
767 772
768 QHBox* hdummy = new QHBox(topFrame); 773 QHBox* hdummy = new QHBox(topFrame);
769 new QLabel(i18n("Days in What's Next:"),hdummy); 774 new QLabel(i18n("Days in What's Next:"),hdummy);
770 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 775 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
771 776
772 topLayout->addWidget(hdummy,ii++,0); 777 topLayout->addWidget(hdummy,ii++,0);
773 778
774 QHBox *prioBox = new QHBox(topFrame); 779 QHBox *prioBox = new QHBox(topFrame);
775 // intervalBox->setSpacing(mSpacingHint); 780 // intervalBox->setSpacing(mSpacingHint);
776 topLayout->addWidget(prioBox,ii++,0); 781 topLayout->addWidget(prioBox,ii++,0);
777 782
778 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); 783 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
779 mPrioSpin = new QSpinBox(0,5,1,prioBox); 784 mPrioSpin = new QSpinBox(0,5,1,prioBox);
780 if ( QApplication::desktop()->width() < 300 ) 785 if ( QApplication::desktop()->width() < 300 )
781 mPrioSpin->setFixedWidth( 40 ); 786 mPrioSpin->setFixedWidth( 40 );
782 KPrefsDialogWidBool *passwdk = 787 KPrefsDialogWidBool *passwdk =
783 788
784 addWidBool(i18n("Show times on two lines"), 789 addWidBool(i18n("Show times on two lines"),
785 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame); 790 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame);
786 topLayout->addWidget(passwdk->checkBox(), ii++,0); 791 topLayout->addWidget(passwdk->checkBox(), ii++,0);
787 passwdk = 792 passwdk =
788 793
789 addWidBool(i18n("Show events that are done"), 794 addWidBool(i18n("Show events that are done"),
790 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 795 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
791 topLayout->addWidget(passwdk->checkBox(), ii++,0); 796 topLayout->addWidget(passwdk->checkBox(), ii++,0);
792 passwdk = 797 passwdk =
793 addWidBool(i18n("Show parent To-Do's"), 798 addWidBool(i18n("Show parent To-Do's"),
794 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 799 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
795 topLayout->addWidget(passwdk->checkBox(), ii++,0); 800 topLayout->addWidget(passwdk->checkBox(), ii++,0);
796 801
797 passwdk = 802 passwdk =
798 addWidBool(i18n("Show location"), 803 addWidBool(i18n("Show location"),
799 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 804 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
800 topLayout->addWidget(passwdk->checkBox(), ii++,0); 805 topLayout->addWidget(passwdk->checkBox(), ii++,0);
801 806
802 807
803 passwdk = 808 passwdk =
804 addWidBool(i18n("Use short date in WN+Event view"), 809 addWidBool(i18n("Use short date in WN+Event view"),
805 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 810 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
806 topLayout->addWidget(passwdk->checkBox(), ii++,0); 811 topLayout->addWidget(passwdk->checkBox(), ii++,0);
807 812
808 813
809 814
810 815
811 // *********************** Todo View 816 // *********************** Todo View
812 817
813 topFrame = addPage(i18n("Todo View"),0,0); 818 topFrame = addPage(i18n("Todo View"),0,0);
814 // DesktopIcon("viewmag",KIcon::SizeMedium)); 819 // DesktopIcon("viewmag",KIcon::SizeMedium));
815 820
816 topLayout = new QGridLayout(topFrame,4,1); 821 topLayout = new QGridLayout(topFrame,4,1);
817 topLayout->setSpacing(mSpacingHint); 822 topLayout->setSpacing(mSpacingHint);
818 topLayout->setMargin(mMarginHint); 823 topLayout->setMargin(mMarginHint);
819 ii = 0; 824 ii = 0;
820dummy = 825dummy =
821 addWidBool(i18n("Hide not running Todos in To-do view"), 826 addWidBool(i18n("Hide not running Todos in To-do view"),
822 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 827 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
823 topLayout->addWidget(dummy->checkBox(),ii++,0); 828 topLayout->addWidget(dummy->checkBox(),ii++,0);
824 829
825 830
826 KPrefsDialogWidBool *showCompletedTodo = 831 KPrefsDialogWidBool *showCompletedTodo =
827 addWidBool(i18n("To-do view shows completed Todos"), 832 addWidBool(i18n("To-do view shows completed Todos"),
828 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 833 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
829 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 834 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
830 dummy = 835 dummy =
831 addWidBool(i18n("To-do view shows complete as 'xx %'"), 836 addWidBool(i18n("To-do view shows complete as 'xx %'"),
832 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 837 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
833 topLayout->addWidget(dummy->checkBox(),ii++,0); 838 topLayout->addWidget(dummy->checkBox(),ii++,0);
834 839
835 dummy = 840 dummy =
836 addWidBool(i18n("Small To-do view uses smaller font"), 841 addWidBool(i18n("Small To-do view uses smaller font"),
837 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 842 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
838 topLayout->addWidget(dummy->checkBox(),ii++,0); 843 topLayout->addWidget(dummy->checkBox(),ii++,0);
839 844
840 845
841 846
842 dummy = 847 dummy =
843 addWidBool(i18n("Todo view uses category colors"), 848 addWidBool(i18n("Todo view uses category colors"),
844 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 849 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
845 topLayout->addWidget(dummy->checkBox(),ii++,0); 850 topLayout->addWidget(dummy->checkBox(),ii++,0);
846 851
847 852
848 QWidget* wid = new QWidget( topFrame ); 853 QWidget* wid = new QWidget( topFrame );
849 // Todo run today color 854 // Todo run today color
850 KPrefsDialogWidColor *todoRunColor = 855 KPrefsDialogWidColor *todoRunColor =
851 addWidColor(i18n("Color for running todos:"), 856 addWidColor(i18n("Color for running todos:"),
852 &(KOPrefs::instance()->mTodoRunColor),wid); 857 &(KOPrefs::instance()->mTodoRunColor),wid);
853 QHBoxLayout *widLayout = new QHBoxLayout(wid); 858 QHBoxLayout *widLayout = new QHBoxLayout(wid);
854 widLayout->addWidget( todoRunColor->label() ); 859 widLayout->addWidget( todoRunColor->label() );
855 widLayout->addWidget( todoRunColor->button() ); 860 widLayout->addWidget( todoRunColor->button() );
856 topLayout->addWidget(wid,ii++,0); 861 topLayout->addWidget(wid,ii++,0);
857 862
858 wid = new QWidget( topFrame ); 863 wid = new QWidget( topFrame );
859 // Todo due today color 864 // Todo due today color
860 KPrefsDialogWidColor *todoDueTodayColor = 865 KPrefsDialogWidColor *todoDueTodayColor =
861 addWidColor(i18n("Todo due today color:"), 866 addWidColor(i18n("Todo due today color:"),
862 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 867 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
863 widLayout = new QHBoxLayout(wid); 868 widLayout = new QHBoxLayout(wid);
864 widLayout->addWidget( todoDueTodayColor->label() ); 869 widLayout->addWidget( todoDueTodayColor->label() );
865 widLayout->addWidget( todoDueTodayColor->button() ); 870 widLayout->addWidget( todoDueTodayColor->button() );
866 topLayout->addWidget(wid,ii++,0); 871 topLayout->addWidget(wid,ii++,0);
867 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 872 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
868 873
869 // Todo overdue color 874 // Todo overdue color
870 wid = new QWidget( topFrame ); 875 wid = new QWidget( topFrame );
871 widLayout = new QHBoxLayout(wid); 876 widLayout = new QHBoxLayout(wid);
872 KPrefsDialogWidColor *todoOverdueColor = 877 KPrefsDialogWidColor *todoOverdueColor =
873 addWidColor(i18n("Todo overdue color:"), 878 addWidColor(i18n("Todo overdue color:"),
874 &(KOPrefs::instance()->mTodoOverdueColor),wid); 879 &(KOPrefs::instance()->mTodoOverdueColor),wid);
875 widLayout->addWidget(todoOverdueColor->label()); 880 widLayout->addWidget(todoOverdueColor->label());
876 widLayout->addWidget(todoOverdueColor->button()); 881 widLayout->addWidget(todoOverdueColor->button());
877 topLayout->addWidget(wid,ii++,0); 882 topLayout->addWidget(wid,ii++,0);
878 883
879 dummy = 884 dummy =
880 addWidBool(i18n("Colors are applied to text"), 885 addWidBool(i18n("Colors are applied to text"),
881 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 886 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
882 topLayout->addWidget(dummy->checkBox(),ii++,0); 887 topLayout->addWidget(dummy->checkBox(),ii++,0);
883 888
884 889
885 890
886 topFrame = addPage(i18n("View Options"),0,0); 891 topFrame = addPage(i18n("View Options"),0,0);
887 892
888 topLayout = new QGridLayout(topFrame,4,1); 893 topLayout = new QGridLayout(topFrame,4,1);
889 topLayout->setSpacing(mSpacingHint); 894 topLayout->setSpacing(mSpacingHint);
890 topLayout->setMargin(mMarginHint); 895 topLayout->setMargin(mMarginHint);
891 ii = 0; 896 ii = 0;
892 897
893 dummy = 898 dummy =
894 addWidBool(i18n("Show Sync Events"), 899 addWidBool(i18n("Show Sync Events"),
895 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 900 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
896 topLayout->addWidget(dummy->checkBox(), ii++,0); 901 topLayout->addWidget(dummy->checkBox(), ii++,0);
897 902
898 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); 903 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
899 topLayout->addWidget(lab ,ii++,0); 904 topLayout->addWidget(lab ,ii++,0);
900 905
901 dummy = addWidBool(i18n("Details"), 906 dummy = addWidBool(i18n("Details"),
902 &(KOPrefs::instance()->mEVshowDetails),topFrame); 907 &(KOPrefs::instance()->mEVshowDetails),topFrame);
903 topLayout->addWidget(dummy->checkBox(),ii++,0); 908 topLayout->addWidget(dummy->checkBox(),ii++,0);
904 dummy = addWidBool(i18n("Created time"), 909 dummy = addWidBool(i18n("Created time"),
905 &(KOPrefs::instance()->mEVshowCreated),topFrame); 910 &(KOPrefs::instance()->mEVshowCreated),topFrame);
906 topLayout->addWidget(dummy->checkBox(),ii++,0); 911 topLayout->addWidget(dummy->checkBox(),ii++,0);
907 dummy = addWidBool(i18n("Last modified time"), 912 dummy = addWidBool(i18n("Last modified time"),
908 &(KOPrefs::instance()->mEVshowChanged),topFrame); 913 &(KOPrefs::instance()->mEVshowChanged),topFrame);
909 topLayout->addWidget(dummy->checkBox(),ii++,0); 914 topLayout->addWidget(dummy->checkBox(),ii++,0);
910 915
911 916
912 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); 917 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
913 topLayout->addWidget(lab ,ii++,0); 918 topLayout->addWidget(lab ,ii++,0);
914 919
915 dummy = addWidBool(i18n("Details"), 920 dummy = addWidBool(i18n("Details"),
916 &(KOPrefs::instance()->mWTshowDetails),topFrame); 921 &(KOPrefs::instance()->mWTshowDetails),topFrame);
917 topLayout->addWidget(dummy->checkBox(),ii++,0); 922 topLayout->addWidget(dummy->checkBox(),ii++,0);
918 dummy = addWidBool(i18n("Created time"), 923 dummy = addWidBool(i18n("Created time"),
919 &(KOPrefs::instance()->mWTshowCreated),topFrame); 924 &(KOPrefs::instance()->mWTshowCreated),topFrame);
920 topLayout->addWidget(dummy->checkBox(),ii++,0); 925 topLayout->addWidget(dummy->checkBox(),ii++,0);
921 dummy = addWidBool(i18n("Last modified time"), 926 dummy = addWidBool(i18n("Last modified time"),
922 &(KOPrefs::instance()->mWTshowChanged),topFrame); 927 &(KOPrefs::instance()->mWTshowChanged),topFrame);
923 topLayout->addWidget(dummy->checkBox(),ii++,0); 928 topLayout->addWidget(dummy->checkBox(),ii++,0);
924 929
925 topFrame = addPage(i18n("Conflict detection"),0,0); 930 topFrame = addPage(i18n("Conflict detection"),0,0);
926 931
927 topLayout = new QGridLayout(topFrame,2,1); 932 topLayout = new QGridLayout(topFrame,2,1);
928 topLayout->setSpacing(mSpacingHint); 933 topLayout->setSpacing(mSpacingHint);
929 topLayout->setMargin(mMarginHint); 934 topLayout->setMargin(mMarginHint);
930 ii = 0; 935 ii = 0;
931 dummy = addWidBool(i18n("Enable conflict detection"), 936 dummy = addWidBool(i18n("Enable conflict detection"),
932 &(KOPrefs::instance()->mDetectConflicts),topFrame); 937 &(KOPrefs::instance()->mDetectConflicts),topFrame);
933 topLayout->addWidget(dummy->checkBox(), ii++,0); 938 topLayout->addWidget(dummy->checkBox(), ii++,0);
934 topFrame = new QFrame( topFrame ); 939 topFrame = new QFrame( topFrame );
935 topLayout->addWidget(topFrame ,ii++,0); 940 topLayout->addWidget(topFrame ,ii++,0);
936 topLayout = new QGridLayout(topFrame,4,1); 941 topLayout = new QGridLayout(topFrame,4,1);
937 connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); 942 connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) );
938 topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:"), topFrame ) , ii++,0); 943 dummy = addWidBool(i18n("Include events which \"show as free\""),
944 &(KOPrefs::instance()->mIncludeFree),topFrame);
945 topLayout->addWidget(dummy->checkBox(), ii++,0);
946 topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0);
947
939 topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0); 948 topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0);
940 mFilterEditItem = new QComboBox( topFrame ); 949 mFilterEditItem = new QComboBox( topFrame );
941 topLayout->addWidget(mFilterEditItem,ii++,0); 950 topLayout->addWidget(mFilterEditItem,ii++,0);
942 topLayout->addWidget( new QLabel ( i18n("Filter for other existing events"), topFrame ) , ii++,0); 951 topLayout->addWidget( new QLabel ( i18n("Filter for other events"), topFrame ) , ii++,0);
943 mFilterAllItem = new QComboBox( topFrame ); 952 mFilterAllItem = new QComboBox( topFrame );
944 topLayout->addWidget(mFilterAllItem,ii++,0); 953 topLayout->addWidget(mFilterAllItem,ii++,0);
945 dummy = addWidBool(i18n("Check Allday with Allday"), 954 dummy = addWidBool(i18n("Check Allday with Allday"),
946 &(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame); 955 &(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame);
947 topLayout->addWidget(dummy->checkBox(), ii++,0); 956 topLayout->addWidget(dummy->checkBox(), ii++,0);
948 dummy = addWidBool(i18n("Check Allday with NonAllday"), 957 dummy = addWidBool(i18n("Check Allday with NonAllday"),
949 &(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame); 958 &(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame);
950 topLayout->addWidget(dummy->checkBox(), ii++,0); 959 topLayout->addWidget(dummy->checkBox(), ii++,0);
951 dummy = addWidBool(i18n("Check NonAllday with Allday"), 960 dummy = addWidBool(i18n("Check NonAllday with Allday"),
952 &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame); 961 &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame);
953 topLayout->addWidget(dummy->checkBox(), ii++,0); 962 topLayout->addWidget(dummy->checkBox(), ii++,0);
954 dummy = addWidBool(i18n("Check NonAllday with NonAllday"), 963 dummy = addWidBool(i18n("Check NonAllday with NonAllday"),
955 &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame); 964 &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame);
956 topLayout->addWidget(dummy->checkBox(), ii++,0); 965 topLayout->addWidget(dummy->checkBox(), ii++,0);
957 966
958 967
959 968
960 969
961 topFrame = addPage(i18n("Alarm"),0,0); 970 topFrame = addPage(i18n("Alarm"),0,0);
962 // DesktopIcon("viewmag",KIcon::SizeMedium)); 971 // DesktopIcon("viewmag",KIcon::SizeMedium));
963 972
964 topLayout = new QGridLayout(topFrame,2,1); 973 topLayout = new QGridLayout(topFrame,2,1);
965 topLayout->setSpacing(mSpacingHint); 974 topLayout->setSpacing(mSpacingHint);
966 topLayout->setMargin(mMarginHint); 975 topLayout->setMargin(mMarginHint);
967 int iii = 0; 976 int iii = 0;
968 977
969 dummy = 978 dummy =
970 addWidBool(i18n("Use internal alarm notification"), 979 addWidBool(i18n("Use internal alarm notification"),
971 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 980 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
972 topLayout->addWidget(dummy->checkBox(),iii++,0); 981 topLayout->addWidget(dummy->checkBox(),iii++,0);
973 982
974 if ( QApplication::desktop()->height() > 240 ) { 983 if ( QApplication::desktop()->height() > 240 ) {
975 984
976 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); 985 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);
977 986
978 topLayout->addWidget(lab ,iii++,0); 987 topLayout->addWidget(lab ,iii++,0);
979 } 988 }
980#ifndef DESKTOP_VERSION 989#ifndef DESKTOP_VERSION
981 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 990 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
982#else 991#else
983 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 992 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
984 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 993 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
985#endif 994#endif
986 995
987 QHBox* dummyBox = new QHBox(topFrame); 996 QHBox* dummyBox = new QHBox(topFrame);
988 new QLabel(i18n("Play beeps count:"),dummyBox); 997 new QLabel(i18n("Play beeps count:"),dummyBox);
989 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 998 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
990 topLayout->addWidget(dummyBox,iii++,0); 999 topLayout->addWidget(dummyBox,iii++,0);
991 1000
992 dummyBox = new QHBox(topFrame); 1001 dummyBox = new QHBox(topFrame);
993 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 1002 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
994 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 1003 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
995 topLayout->addWidget(dummyBox,iii++,0); 1004 topLayout->addWidget(dummyBox,iii++,0);
996 1005
997 dummyBox = new QHBox(topFrame); 1006 dummyBox = new QHBox(topFrame);
998 new QLabel(i18n("Default suspend time in min:"),dummyBox); 1007 new QLabel(i18n("Default suspend time in min:"),dummyBox);
999 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 1008 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
1000 topLayout->addWidget(dummyBox,iii++,0); 1009 topLayout->addWidget(dummyBox,iii++,0);
1001 1010
1002 dummyBox = new QHBox(topFrame); 1011 dummyBox = new QHBox(topFrame);
1003 new QLabel(i18n("Auto suspend count:"),dummyBox); 1012 new QLabel(i18n("Auto suspend count:"),dummyBox);
1004 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1013 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
1005 topLayout->addWidget(dummyBox,iii++,0); 1014 topLayout->addWidget(dummyBox,iii++,0);
1006 1015
1007 1016
1008 1017
1009 QHBox* hbo = new QHBox ( topFrame ); 1018 QHBox* hbo = new QHBox ( topFrame );
1010 mDefaultAlarmFile = new QLineEdit(hbo); 1019 mDefaultAlarmFile = new QLineEdit(hbo);
1011 QPushButton * loadTemplate = new QPushButton(hbo); 1020 QPushButton * loadTemplate = new QPushButton(hbo);
1012 QPixmap icon; 1021 QPixmap icon;
1013 if ( QApplication::desktop()->width() < 321 ) 1022 if ( QApplication::desktop()->width() < 321 )
1014 icon = SmallIcon("fileimport16"); 1023 icon = SmallIcon("fileimport16");
1015 else 1024 else
1016 icon = SmallIcon("fileimport"); 1025 icon = SmallIcon("fileimport");
1017 loadTemplate->setIconSet (icon ) ; 1026 loadTemplate->setIconSet (icon ) ;
1018 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1027 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
1019 int size = loadTemplate->sizeHint().height(); 1028 int size = loadTemplate->sizeHint().height();
1020 loadTemplate->setFixedSize( size, size ); 1029 loadTemplate->setFixedSize( size, size );
1021 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1030 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
1022 // topLayout->addWidget(lab ,iii++,0); 1031 // topLayout->addWidget(lab ,iii++,0);
1023 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 1032 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
1024 topLayout->addWidget(lab ,iii++,0); 1033 topLayout->addWidget(lab ,iii++,0);
1025 topLayout->addWidget(hbo,iii++,0); 1034 topLayout->addWidget(hbo,iii++,0);
1026 // 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); 1035 // 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);
1027 1036
1028// topLayout->addWidget(lab ,iii++,0); 1037// topLayout->addWidget(lab ,iii++,0);
1029// #ifndef DESKTOP_VERSION 1038// #ifndef DESKTOP_VERSION
1030// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1039// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
1031// #else 1040// #else
1032// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1041// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
1033// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1042// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
1034// #endif 1043// #endif
1035 1044
1036 1045
1037} 1046}
1038 1047
1039void KOPrefsDialog::selectSoundFile() 1048void KOPrefsDialog::selectSoundFile()
1040{ 1049{
1041 QString fileName = mDefaultAlarmFile->text(); 1050 QString fileName = mDefaultAlarmFile->text();
1042 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1051 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1043 if ( fileName.length() > 0 ) 1052 if ( fileName.length() > 0 )
1044 mDefaultAlarmFile->setText( fileName ); 1053 mDefaultAlarmFile->setText( fileName );
1045} 1054}
1046void KOPrefsDialog::setupFontsTab() 1055void KOPrefsDialog::setupFontsTab()
1047{ 1056{
1048 1057
1049 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1058 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1050 // DesktopIcon("fonts",KIcon::SizeMedium)); 1059 // DesktopIcon("fonts",KIcon::SizeMedium));
1051 1060
1052 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1061 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1053 topLayout->setSpacing(1); 1062 topLayout->setSpacing(1);
1054 topLayout->setMargin(3); 1063 topLayout->setMargin(3);
1055 KPrefsDialogWidFont * tVFont; 1064 KPrefsDialogWidFont * tVFont;
1056 int i = 0; 1065 int i = 0;
1057 KPrefsDialogWidFont *timeLabelsFont = 1066 KPrefsDialogWidFont *timeLabelsFont =
1058 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1067 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1059 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1068 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1060 topLayout->addWidget(timeLabelsFont->label(),i,0); 1069 topLayout->addWidget(timeLabelsFont->label(),i,0);
1061 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1070 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1062 topLayout->addWidget(timeLabelsFont->button(),i,2); 1071 topLayout->addWidget(timeLabelsFont->button(),i,2);
1063 ++i; 1072 ++i;
1064 1073
1065 1074
1066 timeLabelsFont = 1075 timeLabelsFont =
1067 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1076 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1068 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1077 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1069 topLayout->addWidget(timeLabelsFont->label(),i,0); 1078 topLayout->addWidget(timeLabelsFont->label(),i,0);
1070 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1079 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1071 topLayout->addWidget(timeLabelsFont->button(),i,2); 1080 topLayout->addWidget(timeLabelsFont->button(),i,2);
1072 ++i; 1081 ++i;
1073 1082
1074 KPrefsDialogWidFont *timeBarFont = 1083 KPrefsDialogWidFont *timeBarFont =
1075 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1084 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1076 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1085 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1077 topLayout->addWidget(timeBarFont->label(),i,0); 1086 topLayout->addWidget(timeBarFont->label(),i,0);
1078 topLayout->addWidget(timeBarFont->preview(),i,1); 1087 topLayout->addWidget(timeBarFont->preview(),i,1);
1079 topLayout->addWidget(timeBarFont->button(),i,2); 1088 topLayout->addWidget(timeBarFont->button(),i,2);
1080 ++i; 1089 ++i;
1081 1090
1082 1091
1083 KPrefsDialogWidFont *marcusBainsFont = 1092 KPrefsDialogWidFont *marcusBainsFont =
1084 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1093 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1085 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1094 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1086 topLayout->addWidget(marcusBainsFont->label(),i,0); 1095 topLayout->addWidget(marcusBainsFont->label(),i,0);
1087 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1096 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1088 topLayout->addWidget(marcusBainsFont->button(),i,2); 1097 topLayout->addWidget(marcusBainsFont->button(),i,2);
1089 ++i; 1098 ++i;
1090 1099
1091 tVFont = 1100 tVFont =
1092 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1101 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1093 &(KOPrefs::instance()->mEventViewFont),topFrame); 1102 &(KOPrefs::instance()->mEventViewFont),topFrame);
1094 topLayout->addWidget(tVFont->label(),i,0); 1103 topLayout->addWidget(tVFont->label(),i,0);
1095 topLayout->addWidget(tVFont->preview(),i,1); 1104 topLayout->addWidget(tVFont->preview(),i,1);
1096 topLayout->addWidget(tVFont->button(),i,2); 1105 topLayout->addWidget(tVFont->button(),i,2);
1097 ++i; 1106 ++i;
1098 1107
1099 1108
1100 1109
1101 tVFont = 1110 tVFont =
1102 addWidFont(i18n("Details"),i18n("EditorBox:"), 1111 addWidFont(i18n("Details"),i18n("EditorBox:"),
1103 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1112 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1104 topLayout->addWidget(tVFont->label(),i,0); 1113 topLayout->addWidget(tVFont->label(),i,0);
1105 topLayout->addWidget(tVFont->preview(),i,1); 1114 topLayout->addWidget(tVFont->preview(),i,1);
1106 topLayout->addWidget(tVFont->button(),i,2); 1115 topLayout->addWidget(tVFont->button(),i,2);
1107 ++i; 1116 ++i;
1108 1117
1109 1118
1110 1119
1111 topLayout->setColStretch(1,1); 1120 topLayout->setColStretch(1,1);
1112 topLayout->setRowStretch(4,1); 1121 topLayout->setRowStretch(4,1);
1113 1122
1114 1123
1115 i = 0; 1124 i = 0;
1116 topFrame = addPage(i18n("View Fonts"),0, 1125 topFrame = addPage(i18n("View Fonts"),0,
1117 DesktopIcon("fonts",KIcon::SizeMedium)); 1126 DesktopIcon("fonts",KIcon::SizeMedium));
1118 1127
1119 topLayout = new QGridLayout(topFrame,7,3); 1128 topLayout = new QGridLayout(topFrame,7,3);
1120 topLayout->setSpacing(1); 1129 topLayout->setSpacing(1);
1121 topLayout->setMargin(3); 1130 topLayout->setMargin(3);
1122 1131
1123 tVFont = 1132 tVFont =
1124 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1133 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1125 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1134 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1126 topLayout->addWidget(tVFont->label(),i,0); 1135 topLayout->addWidget(tVFont->label(),i,0);
1127 topLayout->addWidget(tVFont->preview(),i,1); 1136 topLayout->addWidget(tVFont->preview(),i,1);
1128 topLayout->addWidget(tVFont->button(),i,2); 1137 topLayout->addWidget(tVFont->button(),i,2);
1129 ++i; 1138 ++i;
1130 KPrefsDialogWidFont *agendaViewFont = 1139 KPrefsDialogWidFont *agendaViewFont =
1131 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1140 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1132 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1141 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1133 topLayout->addWidget(agendaViewFont->label(),i,0); 1142 topLayout->addWidget(agendaViewFont->label(),i,0);
1134 topLayout->addWidget(agendaViewFont->preview(),i,1); 1143 topLayout->addWidget(agendaViewFont->preview(),i,1);
1135 topLayout->addWidget(agendaViewFont->button(),i,2); 1144 topLayout->addWidget(agendaViewFont->button(),i,2);
1136 ++i; 1145 ++i;
1137 1146
1138 1147
1139 KPrefsDialogWidFont *monthViewFont = 1148 KPrefsDialogWidFont *monthViewFont =
1140 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1149 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1141 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1150 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1142 topLayout->addWidget(monthViewFont->label(),i,0); 1151 topLayout->addWidget(monthViewFont->label(),i,0);
1143 topLayout->addWidget(monthViewFont->preview(),i,1); 1152 topLayout->addWidget(monthViewFont->preview(),i,1);
1144 topLayout->addWidget(monthViewFont->button(),i,2); 1153 topLayout->addWidget(monthViewFont->button(),i,2);
1145 ++i; 1154 ++i;
1146 1155
1147 1156
1148 KPrefsDialogWidFont *lVFont = 1157 KPrefsDialogWidFont *lVFont =
1149 addWidFont(i18n("Event"),i18n("List View:"), 1158 addWidFont(i18n("Event"),i18n("List View:"),
1150 &(KOPrefs::instance()->mListViewFont),topFrame); 1159 &(KOPrefs::instance()->mListViewFont),topFrame);
1151 topLayout->addWidget(lVFont->label(),i,0); 1160 topLayout->addWidget(lVFont->label(),i,0);
1152 topLayout->addWidget(lVFont->preview(),i,1); 1161 topLayout->addWidget(lVFont->preview(),i,1);
1153 topLayout->addWidget(lVFont->button(),i,2); 1162 topLayout->addWidget(lVFont->button(),i,2);
1154 ++i; 1163 ++i;
1155 1164
1156 1165
1157 tVFont = 1166 tVFont =
1158 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1167 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1159 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1168 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1160 topLayout->addWidget(tVFont->label(),i,0); 1169 topLayout->addWidget(tVFont->label(),i,0);
1161 topLayout->addWidget(tVFont->preview(),i,1); 1170 topLayout->addWidget(tVFont->preview(),i,1);
1162 topLayout->addWidget(tVFont->button(),i,2); 1171 topLayout->addWidget(tVFont->button(),i,2);
1163 ++i; 1172 ++i;
1164 1173
1165 1174
1166 tVFont = 1175 tVFont =
1167 addWidFont(i18n("Today"),i18n("JournalView:"), 1176 addWidFont(i18n("Today"),i18n("JournalView:"),
1168 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1177 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1169 topLayout->addWidget(tVFont->label(),i,0); 1178 topLayout->addWidget(tVFont->label(),i,0);
1170 topLayout->addWidget(tVFont->preview(),i,1); 1179 topLayout->addWidget(tVFont->preview(),i,1);
1171 topLayout->addWidget(tVFont->button(),i,2); 1180 topLayout->addWidget(tVFont->button(),i,2);
1172 ++i; 1181 ++i;
1173 1182
1174 1183
1175 1184
1176 1185
1177 topLayout->setColStretch(1,1); 1186 topLayout->setColStretch(1,1);
1178 topLayout->setRowStretch(4,1); 1187 topLayout->setRowStretch(4,1);
1179 1188
1180 1189
1181 1190
1182 1191
1183} 1192}
1184 1193
1185void KOPrefsDialog::setupColorsTab() 1194void KOPrefsDialog::setupColorsTab()
1186{ 1195{
1187 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1196 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1188 // DesktopIcon("colorize",KIcon::SizeMedium)); 1197 // DesktopIcon("colorize",KIcon::SizeMedium));
1189 1198
1190 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1199 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1191 // topLayout->setSpacing(mSpacingHint); 1200 // topLayout->setSpacing(mSpacingHint);
1192 // topLayout->setMargin(mMarginHint); 1201 // topLayout->setMargin(mMarginHint);
1193 1202
1194 topLayout->setSpacing(2); 1203 topLayout->setSpacing(2);
1195 topLayout->setMargin(3); 1204 topLayout->setMargin(3);
1196 1205
1197 int ii = 1; 1206 int ii = 1;
1198 QGroupBox *categoryGroup ; 1207 QGroupBox *categoryGroup ;