-rw-r--r-- | korganizer/koprefs.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5efc247..a91074f 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -198,193 +198,199 @@ KOPrefs::KOPrefs() : | |||
198 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 198 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
199 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 199 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
200 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 200 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
201 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 201 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
202 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 202 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
203 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 203 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
204 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 204 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
205 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); | 205 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); |
206 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 206 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
207 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 207 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
208 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 208 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
209 | addItemBool("UseAppColors",&mUseAppColors,false); | 209 | addItemBool("UseAppColors",&mUseAppColors,false); |
210 | 210 | ||
211 | 211 | ||
212 | 212 | ||
213 | KPrefs::setCurrentGroup("Views"); | 213 | KPrefs::setCurrentGroup("Views"); |
214 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 214 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
215 | addItemInt("Hour Size",&mHourSize,8); | 215 | addItemInt("Hour Size",&mHourSize,8); |
216 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 216 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
217 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 217 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
218 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 218 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
219 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 219 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
220 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 220 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
221 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 221 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
222 | #ifdef DESKTOP_VERION | 222 | #ifdef DESKTOP_VERION |
223 | addItemBool("Enable ToolTips",&mEnableToolTips,true); | 223 | addItemBool("Enable ToolTips",&mEnableToolTips,true); |
224 | #else | 224 | #else |
225 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 225 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
226 | #endif | 226 | #endif |
227 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 227 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
228 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 228 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
229 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 229 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
230 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 230 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
231 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 231 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
232 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 232 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
233 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 233 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
234 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 234 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
235 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 235 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
236 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 236 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
237 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 237 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
238 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 238 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
239 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 239 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
240 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 240 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
241 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 241 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
242 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 242 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
243 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); | 243 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
244 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | 244 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); |
245 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 245 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
246 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 246 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
247 | #ifdef DESKTOP_VERSION | 247 | #ifdef DESKTOP_VERSION |
248 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 248 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
249 | #else | 249 | #else |
250 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 250 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
251 | #endif | 251 | #endif |
252 | addItemInt("Day Begins",&mDayBegins,7); | 252 | addItemInt("Day Begins",&mDayBegins,7); |
253 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 253 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
254 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 254 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
255 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 255 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
256 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 256 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
257 | 257 | ||
258 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 258 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
259 | addItemBool("Full View Month",&mFullViewMonth,true); | 259 | addItemBool("Full View Month",&mFullViewMonth,true); |
260 | addItemBool("Full View Todo",&mFullViewTodo,true); | 260 | addItemBool("Full View Todo",&mFullViewTodo,true); |
261 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 261 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
262 | 262 | ||
263 | addItemInt("Next X Days",&mNextXDays,3); | 263 | addItemInt("Next X Days",&mNextXDays,3); |
264 | 264 | ||
265 | KPrefs::setCurrentGroup("Printer"); | 265 | KPrefs::setCurrentGroup("Printer"); |
266 | 266 | ||
267 | KPrefs::setCurrentGroup("Layout"); | 267 | KPrefs::setCurrentGroup("Layout"); |
268 | 268 | ||
269 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 269 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
270 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 270 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
271 | 271 | ||
272 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 272 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
273 | 273 | ||
274 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 274 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
275 | 275 | ||
276 | KPrefs::setCurrentGroup("Group Scheduling"); | 276 | KPrefs::setCurrentGroup("Group Scheduling"); |
277 | 277 | ||
278 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 278 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
279 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 279 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
280 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 280 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
281 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 281 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
282 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 282 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
283 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 283 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
284 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 284 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
285 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 285 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
286 | 286 | ||
287 | KPrefs::setCurrentGroup( "Editors" ); | 287 | KPrefs::setCurrentGroup( "Editors" ); |
288 | 288 | ||
289 | addItemStringList( "EventTemplates", &mEventTemplates ); | 289 | addItemStringList( "EventTemplates", &mEventTemplates ); |
290 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 290 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
291 | 291 | ||
292 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 292 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
293 | 293 | ||
294 | 294 | KPrefs::setCurrentGroup( "ViewOptions" ); | |
295 | addItemBool("EVshowDetails",&mEVshowDetails,true); | ||
296 | addItemBool("EVshowCreated",&mEVshowCreated,true); | ||
297 | addItemBool("EVshowChanged",&mEVshowChanged,true); | ||
298 | addItemBool("WTshowDetails",&mWTshowDetails,false); | ||
299 | addItemBool("WTshowCreated",&mWTshowCreated,false); | ||
300 | addItemBool("WTshowChanged",&mWTshowChanged,false); | ||
295 | 301 | ||
296 | } | 302 | } |
297 | 303 | ||
298 | 304 | ||
299 | KOPrefs::~KOPrefs() | 305 | KOPrefs::~KOPrefs() |
300 | { | 306 | { |
301 | if (mInstance == this) | 307 | if (mInstance == this) |
302 | mInstance = insd.setObject(0); | 308 | mInstance = insd.setObject(0); |
303 | 309 | ||
304 | //qDebug("KOPrefs::~KOPrefs() "); | 310 | //qDebug("KOPrefs::~KOPrefs() "); |
305 | } | 311 | } |
306 | 312 | ||
307 | 313 | ||
308 | KOPrefs *KOPrefs::instance() | 314 | KOPrefs *KOPrefs::instance() |
309 | { | 315 | { |
310 | if (!mInstance) { | 316 | if (!mInstance) { |
311 | mInstance = insd.setObject(new KOPrefs()); | 317 | mInstance = insd.setObject(new KOPrefs()); |
312 | mInstance->readConfig(); | 318 | mInstance->readConfig(); |
313 | } | 319 | } |
314 | 320 | ||
315 | return mInstance; | 321 | return mInstance; |
316 | } | 322 | } |
317 | 323 | ||
318 | void KOPrefs::usrSetDefaults() | 324 | void KOPrefs::usrSetDefaults() |
319 | { | 325 | { |
320 | 326 | ||
321 | } | 327 | } |
322 | 328 | ||
323 | void KOPrefs::fillMailDefaults() | 329 | void KOPrefs::fillMailDefaults() |
324 | { | 330 | { |
325 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 331 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
326 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 332 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
327 | } | 333 | } |
328 | 334 | ||
329 | void KOPrefs::setTimeZoneIdDefault() | 335 | void KOPrefs::setTimeZoneIdDefault() |
330 | { | 336 | { |
331 | ; | 337 | ; |
332 | } | 338 | } |
333 | 339 | ||
334 | void KOPrefs::setAllDefaults() | 340 | void KOPrefs::setAllDefaults() |
335 | { | 341 | { |
336 | setCategoryDefaults(); | 342 | setCategoryDefaults(); |
337 | mEventSummaryUser = getDefaultList() ; | 343 | mEventSummaryUser = getDefaultList() ; |
338 | mTodoSummaryUser = getDefaultList() ; | 344 | mTodoSummaryUser = getDefaultList() ; |
339 | mLocationDefaults = getLocationDefaultList(); | 345 | mLocationDefaults = getLocationDefaultList(); |
340 | } | 346 | } |
341 | 347 | ||
342 | void KOPrefs::setCategoryDefaults() | 348 | void KOPrefs::setCategoryDefaults() |
343 | { | 349 | { |
344 | mCustomCategories.clear(); | 350 | mCustomCategories.clear(); |
345 | mCustomCategories = getDefaultList(); | 351 | mCustomCategories = getDefaultList(); |
346 | 352 | ||
347 | QStringList::Iterator it; | 353 | QStringList::Iterator it; |
348 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 354 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
349 | setCategoryColor(*it,mDefaultCategoryColor); | 355 | setCategoryColor(*it,mDefaultCategoryColor); |
350 | } | 356 | } |
351 | } | 357 | } |
352 | QStringList KOPrefs::getLocationDefaultList() | 358 | QStringList KOPrefs::getLocationDefaultList() |
353 | { | 359 | { |
354 | QStringList retval ; | 360 | QStringList retval ; |
355 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 361 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
356 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 362 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
357 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 363 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
358 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 364 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
359 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 365 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
360 | 366 | ||
361 | retval.sort(); | 367 | retval.sort(); |
362 | return retval; | 368 | return retval; |
363 | } | 369 | } |
364 | QStringList KOPrefs::getDefaultList() | 370 | QStringList KOPrefs::getDefaultList() |
365 | { | 371 | { |
366 | QStringList retval ; | 372 | QStringList retval ; |
367 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 373 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
368 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 374 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
369 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 375 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
370 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 376 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
371 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 377 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
372 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 378 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
373 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 379 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
374 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 380 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
375 | retval.sort(); | 381 | retval.sort(); |
376 | //qDebug("cat %s ", retval.join("-").latin1()); | 382 | //qDebug("cat %s ", retval.join("-").latin1()); |
377 | return retval; | 383 | return retval; |
378 | } | 384 | } |
379 | 385 | ||
380 | void KOPrefs::usrReadConfig() | 386 | void KOPrefs::usrReadConfig() |
381 | { | 387 | { |
382 | config()->setGroup("General"); | 388 | config()->setGroup("General"); |
383 | 389 | ||
384 | //qDebug("KOPrefs::usrReadConfig() "); | 390 | //qDebug("KOPrefs::usrReadConfig() "); |
385 | mCustomCategories = config()->readListEntry("Custom Categories"); | 391 | mCustomCategories = config()->readListEntry("Custom Categories"); |
386 | mOldLoadedLanguage = mOldLanguage ; | 392 | mOldLoadedLanguage = mOldLanguage ; |
387 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 393 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
388 | if (mLocationDefaults.isEmpty()) { | 394 | if (mLocationDefaults.isEmpty()) { |
389 | mLocationDefaults = getLocationDefaultList(); | 395 | mLocationDefaults = getLocationDefaultList(); |
390 | } | 396 | } |