author | zautrix <zautrix> | 2005-02-06 16:25:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-06 16:25:49 (UTC) |
commit | 002a447671cdec6a2ee7940bc183c630c61121fa (patch) (unidiff) | |
tree | 01b119a1aaebdb07fe06756e9baea2c8827d4aaf | |
parent | 5fd7b1cc63dc52c15e0666e023cea60700e9fdcf (diff) | |
download | kdepimpi-002a447671cdec6a2ee7940bc183c630c61121fa.zip kdepimpi-002a447671cdec6a2ee7940bc183c630c61121fa.tar.gz kdepimpi-002a447671cdec6a2ee7940bc183c630c61121fa.tar.bz2 |
fix
-rw-r--r-- | korganizer/koprefs.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 8f37793..576c265 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -125,366 +125,366 @@ KOPrefs::KOPrefs() : | |||
125 | addItemBool("Enable Project View",&mEnableProjectView,false); | 125 | addItemBool("Enable Project View",&mEnableProjectView,false); |
126 | addItemBool("Auto Save",&mAutoSave,false); | 126 | addItemBool("Auto Save",&mAutoSave,false); |
127 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 127 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
128 | addItemBool("Confirm Deletes",&mConfirm,true); | 128 | addItemBool("Confirm Deletes",&mConfirm,true); |
129 | addItemString("Archive File",&mArchiveFile); | 129 | addItemString("Archive File",&mArchiveFile); |
130 | addItemString("Html Export File",&mHtmlExportFile, | 130 | addItemString("Html Export File",&mHtmlExportFile, |
131 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 131 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
132 | addItemBool("Html With Save",&mHtmlWithSave,false); | 132 | addItemBool("Html With Save",&mHtmlWithSave,false); |
133 | 133 | ||
134 | KPrefs::setCurrentGroup("Personal Settings"); | 134 | KPrefs::setCurrentGroup("Personal Settings"); |
135 | 135 | ||
136 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 136 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
137 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 137 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
138 | addItemBool("Bcc",&mBcc,false); | 138 | addItemBool("Bcc",&mBcc,false); |
139 | 139 | ||
140 | KPrefs::setCurrentGroup("Time & Date"); | 140 | KPrefs::setCurrentGroup("Time & Date"); |
141 | 141 | ||
142 | 142 | ||
143 | addItemInt("Default Start Time",&mStartTime,10); | 143 | addItemInt("Default Start Time",&mStartTime,10); |
144 | addItemInt("Default Duration",&mDefaultDuration,2); | 144 | addItemInt("Default Duration",&mDefaultDuration,2); |
145 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 145 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
146 | KPrefs::setCurrentGroup("AlarmSettings"); | 146 | KPrefs::setCurrentGroup("AlarmSettings"); |
147 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 147 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
148 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 148 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
149 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 149 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
150 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 150 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
151 | 151 | ||
152 | 152 | ||
153 | KPrefs::setCurrentGroup("Calendar"); | 153 | KPrefs::setCurrentGroup("Calendar"); |
154 | 154 | ||
155 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 155 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
156 | 156 | ||
157 | KPrefs::setCurrentGroup("Fonts"); | 157 | KPrefs::setCurrentGroup("Fonts"); |
158 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 158 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
159 | addItemFont("TimeBar Font",&mTimeBarFont); | 159 | addItemFont("TimeBar Font",&mTimeBarFont); |
160 | addItemFont("MonthView Font",&mMonthViewFont); | 160 | addItemFont("MonthView Font",&mMonthViewFont); |
161 | addItemFont("AgendaView Font",&mAgendaViewFont); | 161 | addItemFont("AgendaView Font",&mAgendaViewFont); |
162 | addItemFont("MarcusBains Font",&mMarcusBainsFont); | 162 | addItemFont("MarcusBains Font",&mMarcusBainsFont); |
163 | addItemFont("TimeLabels Font",&mTimeLabelsFont); | 163 | addItemFont("TimeLabels Font",&mTimeLabelsFont); |
164 | addItemFont("TodoView Font",&mTodoViewFont); | 164 | addItemFont("TodoView Font",&mTodoViewFont); |
165 | addItemFont("ListView Font",&mListViewFont); | 165 | addItemFont("ListView Font",&mListViewFont); |
166 | addItemFont("DateNavigator Font",&mDateNavigatorFont); | 166 | addItemFont("DateNavigator Font",&mDateNavigatorFont); |
167 | addItemFont("EditBox Font",&mEditBoxFont); | 167 | addItemFont("EditBox Font",&mEditBoxFont); |
168 | addItemFont("JournalView Font",&mJornalViewFont); | 168 | addItemFont("JournalView Font",&mJornalViewFont); |
169 | addItemFont("WhatsNextView Font",&mWhatsNextFont); | 169 | addItemFont("WhatsNextView Font",&mWhatsNextFont); |
170 | addItemFont("EventView Font",&mEventViewFont); | 170 | addItemFont("EventView Font",&mEventViewFont); |
171 | 171 | ||
172 | KPrefs::setCurrentGroup("RemoteSyncing"); | 172 | KPrefs::setCurrentGroup("RemoteSyncing"); |
173 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 173 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
174 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 174 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
175 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 175 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
176 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 176 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
177 | 177 | ||
178 | #ifdef _WIN32_ | 178 | #ifdef _WIN32_ |
179 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 179 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
180 | #else | 180 | #else |
181 | QString hdp= locateLocal("data","korganizer")+"/"; | 181 | QString hdp= locateLocal("data","korganizer")+"/"; |
182 | #endif | 182 | #endif |
183 | 183 | ||
184 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 184 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
185 | 185 | ||
186 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 186 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
187 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 187 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
188 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 188 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
189 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 189 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
190 | 190 | ||
191 | 191 | ||
192 | KPrefs::setCurrentGroup("Locale"); | 192 | KPrefs::setCurrentGroup("Locale"); |
193 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 193 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
194 | 194 | ||
195 | 195 | ||
196 | KPrefs::setCurrentGroup("Colors"); | 196 | KPrefs::setCurrentGroup("Colors"); |
197 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 197 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
198 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 198 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
199 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 199 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
200 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); | 200 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); |
201 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 201 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
202 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 202 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
203 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 203 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
204 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 204 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
205 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 205 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
206 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 206 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
207 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 207 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
208 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 208 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
209 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 209 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
210 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); | 210 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); |
211 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 211 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
212 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 212 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
213 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 213 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
214 | addItemBool("UseAppColors",&mUseAppColors,false); | 214 | addItemBool("UseAppColors",&mUseAppColors,false); |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | KPrefs::setCurrentGroup("Views"); | 218 | KPrefs::setCurrentGroup("Views"); |
219 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 219 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
220 | addItemInt("Hour Size",&mHourSize,8); | 220 | addItemInt("Hour Size",&mHourSize,8); |
221 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 221 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
222 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 222 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
223 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 223 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
224 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 224 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
225 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 225 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
226 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 226 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
227 | #ifdef DESKTOP_VERION | 227 | #ifdef DESKTOP_VERION |
228 | addItemBool("Enable ToolTips",&mEnableToolTips,true); | 228 | addItemBool("Enable ToolTips",&mEnableToolTips,true); |
229 | #else | 229 | #else |
230 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 230 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
231 | #endif | 231 | #endif |
232 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 232 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
233 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 233 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
234 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 234 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
235 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 235 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
236 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 236 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
237 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 237 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
238 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 238 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
239 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 239 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
240 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 240 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
241 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 241 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
242 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 242 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
243 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 243 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
244 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 244 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
245 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 245 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
246 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 246 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
247 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 247 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
248 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); | 248 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
249 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | 249 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); |
250 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 250 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
251 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 251 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
252 | #ifdef DESKTOP_VERSION | 252 | #ifdef DESKTOP_VERSION |
253 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 253 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
254 | #else | 254 | #else |
255 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 255 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
256 | #endif | 256 | #endif |
257 | addItemInt("Day Begins",&mDayBegins,7); | 257 | addItemInt("Day Begins",&mDayBegins,7); |
258 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 258 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
259 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 259 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
260 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 260 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
261 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 261 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
262 | 262 | ||
263 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 263 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
264 | addItemBool("Full View Month",&mFullViewMonth,true); | 264 | addItemBool("Full View Month",&mFullViewMonth,true); |
265 | addItemBool("Full View Todo",&mFullViewTodo,true); | 265 | addItemBool("Full View Todo",&mFullViewTodo,true); |
266 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 266 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
267 | 267 | ||
268 | addItemInt("Next X Days",&mNextXDays,3); | 268 | addItemInt("Next X Days",&mNextXDays,3); |
269 | 269 | ||
270 | KPrefs::setCurrentGroup("Printer"); | 270 | KPrefs::setCurrentGroup("Printer"); |
271 | 271 | ||
272 | KPrefs::setCurrentGroup("Layout"); | 272 | KPrefs::setCurrentGroup("Layout"); |
273 | 273 | ||
274 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 274 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
275 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 275 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
276 | 276 | ||
277 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 277 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
278 | 278 | ||
279 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 279 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
280 | 280 | ||
281 | KPrefs::setCurrentGroup("Group Scheduling"); | 281 | KPrefs::setCurrentGroup("Group Scheduling"); |
282 | 282 | ||
283 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 283 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
284 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 284 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
285 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 285 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
286 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 286 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
287 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 287 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
288 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 288 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
289 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 289 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
290 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 290 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
291 | 291 | ||
292 | KPrefs::setCurrentGroup( "Editors" ); | 292 | KPrefs::setCurrentGroup( "Editors" ); |
293 | 293 | ||
294 | addItemStringList( "EventTemplates", &mEventTemplates ); | 294 | addItemStringList( "EventTemplates", &mEventTemplates ); |
295 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 295 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
296 | 296 | ||
297 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 297 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
298 | 298 | ||
299 | 299 | ||
300 | 300 | ||
301 | } | 301 | } |
302 | 302 | ||
303 | 303 | ||
304 | KOPrefs::~KOPrefs() | 304 | KOPrefs::~KOPrefs() |
305 | { | 305 | { |
306 | if (mInstance == this) | 306 | if (mInstance == this) |
307 | mInstance = insd.setObject(0); | 307 | mInstance = insd.setObject(0); |
308 | 308 | ||
309 | //qDebug("KOPrefs::~KOPrefs() "); | 309 | //qDebug("KOPrefs::~KOPrefs() "); |
310 | } | 310 | } |
311 | 311 | ||
312 | 312 | ||
313 | KOPrefs *KOPrefs::instance() | 313 | KOPrefs *KOPrefs::instance() |
314 | { | 314 | { |
315 | if (!mInstance) { | 315 | if (!mInstance) { |
316 | mInstance = insd.setObject(new KOPrefs()); | 316 | mInstance = insd.setObject(new KOPrefs()); |
317 | mInstance->readConfig(); | 317 | mInstance->readConfig(); |
318 | } | 318 | } |
319 | 319 | ||
320 | return mInstance; | 320 | return mInstance; |
321 | } | 321 | } |
322 | 322 | ||
323 | void KOPrefs::usrSetDefaults() | 323 | void KOPrefs::usrSetDefaults() |
324 | { | 324 | { |
325 | 325 | ||
326 | } | 326 | } |
327 | 327 | ||
328 | void KOPrefs::fillMailDefaults() | 328 | void KOPrefs::fillMailDefaults() |
329 | { | 329 | { |
330 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 330 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
331 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 331 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
332 | } | 332 | } |
333 | 333 | ||
334 | void KOPrefs::setTimeZoneIdDefault() | 334 | void KOPrefs::setTimeZoneIdDefault() |
335 | { | 335 | { |
336 | ; | 336 | ; |
337 | } | 337 | } |
338 | 338 | ||
339 | void KOPrefs::setAllDefaults() | 339 | void KOPrefs::setAllDefaults() |
340 | { | 340 | { |
341 | setCategoryDefaults(); | 341 | setCategoryDefaults(); |
342 | mEventSummaryUser = getDefaultList() ; | 342 | mEventSummaryUser = getDefaultList() ; |
343 | mTodoSummaryUser = getDefaultList() ; | 343 | mTodoSummaryUser = getDefaultList() ; |
344 | mLocationDefaults = getLocationDefaultList(); | 344 | mLocationDefaults = getLocationDefaultList(); |
345 | } | 345 | } |
346 | 346 | ||
347 | void KOPrefs::setCategoryDefaults() | 347 | void KOPrefs::setCategoryDefaults() |
348 | { | 348 | { |
349 | mCustomCategories.clear(); | 349 | mCustomCategories.clear(); |
350 | mCustomCategories = getDefaultList(); | 350 | mCustomCategories = getDefaultList(); |
351 | 351 | ||
352 | QStringList::Iterator it; | 352 | QStringList::Iterator it; |
353 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 353 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
354 | setCategoryColor(*it,mDefaultCategoryColor); | 354 | setCategoryColor(*it,mDefaultCategoryColor); |
355 | } | 355 | } |
356 | } | 356 | } |
357 | QStringList KOPrefs::getLocationDefaultList() | 357 | QStringList KOPrefs::getLocationDefaultList() |
358 | { | 358 | { |
359 | QStringList retval ; | 359 | QStringList retval ; |
360 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 360 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
361 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 361 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
362 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 362 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
363 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 363 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
364 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 364 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
365 | 365 | ||
366 | retval.sort(); | 366 | retval.sort(); |
367 | return retval; | 367 | return retval; |
368 | } | 368 | } |
369 | QStringList KOPrefs::getDefaultList() | 369 | QStringList KOPrefs::getDefaultList() |
370 | { | 370 | { |
371 | QStringList retval ; | 371 | QStringList retval ; |
372 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 372 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
373 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 373 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
374 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 374 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
375 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 375 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
376 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 376 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
377 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 377 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
378 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 378 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
379 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 379 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
380 | retval.sort(); | 380 | retval.sort(); |
381 | qDebug("cat %s ", retval.join("-").latin1()); | 381 | //qDebug("cat %s ", retval.join("-").latin1()); |
382 | return retval; | 382 | return retval; |
383 | } | 383 | } |
384 | 384 | ||
385 | void KOPrefs::usrReadConfig() | 385 | void KOPrefs::usrReadConfig() |
386 | { | 386 | { |
387 | config()->setGroup("General"); | 387 | config()->setGroup("General"); |
388 | 388 | ||
389 | //qDebug("KOPrefs::usrReadConfig() "); | 389 | //qDebug("KOPrefs::usrReadConfig() "); |
390 | mCustomCategories = config()->readListEntry("Custom Categories"); | 390 | mCustomCategories = config()->readListEntry("Custom Categories"); |
391 | mOldLoadedLanguage = mOldLanguage ; | 391 | mOldLoadedLanguage = mOldLanguage ; |
392 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 392 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
393 | if (mLocationDefaults.isEmpty()) { | 393 | if (mLocationDefaults.isEmpty()) { |
394 | mLocationDefaults = getLocationDefaultList(); | 394 | mLocationDefaults = getLocationDefaultList(); |
395 | } | 395 | } |
396 | 396 | ||
397 | if (mEventSummaryUser.isEmpty()) { | 397 | if (mEventSummaryUser.isEmpty()) { |
398 | mEventSummaryUser = getDefaultList() ; | 398 | mEventSummaryUser = getDefaultList() ; |
399 | } | 399 | } |
400 | if (mTodoSummaryUser.isEmpty()) { | 400 | if (mTodoSummaryUser.isEmpty()) { |
401 | mTodoSummaryUser = getDefaultList() ; | 401 | mTodoSummaryUser = getDefaultList() ; |
402 | } | 402 | } |
403 | 403 | ||
404 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 404 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
405 | 405 | ||
406 | config()->setGroup("Personal Settings"); | 406 | config()->setGroup("Personal Settings"); |
407 | mName = config()->readEntry("user_name",""); | 407 | mName = config()->readEntry("user_name",""); |
408 | mEmail = config()->readEntry("user_email",""); | 408 | mEmail = config()->readEntry("user_email",""); |
409 | fillMailDefaults(); | 409 | fillMailDefaults(); |
410 | 410 | ||
411 | config()->setGroup("Category Colors"); | 411 | config()->setGroup("Category Colors"); |
412 | QStringList::Iterator it; | 412 | QStringList::Iterator it; |
413 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 413 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
414 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 414 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
415 | 415 | ||
416 | } | 416 | } |
417 | 417 | ||
418 | KPimPrefs::usrReadConfig(); | 418 | KPimPrefs::usrReadConfig(); |
419 | } | 419 | } |
420 | 420 | ||
421 | 421 | ||
422 | void KOPrefs::usrWriteConfig() | 422 | void KOPrefs::usrWriteConfig() |
423 | { | 423 | { |
424 | config()->setGroup("General"); | 424 | config()->setGroup("General"); |
425 | config()->writeEntry("Custom Categories",mCustomCategories); | 425 | config()->writeEntry("Custom Categories",mCustomCategories); |
426 | 426 | ||
427 | config()->setGroup("Personal Settings"); | 427 | config()->setGroup("Personal Settings"); |
428 | config()->writeEntry("user_name",mName); | 428 | config()->writeEntry("user_name",mName); |
429 | config()->writeEntry("user_email",mEmail); | 429 | config()->writeEntry("user_email",mEmail); |
430 | 430 | ||
431 | config()->setGroup("Category Colors"); | 431 | config()->setGroup("Category Colors"); |
432 | QDictIterator<QColor> it(mCategoryColors); | 432 | QDictIterator<QColor> it(mCategoryColors); |
433 | while (it.current()) { | 433 | while (it.current()) { |
434 | config()->writeEntry(it.currentKey(),*(it.current())); | 434 | config()->writeEntry(it.currentKey(),*(it.current())); |
435 | ++it; | 435 | ++it; |
436 | } | 436 | } |
437 | 437 | ||
438 | 438 | ||
439 | KPimPrefs::usrWriteConfig(); | 439 | KPimPrefs::usrWriteConfig(); |
440 | } | 440 | } |
441 | 441 | ||
442 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 442 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
443 | { | 443 | { |
444 | mCategoryColors.replace(cat,new QColor(color)); | 444 | mCategoryColors.replace(cat,new QColor(color)); |
445 | } | 445 | } |
446 | 446 | ||
447 | QColor *KOPrefs::categoryColor(QString cat) | 447 | QColor *KOPrefs::categoryColor(QString cat) |
448 | { | 448 | { |
449 | QColor *color = 0; | 449 | QColor *color = 0; |
450 | 450 | ||
451 | if (!cat.isEmpty()) color = mCategoryColors[cat]; | 451 | if (!cat.isEmpty()) color = mCategoryColors[cat]; |
452 | 452 | ||
453 | if (color) return color; | 453 | if (color) return color; |
454 | else return &mDefaultCategoryColor; | 454 | else return &mDefaultCategoryColor; |
455 | } | 455 | } |
456 | 456 | ||
457 | void KOPrefs::setFullName(const QString &name) | 457 | void KOPrefs::setFullName(const QString &name) |
458 | { | 458 | { |
459 | mName = name; | 459 | mName = name; |
460 | } | 460 | } |
461 | 461 | ||
462 | void KOPrefs::setEmail(const QString &email) | 462 | void KOPrefs::setEmail(const QString &email) |
463 | { | 463 | { |
464 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); | 464 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); |
465 | mEmail = email; | 465 | mEmail = email; |
466 | } | 466 | } |
467 | 467 | ||
468 | QString KOPrefs::fullName() | 468 | QString KOPrefs::fullName() |
469 | { | 469 | { |
470 | if (mEmailControlCenter) { | 470 | if (mEmailControlCenter) { |
471 | KEMailSettings settings; | 471 | KEMailSettings settings; |
472 | return settings.getSetting(KEMailSettings::RealName); | 472 | return settings.getSetting(KEMailSettings::RealName); |
473 | } else { | 473 | } else { |
474 | return mName; | 474 | return mName; |
475 | } | 475 | } |
476 | } | 476 | } |
477 | 477 | ||
478 | QString KOPrefs::email() | 478 | QString KOPrefs::email() |
479 | { | 479 | { |
480 | if (mEmailControlCenter) { | 480 | if (mEmailControlCenter) { |
481 | KEMailSettings settings; | 481 | KEMailSettings settings; |
482 | return settings.getSetting(KEMailSettings::EmailAddress); | 482 | return settings.getSetting(KEMailSettings::EmailAddress); |
483 | } else { | 483 | } else { |
484 | return mEmail; | 484 | return mEmail; |
485 | } | 485 | } |
486 | } | 486 | } |
487 | KConfig* KOPrefs::getConfig() | 487 | KConfig* KOPrefs::getConfig() |
488 | { | 488 | { |
489 | return config(); | 489 | return config(); |
490 | } | 490 | } |