summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index ddd9cf8..32cc291 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,471 +1,475 @@
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 <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "koprefs.h" 46#include "koprefs.h"
47#include "mainwindow.h" 47#include "mainwindow.h"
48 48
49KOPrefs *KOPrefs::mInstance = 0; 49KOPrefs *KOPrefs::mInstance = 0;
50static KStaticDeleter<KOPrefs> insd; 50static KStaticDeleter<KOPrefs> insd;
51 51
52KOPrefs::KOPrefs() : 52KOPrefs::KOPrefs() :
53 KPimPrefs("korganizerrc") 53 KPimPrefs("korganizerrc")
54{ 54{
55 mCategoryColors.setAutoDelete(true); 55 mCategoryColors.setAutoDelete(true);
56 fillMailDefaults(); 56 fillMailDefaults();
57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
58 QColor defaultHolidayColor = QColor(255,0,0); 58 QColor defaultHolidayColor = QColor(255,0,0);
59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
62 QColor defaultTodoDueTodayColor = QColor(255,220,100); 62 QColor defaultTodoDueTodayColor = QColor(255,220,100);
63 QColor defaultTodoOverdueColor = QColor(255,153,125); 63 QColor defaultTodoOverdueColor = QColor(255,153,125);
64 64
65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
66 mDefaultViewFont = QFont("helvetica",10); 66 mDefaultViewFont = QFont("helvetica",10);
67 mDefaultMonthViewFont = QFont("helvetica",8); 67 mDefaultMonthViewFont = QFont("helvetica",8);
68 mMarcusBainsFont= QFont("helvetica",10); 68 mMarcusBainsFont= QFont("helvetica",10);
69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
70 mEditBoxFont = QFont("helvetica",12); 70 mEditBoxFont = QFont("helvetica",12);
71 mJornalViewFont = QFont("helvetica",12); 71 mJornalViewFont = QFont("helvetica",12);
72 72
73 KPrefs::setCurrentGroup("General"); 73 KPrefs::setCurrentGroup("General");
74 74
75 75
76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
77 77
78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
80 addItemBool("ShowIconSearch",&mShowIconSearch,true); 80 addItemBool("ShowIconSearch",&mShowIconSearch,true);
81 addItemBool("ShowIconList",&mShowIconList,true); 81 addItemBool("ShowIconList",&mShowIconList,true);
82 addItemBool("ShowIconDay1",&mShowIconDay1,true); 82 addItemBool("ShowIconDay1",&mShowIconDay1,true);
83 addItemBool("ShowIconDay5",&mShowIconDay5,true); 83 addItemBool("ShowIconDay5",&mShowIconDay5,true);
84 addItemBool("ShowIconDay7",&mShowIconDay7,true); 84 addItemBool("ShowIconDay7",&mShowIconDay7,true);
85 addItemBool("ShowIconMonth",&mShowIconMonth,true); 85 addItemBool("ShowIconMonth",&mShowIconMonth,true);
86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
88 addItemBool("ShowIconBack",&mShowIconBack,true); 88 addItemBool("ShowIconBack",&mShowIconBack,true);
89 addItemBool("ShowIconToday",&mShowIconToday,true); 89 addItemBool("ShowIconToday",&mShowIconToday,true);
90 addItemBool("ShowIconForward",&mShowIconForward,true); 90 addItemBool("ShowIconForward",&mShowIconForward,true);
91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
94 addItemBool("ShowIconNext",&mShowIconNext,true); 94 addItemBool("ShowIconNext",&mShowIconNext,true);
95 addItemBool("ShowIconJournal",&mShowIconJournal,true); 95 addItemBool("ShowIconJournal",&mShowIconJournal,true);
96 addItemBool("ShowIconStretch",&mShowIconStretch,true); 96 addItemBool("ShowIconStretch",&mShowIconStretch,true);
97 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 97 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
98 98
99 addItemBool("AskForQuit",&mAskForQuit,false); 99 addItemBool("AskForQuit",&mAskForQuit,false);
100 100
101#ifndef DESKTOP_VERSION 101#ifndef DESKTOP_VERSION
102 addItemBool("ShowFullMenu",&mShowFullMenu,false); 102 addItemBool("ShowFullMenu",&mShowFullMenu,false);
103#else 103#else
104 addItemBool("ShowFullMenu",&mShowFullMenu,true); 104 addItemBool("ShowFullMenu",&mShowFullMenu,true);
105#endif 105#endif
106 addItemBool("ToolBarHor",&mToolBarHor, true ); 106 addItemBool("ToolBarHor",&mToolBarHor, true );
107 addItemBool("ToolBarUp",&mToolBarUp, false ); 107 addItemBool("ToolBarUp",&mToolBarUp, false );
108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
109 addItemInt("Whats Next Days",&mWhatsNextDays,3); 109 addItemInt("Whats Next Days",&mWhatsNextDays,3);
110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
111 111
112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
116 addItemInt("AllDay Size",&mAllDaySize,28); 116 addItemInt("AllDay Size",&mAllDaySize,28);
117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
119 119
120 addItemStringList("LocationDefaults",&mLocationDefaults ); 120 addItemStringList("LocationDefaults",&mLocationDefaults );
121 addItemStringList("EventSummary User",&mEventSummaryUser); 121 addItemStringList("EventSummary User",&mEventSummaryUser);
122 addItemStringList("TodoSummary User",&mTodoSummaryUser); 122 addItemStringList("TodoSummary User",&mTodoSummaryUser);
123 123
124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
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("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
212 addItemBool("UseAppColors",&mUseAppColors,false); 212 addItemBool("UseAppColors",&mUseAppColors,false);
213 213
214 214
215 215
216 KPrefs::setCurrentGroup("Views"); 216 KPrefs::setCurrentGroup("Views");
217 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 217 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
218 addItemInt("Hour Size",&mHourSize,8); 218 addItemInt("Hour Size",&mHourSize,8);
219 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 219 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
220 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 220 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
221 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 221 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
222 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 222 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
223 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 223 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
224 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 224 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
225#ifdef DESKTOP_VERION
226 addItemBool("Enable ToolTips",&mEnableToolTips,true);
227#else
225 addItemBool("Enable ToolTips",&mEnableToolTips,false); 228 addItemBool("Enable ToolTips",&mEnableToolTips,false);
229#endif
226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 230 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 231 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 232 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 233 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 234 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 235 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 236 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 237 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 238 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 239 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 240 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 241 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 242 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 243 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 244 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 245 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 246 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 247 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 248 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
245#ifdef DESKTOP_VERSION 249#ifdef DESKTOP_VERSION
246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 250 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
247#else 251#else
248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 252 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
249#endif 253#endif
250 addItemInt("Day Begins",&mDayBegins,7); 254 addItemInt("Day Begins",&mDayBegins,7);
251 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 255 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
252 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 256 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
253 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 257 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 258 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
255 259
256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 260 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
257 addItemBool("Full View Month",&mFullViewMonth,true); 261 addItemBool("Full View Month",&mFullViewMonth,true);
258 addItemBool("Full View Todo",&mFullViewTodo,true); 262 addItemBool("Full View Todo",&mFullViewTodo,true);
259 addItemBool("Quick Todo",&mEnableQuickTodo,false); 263 addItemBool("Quick Todo",&mEnableQuickTodo,false);
260 264
261 addItemInt("Next X Days",&mNextXDays,3); 265 addItemInt("Next X Days",&mNextXDays,3);
262 266
263 KPrefs::setCurrentGroup("Printer"); 267 KPrefs::setCurrentGroup("Printer");
264 268
265 KPrefs::setCurrentGroup("Layout"); 269 KPrefs::setCurrentGroup("Layout");
266 270
267 addItemBool("CompactDialogs",&mCompactDialogs,false); 271 addItemBool("CompactDialogs",&mCompactDialogs,false);
268 addItemBool("VerticalScreen",&mVerticalScreen,true); 272 addItemBool("VerticalScreen",&mVerticalScreen,true);
269 273
270 KPrefs::setCurrentGroup("KOrganizer Plugins"); 274 KPrefs::setCurrentGroup("KOrganizer Plugins");
271 275
272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 276 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
273 277
274 KPrefs::setCurrentGroup("Group Scheduling"); 278 KPrefs::setCurrentGroup("Group Scheduling");
275 279
276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 280 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 281 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
278 addItemStringList("AdditionalMails",&mAdditionalMails,""); 282 addItemStringList("AdditionalMails",&mAdditionalMails,"");
279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 283 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 284 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 285 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
282 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 286 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
283 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 287 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
284 288
285 KPrefs::setCurrentGroup( "Editors" ); 289 KPrefs::setCurrentGroup( "Editors" );
286 290
287 addItemStringList( "EventTemplates", &mEventTemplates ); 291 addItemStringList( "EventTemplates", &mEventTemplates );
288 addItemStringList( "TodoTemplates", &mTodoTemplates ); 292 addItemStringList( "TodoTemplates", &mTodoTemplates );
289 293
290 addItemInt("DestinationPolicy",&mDestination,standardDestination); 294 addItemInt("DestinationPolicy",&mDestination,standardDestination);
291 295
292 296
293 297
294} 298}
295 299
296 300
297KOPrefs::~KOPrefs() 301KOPrefs::~KOPrefs()
298{ 302{
299 if (mInstance == this) 303 if (mInstance == this)
300 mInstance = insd.setObject(0); 304 mInstance = insd.setObject(0);
301 305
302 //qDebug("KOPrefs::~KOPrefs() "); 306 //qDebug("KOPrefs::~KOPrefs() ");
303} 307}
304 308
305 309
306KOPrefs *KOPrefs::instance() 310KOPrefs *KOPrefs::instance()
307{ 311{
308 if (!mInstance) { 312 if (!mInstance) {
309 mInstance = insd.setObject(new KOPrefs()); 313 mInstance = insd.setObject(new KOPrefs());
310 mInstance->readConfig(); 314 mInstance->readConfig();
311 } 315 }
312 316
313 return mInstance; 317 return mInstance;
314} 318}
315 319
316void KOPrefs::usrSetDefaults() 320void KOPrefs::usrSetDefaults()
317{ 321{
318 322
319} 323}
320 324
321void KOPrefs::fillMailDefaults() 325void KOPrefs::fillMailDefaults()
322{ 326{
323 if (mName.isEmpty()) mName = i18n("Anonymous"); 327 if (mName.isEmpty()) mName = i18n("Anonymous");
324 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 328 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
325} 329}
326 330
327void KOPrefs::setTimeZoneIdDefault() 331void KOPrefs::setTimeZoneIdDefault()
328{ 332{
329 ; 333 ;
330} 334}
331 335
332void KOPrefs::setCategoryDefaults() 336void KOPrefs::setCategoryDefaults()
333{ 337{
334 mCustomCategories.clear(); 338 mCustomCategories.clear();
335 mCustomCategories = getDefaultList(); 339 mCustomCategories = getDefaultList();
336 340
337 QStringList::Iterator it; 341 QStringList::Iterator it;
338 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 342 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
339 setCategoryColor(*it,mDefaultCategoryColor); 343 setCategoryColor(*it,mDefaultCategoryColor);
340 } 344 }
341} 345}
342 346
343QStringList KOPrefs::getDefaultList() 347QStringList KOPrefs::getDefaultList()
344{ 348{
345 QStringList retval ; 349 QStringList retval ;
346 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 350 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
347 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 351 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
348 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 352 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
349 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 353 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
350 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 354 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
351 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 355 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
352 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 356 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
353 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 357 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
354 retval.sort(); 358 retval.sort();
355 return retval; 359 return retval;
356} 360}
357 361
358void KOPrefs::usrReadConfig() 362void KOPrefs::usrReadConfig()
359{ 363{
360 config()->setGroup("General"); 364 config()->setGroup("General");
361 365
362 mCustomCategories = config()->readListEntry("Custom Categories"); 366 mCustomCategories = config()->readListEntry("Custom Categories");
363 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { 367 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) {
364 mLocationDefaults.clear(); 368 mLocationDefaults.clear();
365 mEventSummaryUser.clear(); 369 mEventSummaryUser.clear();
366 mTodoSummaryUser.clear(); 370 mTodoSummaryUser.clear();
367 } 371 }
368 mOldLoadedLanguage = mOldLanguage ; 372 mOldLoadedLanguage = mOldLanguage ;
369 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 373 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
370 if (mLocationDefaults.isEmpty()) { 374 if (mLocationDefaults.isEmpty()) {
371 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 375 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
372 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 376 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
373 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 377 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
374 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 378 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
375 mLocationDefaults.sort(); 379 mLocationDefaults.sort();
376 } 380 }
377 381
378 if (mEventSummaryUser.isEmpty()) { 382 if (mEventSummaryUser.isEmpty()) {
379 mEventSummaryUser = getDefaultList() ; 383 mEventSummaryUser = getDefaultList() ;
380 } 384 }
381 if (mTodoSummaryUser.isEmpty()) { 385 if (mTodoSummaryUser.isEmpty()) {
382 mTodoSummaryUser = getDefaultList() ; 386 mTodoSummaryUser = getDefaultList() ;
383 } 387 }
384 388
385 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 389 if (mCustomCategories.isEmpty()) setCategoryDefaults();
386 390
387 config()->setGroup("Personal Settings"); 391 config()->setGroup("Personal Settings");
388 mName = config()->readEntry("user_name",""); 392 mName = config()->readEntry("user_name","");
389 mEmail = config()->readEntry("user_email",""); 393 mEmail = config()->readEntry("user_email","");
390 fillMailDefaults(); 394 fillMailDefaults();
391 395
392 config()->setGroup("Category Colors"); 396 config()->setGroup("Category Colors");
393 QStringList::Iterator it; 397 QStringList::Iterator it;
394 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 398 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
395 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 399 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
396 400
397 } 401 }
398 402
399 KPimPrefs::usrReadConfig(); 403 KPimPrefs::usrReadConfig();
400} 404}
401 405
402 406
403void KOPrefs::usrWriteConfig() 407void KOPrefs::usrWriteConfig()
404{ 408{
405 config()->setGroup("General"); 409 config()->setGroup("General");
406 config()->writeEntry("Custom Categories",mCustomCategories); 410 config()->writeEntry("Custom Categories",mCustomCategories);
407 411
408 config()->setGroup("Personal Settings"); 412 config()->setGroup("Personal Settings");
409 config()->writeEntry("user_name",mName); 413 config()->writeEntry("user_name",mName);
410 config()->writeEntry("user_email",mEmail); 414 config()->writeEntry("user_email",mEmail);
411 415
412 config()->setGroup("Category Colors"); 416 config()->setGroup("Category Colors");
413 QDictIterator<QColor> it(mCategoryColors); 417 QDictIterator<QColor> it(mCategoryColors);
414 while (it.current()) { 418 while (it.current()) {
415 config()->writeEntry(it.currentKey(),*(it.current())); 419 config()->writeEntry(it.currentKey(),*(it.current()));
416 ++it; 420 ++it;
417 } 421 }
418 422
419 423
420 KPimPrefs::usrWriteConfig(); 424 KPimPrefs::usrWriteConfig();
421} 425}
422 426
423void KOPrefs::setCategoryColor(QString cat,const QColor & color) 427void KOPrefs::setCategoryColor(QString cat,const QColor & color)
424{ 428{
425 mCategoryColors.replace(cat,new QColor(color)); 429 mCategoryColors.replace(cat,new QColor(color));
426} 430}
427 431
428QColor *KOPrefs::categoryColor(QString cat) 432QColor *KOPrefs::categoryColor(QString cat)
429{ 433{
430 QColor *color = 0; 434 QColor *color = 0;
431 435
432 if (!cat.isEmpty()) color = mCategoryColors[cat]; 436 if (!cat.isEmpty()) color = mCategoryColors[cat];
433 437
434 if (color) return color; 438 if (color) return color;
435 else return &mDefaultCategoryColor; 439 else return &mDefaultCategoryColor;
436} 440}
437 441
438void KOPrefs::setFullName(const QString &name) 442void KOPrefs::setFullName(const QString &name)
439{ 443{
440 mName = name; 444 mName = name;
441} 445}
442 446
443void KOPrefs::setEmail(const QString &email) 447void KOPrefs::setEmail(const QString &email)
444{ 448{
445 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 449 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
446 mEmail = email; 450 mEmail = email;
447} 451}
448 452
449QString KOPrefs::fullName() 453QString KOPrefs::fullName()
450{ 454{
451 if (mEmailControlCenter) { 455 if (mEmailControlCenter) {
452 KEMailSettings settings; 456 KEMailSettings settings;
453 return settings.getSetting(KEMailSettings::RealName); 457 return settings.getSetting(KEMailSettings::RealName);
454 } else { 458 } else {
455 return mName; 459 return mName;
456 } 460 }
457} 461}
458 462
459QString KOPrefs::email() 463QString KOPrefs::email()
460{ 464{
461 if (mEmailControlCenter) { 465 if (mEmailControlCenter) {
462 KEMailSettings settings; 466 KEMailSettings settings;
463 return settings.getSetting(KEMailSettings::EmailAddress); 467 return settings.getSetting(KEMailSettings::EmailAddress);
464 } else { 468 } else {
465 return mEmail; 469 return mEmail;
466 } 470 }
467} 471}
468KConfig* KOPrefs::getConfig() 472KConfig* KOPrefs::getConfig()
469{ 473{
470 return config(); 474 return config();
471} 475}