-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 | |||
@@ -8,96 +8,97 @@ | |||
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); |
@@ -274,97 +275,97 @@ KOPrefs::KOPrefs() : | |||
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 | ||