-rw-r--r-- | korganizer/koprefs.cpp | 1 |
1 files changed, 1 insertions, 0 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 | ||