-rw-r--r-- | korganizer/koprefs.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 138028d..a63297e 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -1,151 +1,152 @@ | |||
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 | ||
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 | mGlobalUpdateDisabled = false; | ||
56 | mCategoryColors.setAutoDelete(true); | 57 | mCategoryColors.setAutoDelete(true); |
57 | fillMailDefaults(); | 58 | fillMailDefaults(); |
58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 59 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
59 | QColor defaultHolidayColor = QColor(255,0,0); | 60 | QColor defaultHolidayColor = QColor(255,0,0); |
60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 61 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 62 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 63 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 64 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
64 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 65 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
65 | QColor defaultTodoRunColor = QColor(99,194,30); | 66 | QColor defaultTodoRunColor = QColor(99,194,30); |
66 | KPrefs::setCurrentGroup("General"); | 67 | KPrefs::setCurrentGroup("General"); |
67 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 68 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
68 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 69 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
69 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 70 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
70 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 71 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
71 | addItemBool("ShowIconList",&mShowIconList,true); | 72 | addItemBool("ShowIconList",&mShowIconList,true); |
72 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 73 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
73 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 74 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
74 | addItemBool("ShowIconDay6",&mShowIconDay6,true); | 75 | addItemBool("ShowIconDay6",&mShowIconDay6,true); |
75 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 76 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
76 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 77 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
77 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 78 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
78 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 79 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
79 | addItemBool("ShowIconBack",&mShowIconBack,true); | 80 | addItemBool("ShowIconBack",&mShowIconBack,true); |
80 | addItemBool("ShowIconToday",&mShowIconToday,true); | 81 | addItemBool("ShowIconToday",&mShowIconToday,true); |
81 | addItemBool("ShowIconForward",&mShowIconForward,true); | 82 | addItemBool("ShowIconForward",&mShowIconForward,true); |
82 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 83 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
83 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); | 84 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); |
84 | addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); | 85 | addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); |
85 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 86 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
86 | addItemBool("ShowIconNext",&mShowIconNext,true); | 87 | addItemBool("ShowIconNext",&mShowIconNext,true); |
87 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 88 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
88 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 89 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
89 | addItemBool("ShowIconFilter",&mShowIconFilter,false); | 90 | addItemBool("ShowIconFilter",&mShowIconFilter,false); |
90 | addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); | 91 | addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); |
91 | 92 | ||
92 | bool addIcons = false; | 93 | bool addIcons = false; |
93 | #ifdef DESKTOP_VERSION | 94 | #ifdef DESKTOP_VERSION |
94 | addIcons = true; | 95 | addIcons = true; |
95 | #endif | 96 | #endif |
96 | addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); | 97 | addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); |
97 | addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); | 98 | addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); |
98 | addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); | 99 | addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); |
99 | addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); | 100 | addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); |
100 | 101 | ||
101 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); | 102 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); |
102 | 103 | ||
103 | addItemBool("AskForQuit",&mAskForQuit,false); | 104 | addItemBool("AskForQuit",&mAskForQuit,false); |
104 | 105 | ||
105 | #ifndef DESKTOP_VERSION | 106 | #ifndef DESKTOP_VERSION |
106 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 107 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
107 | #else | 108 | #else |
108 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 109 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
109 | #endif | 110 | #endif |
110 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 111 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
111 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 112 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
112 | addItemBool("ToolBarHorV",&mToolBarHorV, true ); | 113 | addItemBool("ToolBarHorV",&mToolBarHorV, true ); |
113 | addItemBool("ToolBarUpV",&mToolBarUpV, false ); | 114 | addItemBool("ToolBarUpV",&mToolBarUpV, false ); |
114 | addItemBool("ToolBarHorN",&mToolBarHorN, true ); | 115 | addItemBool("ToolBarHorN",&mToolBarHorN, true ); |
115 | addItemBool("ToolBarUpN",&mToolBarUpN, false ); | 116 | addItemBool("ToolBarUpN",&mToolBarUpN, false ); |
116 | addItemBool("ToolBarHorF",&mToolBarHorF, true ); | 117 | addItemBool("ToolBarHorF",&mToolBarHorF, true ); |
117 | addItemBool("ToolBarUpF",&mToolBarUpF, false ); | 118 | addItemBool("ToolBarUpF",&mToolBarUpF, false ); |
118 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 119 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
119 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 120 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
120 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 121 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
121 | 122 | ||
122 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 123 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
123 | addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); | 124 | addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); |
124 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); | 125 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); |
125 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); | 126 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); |
126 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 127 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
127 | addItemInt("AllDay Size",&mAllDaySize,28); | 128 | addItemInt("AllDay Size",&mAllDaySize,28); |
128 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 129 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
129 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 130 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
130 | 131 | ||
131 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 132 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
132 | addItemStringList("EventSummary User",&mEventSummaryUser); | 133 | addItemStringList("EventSummary User",&mEventSummaryUser); |
133 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 134 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
134 | addItemStringList("JournalSummary User",&mJournalSummaryUser); | 135 | addItemStringList("JournalSummary User",&mJournalSummaryUser); |
135 | 136 | ||
136 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 137 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
137 | addItemBool("Enable Project View",&mEnableProjectView,false); | 138 | addItemBool("Enable Project View",&mEnableProjectView,false); |
138 | addItemBool("Auto Save",&mAutoSave,false); | 139 | addItemBool("Auto Save",&mAutoSave,false); |
139 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 140 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
140 | addItemBool("Confirm Deletes",&mConfirm,true); | 141 | addItemBool("Confirm Deletes",&mConfirm,true); |
141 | addItemString("Archive File",&mArchiveFile); | 142 | addItemString("Archive File",&mArchiveFile); |
142 | addItemString("Html Export File",&mHtmlExportFile, | 143 | addItemString("Html Export File",&mHtmlExportFile, |
143 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 144 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
144 | addItemBool("Html With Save",&mHtmlWithSave,false); | 145 | addItemBool("Html With Save",&mHtmlWithSave,false); |
145 | 146 | ||
146 | KPrefs::setCurrentGroup("Personal Settings"); | 147 | KPrefs::setCurrentGroup("Personal Settings"); |
147 | 148 | ||
148 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 149 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
149 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 150 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
150 | addItemBool("Bcc",&mBcc,false); | 151 | addItemBool("Bcc",&mBcc,false); |
151 | 152 | ||
@@ -226,193 +227,193 @@ KOPrefs::KOPrefs() : | |||
226 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 227 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
227 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 228 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
228 | addItemBool("UseAppColors",&mUseAppColors,false); | 229 | addItemBool("UseAppColors",&mUseAppColors,false); |
229 | 230 | ||
230 | 231 | ||
231 | 232 | ||
232 | KPrefs::setCurrentGroup("Views"); | 233 | KPrefs::setCurrentGroup("Views"); |
233 | addItemBool("Block Popup Menu",&mBlockPopupMenu,false); | 234 | addItemBool("Block Popup Menu",&mBlockPopupMenu,false); |
234 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 235 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
235 | addItemInt("Hour Size",&mHourSize,8); | 236 | addItemInt("Hour Size",&mHourSize,8); |
236 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 237 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
237 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 238 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
238 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 239 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
239 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 240 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
240 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 241 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
241 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 242 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
242 | addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); | 243 | addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); |
243 | #ifdef DESKTOP_VERION | 244 | #ifdef DESKTOP_VERION |
244 | addItemBool("Enable ToolTips",&mEnableToolTips,true); | 245 | addItemBool("Enable ToolTips",&mEnableToolTips,true); |
245 | #else | 246 | #else |
246 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 247 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
247 | #endif | 248 | #endif |
248 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 249 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
249 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 250 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
250 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 251 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
251 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 252 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
252 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 253 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
253 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 254 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
254 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 255 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
255 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 256 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
256 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 257 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
257 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 258 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
258 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 259 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
259 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 260 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
260 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 261 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
261 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 262 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
262 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 263 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
263 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 264 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
264 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); | 265 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
265 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | 266 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); |
266 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 267 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
267 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 268 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
268 | #ifdef DESKTOP_VERSION | 269 | #ifdef DESKTOP_VERSION |
269 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 270 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
270 | #else | 271 | #else |
271 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 272 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
272 | #endif | 273 | #endif |
273 | addItemInt("Day Begins",&mDayBegins,7); | 274 | addItemInt("Day Begins",&mDayBegins,7); |
274 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 275 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
275 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 276 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
276 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 277 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
277 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 278 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
278 | 279 | ||
279 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 280 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
280 | addItemBool("Full View Month",&mFullViewMonth,true); | 281 | addItemBool("Full View Month",&mFullViewMonth,true); |
281 | addItemBool("Full View Todo",&mFullViewTodo,true); | 282 | addItemBool("Full View Todo",&mFullViewTodo,true); |
282 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 283 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
283 | 284 | ||
284 | addItemInt("Next X Days",&mNextXDays,3); | 285 | addItemInt("Next X Days",&mNextXDays,3); |
285 | 286 | ||
286 | KPrefs::setCurrentGroup("Printer"); | 287 | KPrefs::setCurrentGroup("Printer"); |
287 | 288 | ||
288 | KPrefs::setCurrentGroup("Layout"); | 289 | KPrefs::setCurrentGroup("Layout"); |
289 | 290 | ||
290 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 291 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
291 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 292 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
292 | 293 | ||
293 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 294 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
294 | 295 | ||
295 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 296 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
296 | 297 | ||
297 | KPrefs::setCurrentGroup("Group Scheduling"); | 298 | KPrefs::setCurrentGroup("Group Scheduling"); |
298 | 299 | ||
299 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 300 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
300 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 301 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
301 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 302 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
302 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 303 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
303 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 304 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
304 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 305 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
305 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 306 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
306 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 307 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
307 | 308 | ||
308 | KPrefs::setCurrentGroup( "Editors" ); | 309 | KPrefs::setCurrentGroup( "Editors" ); |
309 | 310 | ||
310 | addItemStringList( "EventTemplates", &mEventTemplates ); | 311 | addItemStringList( "EventTemplates", &mEventTemplates ); |
311 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 312 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
312 | 313 | ||
313 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 314 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
314 | 315 | ||
315 | KPrefs::setCurrentGroup( "ViewOptions" ); | 316 | KPrefs::setCurrentGroup( "ViewOptions" ); |
316 | addItemBool("EVshowDetails",&mEVshowDetails,true); | 317 | addItemBool("EVshowDetails",&mEVshowDetails,true); |
317 | addItemBool("EVshowCreated",&mEVshowCreated,true); | 318 | addItemBool("EVshowCreated",&mEVshowCreated,true); |
318 | addItemBool("EVshowChanged",&mEVshowChanged,true); | 319 | addItemBool("EVshowChanged",&mEVshowChanged,true); |
319 | addItemBool("WTshowDetails",&mWTshowDetails,false); | 320 | addItemBool("WTshowDetails",&mWTshowDetails,false); |
320 | addItemBool("WTshowCreated",&mWTshowCreated,false); | 321 | addItemBool("WTshowCreated",&mWTshowCreated,false); |
321 | addItemBool("WTshowChanged",&mWTshowChanged,false); | 322 | addItemBool("WTshowChanged",&mWTshowChanged,false); |
322 | mCalendars.setAutoDelete( true ); | 323 | mCalendars.setAutoDelete( true ); |
323 | } | 324 | } |
324 | 325 | ||
325 | 326 | ||
326 | KOPrefs::~KOPrefs() | 327 | KOPrefs::~KOPrefs() |
327 | { | 328 | { |
328 | if (mInstance == this) | 329 | if (mInstance == this) |
329 | mInstance = insd.setObject(0); | 330 | mInstance = insd.setObject(0); |
330 | mCalendars.setAutoDelete( true ); | 331 | mCalendars.setAutoDelete( true ); |
331 | mCalendars.clear(); | 332 | mCalendars.clear(); |
332 | //qDebug("KOPrefs::~KOPrefs() "); | 333 | //qDebug("KOPrefs::~KOPrefs() "); |
333 | } | 334 | } |
334 | 335 | ||
335 | 336 | ||
336 | KOPrefs *KOPrefs::instance() | 337 | KOPrefs *KOPrefs::instance() |
337 | { | 338 | { |
338 | if (!mInstance) { | 339 | if (!mInstance) { |
339 | mInstance = insd.setObject(new KOPrefs()); | 340 | mInstance = insd.setObject(new KOPrefs()); |
340 | mInstance->readConfig(); | 341 | mInstance->readConfig(); |
341 | } | 342 | } |
342 | 343 | ||
343 | return mInstance; | 344 | return mInstance; |
344 | } | 345 | } |
345 | 346 | ||
346 | void KOPrefs::usrSetDefaults() | 347 | void KOPrefs::usrSetDefaults() |
347 | { | 348 | { |
348 | 349 | ||
349 | } | 350 | } |
350 | 351 | ||
351 | void KOPrefs::fillMailDefaults() | 352 | void KOPrefs::fillMailDefaults() |
352 | { | 353 | { |
353 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 354 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
354 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 355 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
355 | } | 356 | } |
356 | 357 | ||
357 | void KOPrefs::setTimeZoneIdDefault() | 358 | void KOPrefs::setTimeZoneIdDefault() |
358 | { | 359 | { |
359 | ; | 360 | ; |
360 | } | 361 | } |
361 | 362 | ||
362 | void KOPrefs::setAllDefaults() | 363 | void KOPrefs::setAllDefaults() |
363 | { | 364 | { |
364 | setCategoryDefaults(); | 365 | setCategoryDefaults(); |
365 | mEventSummaryUser = getDefaultList() ; | 366 | mEventSummaryUser = getDefaultList() ; |
366 | mTodoSummaryUser = getDefaultList() ; | 367 | mTodoSummaryUser = getDefaultList() ; |
367 | mJournalSummaryUser = getDefaultList() ; | 368 | mJournalSummaryUser = getDefaultList() ; |
368 | mLocationDefaults = getLocationDefaultList(); | 369 | mLocationDefaults = getLocationDefaultList(); |
369 | } | 370 | } |
370 | 371 | ||
371 | void KOPrefs::setCategoryDefaults() | 372 | void KOPrefs::setCategoryDefaults() |
372 | { | 373 | { |
373 | mCustomCategories.clear(); | 374 | mCustomCategories.clear(); |
374 | mCustomCategories = getDefaultList(); | 375 | mCustomCategories = getDefaultList(); |
375 | 376 | ||
376 | QStringList::Iterator it; | 377 | QStringList::Iterator it; |
377 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 378 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
378 | setCategoryColor(*it,mDefaultCategoryColor); | 379 | setCategoryColor(*it,mDefaultCategoryColor); |
379 | } | 380 | } |
380 | } | 381 | } |
381 | QStringList KOPrefs::getLocationDefaultList() | 382 | QStringList KOPrefs::getLocationDefaultList() |
382 | { | 383 | { |
383 | QStringList retval ; | 384 | QStringList retval ; |
384 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 385 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
385 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 386 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
386 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 387 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
387 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 388 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
388 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 389 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
389 | 390 | ||
390 | retval.sort(); | 391 | retval.sort(); |
391 | return retval; | 392 | return retval; |
392 | } | 393 | } |
393 | QStringList KOPrefs::getDefaultList() | 394 | QStringList KOPrefs::getDefaultList() |
394 | { | 395 | { |
395 | QStringList retval ; | 396 | QStringList retval ; |
396 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") | 397 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") |
397 | << i18n("Break") | 398 | << i18n("Break") |
398 | << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") | 399 | << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") |
399 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") | 400 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") |
400 | << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") | 401 | << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") |
401 | << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") | 402 | << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") |
402 | << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") | 403 | << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") |
403 | << i18n("Vacation") ; | 404 | << i18n("Vacation") ; |
404 | retval.sort(); | 405 | retval.sort(); |
405 | //qDebug("cat %s ", retval.join("-").latin1()); | 406 | //qDebug("cat %s ", retval.join("-").latin1()); |
406 | return retval; | 407 | return retval; |
407 | } | 408 | } |
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") | 409 | // << 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") |
409 | void KOPrefs::usrReadConfig() | 410 | void KOPrefs::usrReadConfig() |
410 | { | 411 | { |
411 | config()->setGroup("General"); | 412 | config()->setGroup("General"); |
412 | 413 | ||
413 | //qDebug("KOPrefs::usrReadConfig() "); | 414 | //qDebug("KOPrefs::usrReadConfig() "); |
414 | mCustomCategories = config()->readListEntry("Custom Categories"); | 415 | mCustomCategories = config()->readListEntry("Custom Categories"); |
415 | mOldLoadedLanguage = mOldLanguage ; | 416 | mOldLoadedLanguage = mOldLanguage ; |
416 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 417 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
417 | if (mLocationDefaults.isEmpty()) { | 418 | if (mLocationDefaults.isEmpty()) { |
418 | mLocationDefaults = getLocationDefaultList(); | 419 | mLocationDefaults = getLocationDefaultList(); |