-rw-r--r-- | korganizer/koprefs.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 6337ca5..bb3d720 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -38,192 +38,193 @@ | |||
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 | ||
50 | KOPrefs *KOPrefs::mInstance = 0; | 50 | KOPrefs *KOPrefs::mInstance = 0; |
51 | static KStaticDeleter<KOPrefs> insd; | 51 | static KStaticDeleter<KOPrefs> insd; |
52 | 52 | ||
53 | KOPrefs::KOPrefs() : | 53 | KOPrefs::KOPrefs() : |
54 | KPimPrefs("korganizerrc") | 54 | KPimPrefs("korganizerrc") |
55 | { | 55 | { |
56 | mCategoryColors.setAutoDelete(true); | 56 | mCategoryColors.setAutoDelete(true); |
57 | fillMailDefaults(); | 57 | fillMailDefaults(); |
58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
59 | QColor defaultHolidayColor = QColor(255,0,0); | 59 | QColor defaultHolidayColor = QColor(255,0,0); |
60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
64 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 64 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
65 | QColor defaultTodoRunColor = QColor(99,194,30); | 65 | QColor defaultTodoRunColor = QColor(99,194,30); |
66 | KPrefs::setCurrentGroup("General"); | 66 | KPrefs::setCurrentGroup("General"); |
67 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 67 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
68 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 68 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
69 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 69 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
70 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 70 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
71 | addItemBool("ShowIconList",&mShowIconList,true); | 71 | addItemBool("ShowIconList",&mShowIconList,true); |
72 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 72 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
73 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 73 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
74 | addItemBool("ShowIconDay6",&mShowIconDay6,true); | 74 | addItemBool("ShowIconDay6",&mShowIconDay6,true); |
75 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 75 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
76 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 76 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
77 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 77 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
78 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 78 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
79 | addItemBool("ShowIconBack",&mShowIconBack,true); | 79 | addItemBool("ShowIconBack",&mShowIconBack,true); |
80 | addItemBool("ShowIconToday",&mShowIconToday,true); | 80 | addItemBool("ShowIconToday",&mShowIconToday,true); |
81 | addItemBool("ShowIconForward",&mShowIconForward,true); | 81 | addItemBool("ShowIconForward",&mShowIconForward,true); |
82 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 82 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
83 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); | 83 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); |
84 | addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); | 84 | addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); |
85 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 85 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
86 | addItemBool("ShowIconNext",&mShowIconNext,true); | 86 | addItemBool("ShowIconNext",&mShowIconNext,true); |
87 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 87 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
88 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 88 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
89 | addItemBool("ShowIconFilter",&mShowIconFilter,false); | 89 | addItemBool("ShowIconFilter",&mShowIconFilter,false); |
90 | addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); | 90 | addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); |
91 | 91 | ||
92 | bool addIcons = false; | 92 | bool addIcons = false; |
93 | #ifdef DESKTOP_VERSION | 93 | #ifdef DESKTOP_VERSION |
94 | addIcons = true; | 94 | addIcons = true; |
95 | #endif | 95 | #endif |
96 | addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); | 96 | addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); |
97 | addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); | 97 | addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); |
98 | addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); | 98 | addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); |
99 | addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); | 99 | addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); |
100 | 100 | ||
101 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); | 101 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); |
102 | 102 | ||
103 | addItemBool("AskForQuit",&mAskForQuit,false); | 103 | addItemBool("AskForQuit",&mAskForQuit,false); |
104 | 104 | ||
105 | #ifndef DESKTOP_VERSION | 105 | #ifndef DESKTOP_VERSION |
106 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 106 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
107 | #else | 107 | #else |
108 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 108 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
109 | #endif | 109 | #endif |
110 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 110 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
111 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 111 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
112 | addItemBool("ToolBarHorV",&mToolBarHorV, true ); | 112 | addItemBool("ToolBarHorV",&mToolBarHorV, true ); |
113 | addItemBool("ToolBarUpV",&mToolBarUpV, false ); | 113 | addItemBool("ToolBarUpV",&mToolBarUpV, false ); |
114 | addItemBool("ToolBarHorN",&mToolBarHorN, true ); | 114 | addItemBool("ToolBarHorN",&mToolBarHorN, true ); |
115 | addItemBool("ToolBarUpN",&mToolBarUpN, false ); | 115 | addItemBool("ToolBarUpN",&mToolBarUpN, false ); |
116 | addItemBool("ToolBarHorF",&mToolBarHorF, true ); | 116 | addItemBool("ToolBarHorF",&mToolBarHorF, true ); |
117 | addItemBool("ToolBarUpF",&mToolBarUpF, false ); | 117 | addItemBool("ToolBarUpF",&mToolBarUpF, false ); |
118 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 118 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
119 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 119 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
120 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 120 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
121 | 121 | ||
122 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 122 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
123 | addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); | 123 | addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); |
124 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); | 124 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); |
125 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); | 125 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); |
126 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 126 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
127 | addItemInt("AllDay Size",&mAllDaySize,28); | 127 | addItemInt("AllDay Size",&mAllDaySize,28); |
128 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 128 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
129 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 129 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
130 | 130 | ||
131 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 131 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
132 | addItemStringList("EventSummary User",&mEventSummaryUser); | 132 | addItemStringList("EventSummary User",&mEventSummaryUser); |
133 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 133 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
134 | addItemStringList("JournalSummary User",&mJournalSummaryUser); | ||
134 | 135 | ||
135 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 136 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
136 | addItemBool("Enable Project View",&mEnableProjectView,false); | 137 | addItemBool("Enable Project View",&mEnableProjectView,false); |
137 | addItemBool("Auto Save",&mAutoSave,false); | 138 | addItemBool("Auto Save",&mAutoSave,false); |
138 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 139 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
139 | addItemBool("Confirm Deletes",&mConfirm,true); | 140 | addItemBool("Confirm Deletes",&mConfirm,true); |
140 | addItemString("Archive File",&mArchiveFile); | 141 | addItemString("Archive File",&mArchiveFile); |
141 | addItemString("Html Export File",&mHtmlExportFile, | 142 | addItemString("Html Export File",&mHtmlExportFile, |
142 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 143 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
143 | addItemBool("Html With Save",&mHtmlWithSave,false); | 144 | addItemBool("Html With Save",&mHtmlWithSave,false); |
144 | 145 | ||
145 | KPrefs::setCurrentGroup("Personal Settings"); | 146 | KPrefs::setCurrentGroup("Personal Settings"); |
146 | 147 | ||
147 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 148 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
148 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 149 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
149 | addItemBool("Bcc",&mBcc,false); | 150 | addItemBool("Bcc",&mBcc,false); |
150 | 151 | ||
151 | KPrefs::setCurrentGroup("Time & Date"); | 152 | KPrefs::setCurrentGroup("Time & Date"); |
152 | 153 | ||
153 | 154 | ||
154 | addItemInt("Default Start Time",&mStartTime,10); | 155 | addItemInt("Default Start Time",&mStartTime,10); |
155 | addItemInt("Default Duration",&mDefaultDuration,2); | 156 | addItemInt("Default Duration",&mDefaultDuration,2); |
156 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 157 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
157 | KPrefs::setCurrentGroup("AlarmSettings"); | 158 | KPrefs::setCurrentGroup("AlarmSettings"); |
158 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 159 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
159 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 160 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
160 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 161 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
161 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 162 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
162 | 163 | ||
163 | 164 | ||
164 | KPrefs::setCurrentGroup("Calendar"); | 165 | KPrefs::setCurrentGroup("Calendar"); |
165 | 166 | ||
166 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 167 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
167 | 168 | ||
168 | KPrefs::setCurrentGroup("Fonts"); | 169 | KPrefs::setCurrentGroup("Fonts"); |
169 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 170 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
170 | QFont fon = KGlobalSettings::generalFont(); | 171 | QFont fon = KGlobalSettings::generalFont(); |
171 | addItemFont("TimeBar Font",&mTimeBarFont,fon ); | 172 | addItemFont("TimeBar Font",&mTimeBarFont,fon ); |
172 | addItemFont("MonthView Font",&mMonthViewFont,fon); | 173 | addItemFont("MonthView Font",&mMonthViewFont,fon); |
173 | addItemFont("AgendaView Font",&mAgendaViewFont,fon); | 174 | addItemFont("AgendaView Font",&mAgendaViewFont,fon); |
174 | addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); | 175 | addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); |
175 | addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); | 176 | addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); |
176 | addItemFont("TodoView Font",&mTodoViewFont,fon); | 177 | addItemFont("TodoView Font",&mTodoViewFont,fon); |
177 | addItemFont("ListView Font",&mListViewFont,fon); | 178 | addItemFont("ListView Font",&mListViewFont,fon); |
178 | addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); | 179 | addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); |
179 | addItemFont("EditBox Font",&mEditBoxFont,fon); | 180 | addItemFont("EditBox Font",&mEditBoxFont,fon); |
180 | addItemFont("JournalView Font",&mJornalViewFont,fon); | 181 | addItemFont("JournalView Font",&mJornalViewFont,fon); |
181 | addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); | 182 | addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); |
182 | addItemFont("EventView Font",&mEventViewFont,fon); | 183 | addItemFont("EventView Font",&mEventViewFont,fon); |
183 | 184 | ||
184 | KPrefs::setCurrentGroup("RemoteSyncing"); | 185 | KPrefs::setCurrentGroup("RemoteSyncing"); |
185 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 186 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
186 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 187 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
187 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 188 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
188 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 189 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
189 | 190 | ||
190 | #ifdef _WIN32_ | 191 | #ifdef _WIN32_ |
191 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 192 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
192 | #else | 193 | #else |
193 | QString hdp= locateLocal("data","korganizer")+"/"; | 194 | QString hdp= locateLocal("data","korganizer")+"/"; |
194 | #endif | 195 | #endif |
195 | 196 | ||
196 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 197 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
197 | 198 | ||
198 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 199 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
199 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 200 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
200 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 201 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
201 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 202 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
202 | 203 | ||
203 | 204 | ||
204 | KPrefs::setCurrentGroup("Locale"); | 205 | KPrefs::setCurrentGroup("Locale"); |
205 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 206 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
206 | 207 | ||
207 | 208 | ||
208 | KPrefs::setCurrentGroup("Colors"); | 209 | KPrefs::setCurrentGroup("Colors"); |
209 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 210 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
210 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 211 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
211 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 212 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
212 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); | 213 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); |
213 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 214 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
214 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 215 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
215 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 216 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
216 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 217 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
217 | addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); | 218 | addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); |
218 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 219 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
219 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 220 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
220 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 221 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
221 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 222 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
222 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 223 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
223 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); | 224 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); |
224 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 225 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
225 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 226 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
226 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 227 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
227 | addItemBool("UseAppColors",&mUseAppColors,false); | 228 | addItemBool("UseAppColors",&mUseAppColors,false); |
228 | 229 | ||
229 | 230 | ||
@@ -270,192 +271,193 @@ KOPrefs::KOPrefs() : | |||
270 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 271 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
271 | #endif | 272 | #endif |
272 | addItemInt("Day Begins",&mDayBegins,7); | 273 | addItemInt("Day Begins",&mDayBegins,7); |
273 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 274 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
274 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 275 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
275 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 276 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
276 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 277 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
277 | 278 | ||
278 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 279 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
279 | addItemBool("Full View Month",&mFullViewMonth,true); | 280 | addItemBool("Full View Month",&mFullViewMonth,true); |
280 | addItemBool("Full View Todo",&mFullViewTodo,true); | 281 | addItemBool("Full View Todo",&mFullViewTodo,true); |
281 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 282 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
282 | 283 | ||
283 | addItemInt("Next X Days",&mNextXDays,3); | 284 | addItemInt("Next X Days",&mNextXDays,3); |
284 | 285 | ||
285 | KPrefs::setCurrentGroup("Printer"); | 286 | KPrefs::setCurrentGroup("Printer"); |
286 | 287 | ||
287 | KPrefs::setCurrentGroup("Layout"); | 288 | KPrefs::setCurrentGroup("Layout"); |
288 | 289 | ||
289 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 290 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
290 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 291 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
291 | 292 | ||
292 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 293 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
293 | 294 | ||
294 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 295 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
295 | 296 | ||
296 | KPrefs::setCurrentGroup("Group Scheduling"); | 297 | KPrefs::setCurrentGroup("Group Scheduling"); |
297 | 298 | ||
298 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 299 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
299 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 300 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
300 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 301 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
301 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 302 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
302 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 303 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
303 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 304 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
304 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 305 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
305 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 306 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
306 | 307 | ||
307 | KPrefs::setCurrentGroup( "Editors" ); | 308 | KPrefs::setCurrentGroup( "Editors" ); |
308 | 309 | ||
309 | addItemStringList( "EventTemplates", &mEventTemplates ); | 310 | addItemStringList( "EventTemplates", &mEventTemplates ); |
310 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 311 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
311 | 312 | ||
312 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 313 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
313 | 314 | ||
314 | KPrefs::setCurrentGroup( "ViewOptions" ); | 315 | KPrefs::setCurrentGroup( "ViewOptions" ); |
315 | addItemBool("EVshowDetails",&mEVshowDetails,true); | 316 | addItemBool("EVshowDetails",&mEVshowDetails,true); |
316 | addItemBool("EVshowCreated",&mEVshowCreated,true); | 317 | addItemBool("EVshowCreated",&mEVshowCreated,true); |
317 | addItemBool("EVshowChanged",&mEVshowChanged,true); | 318 | addItemBool("EVshowChanged",&mEVshowChanged,true); |
318 | addItemBool("WTshowDetails",&mWTshowDetails,false); | 319 | addItemBool("WTshowDetails",&mWTshowDetails,false); |
319 | addItemBool("WTshowCreated",&mWTshowCreated,false); | 320 | addItemBool("WTshowCreated",&mWTshowCreated,false); |
320 | addItemBool("WTshowChanged",&mWTshowChanged,false); | 321 | addItemBool("WTshowChanged",&mWTshowChanged,false); |
321 | mCalendars.setAutoDelete( true ); | 322 | mCalendars.setAutoDelete( true ); |
322 | } | 323 | } |
323 | 324 | ||
324 | 325 | ||
325 | KOPrefs::~KOPrefs() | 326 | KOPrefs::~KOPrefs() |
326 | { | 327 | { |
327 | if (mInstance == this) | 328 | if (mInstance == this) |
328 | mInstance = insd.setObject(0); | 329 | mInstance = insd.setObject(0); |
329 | mCalendars.setAutoDelete( true ); | 330 | mCalendars.setAutoDelete( true ); |
330 | mCalendars.clear(); | 331 | mCalendars.clear(); |
331 | //qDebug("KOPrefs::~KOPrefs() "); | 332 | //qDebug("KOPrefs::~KOPrefs() "); |
332 | } | 333 | } |
333 | 334 | ||
334 | 335 | ||
335 | KOPrefs *KOPrefs::instance() | 336 | KOPrefs *KOPrefs::instance() |
336 | { | 337 | { |
337 | if (!mInstance) { | 338 | if (!mInstance) { |
338 | mInstance = insd.setObject(new KOPrefs()); | 339 | mInstance = insd.setObject(new KOPrefs()); |
339 | mInstance->readConfig(); | 340 | mInstance->readConfig(); |
340 | } | 341 | } |
341 | 342 | ||
342 | return mInstance; | 343 | return mInstance; |
343 | } | 344 | } |
344 | 345 | ||
345 | void KOPrefs::usrSetDefaults() | 346 | void KOPrefs::usrSetDefaults() |
346 | { | 347 | { |
347 | 348 | ||
348 | } | 349 | } |
349 | 350 | ||
350 | void KOPrefs::fillMailDefaults() | 351 | void KOPrefs::fillMailDefaults() |
351 | { | 352 | { |
352 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 353 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
353 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 354 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
354 | } | 355 | } |
355 | 356 | ||
356 | void KOPrefs::setTimeZoneIdDefault() | 357 | void KOPrefs::setTimeZoneIdDefault() |
357 | { | 358 | { |
358 | ; | 359 | ; |
359 | } | 360 | } |
360 | 361 | ||
361 | void KOPrefs::setAllDefaults() | 362 | void KOPrefs::setAllDefaults() |
362 | { | 363 | { |
363 | setCategoryDefaults(); | 364 | setCategoryDefaults(); |
364 | mEventSummaryUser = getDefaultList() ; | 365 | mEventSummaryUser = getDefaultList() ; |
365 | mTodoSummaryUser = getDefaultList() ; | 366 | mTodoSummaryUser = getDefaultList() ; |
367 | mJournalSummaryUser = getDefaultList() ; | ||
366 | mLocationDefaults = getLocationDefaultList(); | 368 | mLocationDefaults = getLocationDefaultList(); |
367 | } | 369 | } |
368 | 370 | ||
369 | void KOPrefs::setCategoryDefaults() | 371 | void KOPrefs::setCategoryDefaults() |
370 | { | 372 | { |
371 | mCustomCategories.clear(); | 373 | mCustomCategories.clear(); |
372 | mCustomCategories = getDefaultList(); | 374 | mCustomCategories = getDefaultList(); |
373 | 375 | ||
374 | QStringList::Iterator it; | 376 | QStringList::Iterator it; |
375 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 377 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
376 | setCategoryColor(*it,mDefaultCategoryColor); | 378 | setCategoryColor(*it,mDefaultCategoryColor); |
377 | } | 379 | } |
378 | } | 380 | } |
379 | QStringList KOPrefs::getLocationDefaultList() | 381 | QStringList KOPrefs::getLocationDefaultList() |
380 | { | 382 | { |
381 | QStringList retval ; | 383 | QStringList retval ; |
382 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 384 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
383 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 385 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
384 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 386 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
385 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 387 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
386 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 388 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
387 | 389 | ||
388 | retval.sort(); | 390 | retval.sort(); |
389 | return retval; | 391 | return retval; |
390 | } | 392 | } |
391 | QStringList KOPrefs::getDefaultList() | 393 | QStringList KOPrefs::getDefaultList() |
392 | { | 394 | { |
393 | QStringList retval ; | 395 | QStringList retval ; |
394 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") | 396 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") |
395 | << i18n("Break") | 397 | << i18n("Break") |
396 | << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") | 398 | << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") |
397 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") | 399 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") |
398 | << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") | 400 | << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") |
399 | << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") | 401 | << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") |
400 | << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") | 402 | << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") |
401 | << i18n("Vacation") ; | 403 | << i18n("Vacation") ; |
402 | retval.sort(); | 404 | retval.sort(); |
403 | //qDebug("cat %s ", retval.join("-").latin1()); | 405 | //qDebug("cat %s ", retval.join("-").latin1()); |
404 | return retval; | 406 | return retval; |
405 | } | 407 | } |
406 | // << 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") | 408 | // << 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") |
407 | void KOPrefs::usrReadConfig() | 409 | void KOPrefs::usrReadConfig() |
408 | { | 410 | { |
409 | config()->setGroup("General"); | 411 | config()->setGroup("General"); |
410 | 412 | ||
411 | //qDebug("KOPrefs::usrReadConfig() "); | 413 | //qDebug("KOPrefs::usrReadConfig() "); |
412 | mCustomCategories = config()->readListEntry("Custom Categories"); | 414 | mCustomCategories = config()->readListEntry("Custom Categories"); |
413 | mOldLoadedLanguage = mOldLanguage ; | 415 | mOldLoadedLanguage = mOldLanguage ; |
414 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 416 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
415 | if (mLocationDefaults.isEmpty()) { | 417 | if (mLocationDefaults.isEmpty()) { |
416 | mLocationDefaults = getLocationDefaultList(); | 418 | mLocationDefaults = getLocationDefaultList(); |
417 | } | 419 | } |
418 | 420 | ||
419 | if (mEventSummaryUser.isEmpty()) { | 421 | if (mEventSummaryUser.isEmpty()) { |
420 | mEventSummaryUser = getDefaultList() ; | 422 | mEventSummaryUser = getDefaultList() ; |
421 | } | 423 | } |
422 | if (mTodoSummaryUser.isEmpty()) { | 424 | if (mTodoSummaryUser.isEmpty()) { |
423 | mTodoSummaryUser = getDefaultList() ; | 425 | mTodoSummaryUser = getDefaultList() ; |
424 | } | 426 | } |
425 | 427 | ||
426 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 428 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
427 | 429 | ||
428 | config()->setGroup("Personal Settings"); | 430 | config()->setGroup("Personal Settings"); |
429 | mName = config()->readEntry("user_name",""); | 431 | mName = config()->readEntry("user_name",""); |
430 | mEmail = config()->readEntry("user_email",""); | 432 | mEmail = config()->readEntry("user_email",""); |
431 | fillMailDefaults(); | 433 | fillMailDefaults(); |
432 | 434 | ||
433 | config()->setGroup("Category Colors"); | 435 | config()->setGroup("Category Colors"); |
434 | QStringList::Iterator it; | 436 | QStringList::Iterator it; |
435 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 437 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
436 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 438 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
437 | 439 | ||
438 | } | 440 | } |
439 | KConfig fc (locateLocal("config","kopicalendarrc")); | 441 | KConfig fc (locateLocal("config","kopicalendarrc")); |
440 | fc.setGroup("CC"); | 442 | fc.setGroup("CC"); |
441 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | 443 | int numCals = fc.readNumEntry("NumberCalendars",0 ); |
442 | mNextAvailableCalendar = 1; | 444 | mNextAvailableCalendar = 1; |
443 | if ( numCals == 0 ) { | 445 | if ( numCals == 0 ) { |
444 | KopiCalendarFile *kkf = getNewCalendar(); | 446 | KopiCalendarFile *kkf = getNewCalendar(); |
445 | kkf->isStandard = true; | 447 | kkf->isStandard = true; |
446 | kkf->mName = i18n("Standard"); | 448 | kkf->mName = i18n("Standard"); |
447 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 449 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
448 | } | 450 | } |
449 | while ( mNextAvailableCalendar <= numCals ) { | 451 | while ( mNextAvailableCalendar <= numCals ) { |
450 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); | 452 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); |
451 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); | 453 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); |
452 | KopiCalendarFile *kkf = getNewCalendar(); | 454 | KopiCalendarFile *kkf = getNewCalendar(); |
453 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); | 455 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); |
454 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); | 456 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); |
455 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); | 457 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); |
456 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); | 458 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); |
457 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); | 459 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); |
458 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); | 460 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); |
459 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); | 461 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); |
460 | if ( kkf->mCalNumber == 1 ) { | 462 | if ( kkf->mCalNumber == 1 ) { |
461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 463 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |