summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 4b26058..dbbe832 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,471 +1,471 @@
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 addItemBool("Enable ToolTips",&mEnableToolTips,false); 225 addItemBool("Enable ToolTips",&mEnableToolTips,false);
226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,true);
232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
245#ifdef DESKTOP_VERSION 245#ifdef DESKTOP_VERSION
246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
247#else 247#else
248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
249#endif 249#endif
250 addItemInt("Day Begins",&mDayBegins,7); 250 addItemInt("Day Begins",&mDayBegins,7);
251 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 251 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
252 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 252 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
253 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 253 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
255 255
256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
257 addItemBool("Full View Month",&mFullViewMonth,true); 257 addItemBool("Full View Month",&mFullViewMonth,true);
258 addItemBool("Full View Todo",&mFullViewTodo,true); 258 addItemBool("Full View Todo",&mFullViewTodo,true);
259 addItemBool("Quick Todo",&mEnableQuickTodo,false); 259 addItemBool("Quick Todo",&mEnableQuickTodo,false);
260 260
261 addItemInt("Next X Days",&mNextXDays,3); 261 addItemInt("Next X Days",&mNextXDays,3);
262 262
263 KPrefs::setCurrentGroup("Printer"); 263 KPrefs::setCurrentGroup("Printer");
264 264
265 KPrefs::setCurrentGroup("Layout"); 265 KPrefs::setCurrentGroup("Layout");
266 266
267 addItemBool("CompactDialogs",&mCompactDialogs,false); 267 addItemBool("CompactDialogs",&mCompactDialogs,false);
268 addItemBool("VerticalScreen",&mVerticalScreen,true); 268 addItemBool("VerticalScreen",&mVerticalScreen,true);
269 269
270 KPrefs::setCurrentGroup("KOrganizer Plugins"); 270 KPrefs::setCurrentGroup("KOrganizer Plugins");
271 271
272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
273 273
274 KPrefs::setCurrentGroup("Group Scheduling"); 274 KPrefs::setCurrentGroup("Group Scheduling");
275 275
276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
278 addItemStringList("AdditionalMails",&mAdditionalMails,""); 278 addItemStringList("AdditionalMails",&mAdditionalMails,"");
279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
282 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 282 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
283 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 283 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
284 284
285 KPrefs::setCurrentGroup( "Editors" ); 285 KPrefs::setCurrentGroup( "Editors" );
286 286
287 addItemStringList( "EventTemplates", &mEventTemplates ); 287 addItemStringList( "EventTemplates", &mEventTemplates );
288 addItemStringList( "TodoTemplates", &mTodoTemplates ); 288 addItemStringList( "TodoTemplates", &mTodoTemplates );
289 289
290 addItemInt("DestinationPolicy",&mDestination,standardDestination); 290 addItemInt("DestinationPolicy",&mDestination,standardDestination);
291 291
292 292
293 293
294} 294}
295 295
296 296
297KOPrefs::~KOPrefs() 297KOPrefs::~KOPrefs()
298{ 298{
299 if (mInstance == this) 299 if (mInstance == this)
300 mInstance = insd.setObject(0); 300 mInstance = insd.setObject(0);
301 301
302 //qDebug("KOPrefs::~KOPrefs() "); 302 //qDebug("KOPrefs::~KOPrefs() ");
303} 303}
304 304
305 305
306KOPrefs *KOPrefs::instance() 306KOPrefs *KOPrefs::instance()
307{ 307{
308 if (!mInstance) { 308 if (!mInstance) {
309 mInstance = insd.setObject(new KOPrefs()); 309 mInstance = insd.setObject(new KOPrefs());
310 mInstance->readConfig(); 310 mInstance->readConfig();
311 } 311 }
312 312
313 return mInstance; 313 return mInstance;
314} 314}
315 315
316void KOPrefs::usrSetDefaults() 316void KOPrefs::usrSetDefaults()
317{ 317{
318 318
319} 319}
320 320
321void KOPrefs::fillMailDefaults() 321void KOPrefs::fillMailDefaults()
322{ 322{
323 if (mName.isEmpty()) mName = i18n("Anonymous"); 323 if (mName.isEmpty()) mName = i18n("Anonymous");
324 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 324 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
325} 325}
326 326
327void KOPrefs::setTimeZoneIdDefault() 327void KOPrefs::setTimeZoneIdDefault()
328{ 328{
329 ; 329 ;
330} 330}
331 331
332void KOPrefs::setCategoryDefaults() 332void KOPrefs::setCategoryDefaults()
333{ 333{
334 mCustomCategories.clear(); 334 mCustomCategories.clear();
335 mCustomCategories = getDefaultList(); 335 mCustomCategories = getDefaultList();
336 336
337 QStringList::Iterator it; 337 QStringList::Iterator it;
338 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 338 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
339 setCategoryColor(*it,mDefaultCategoryColor); 339 setCategoryColor(*it,mDefaultCategoryColor);
340 } 340 }
341} 341}
342 342
343QStringList KOPrefs::getDefaultList() 343QStringList KOPrefs::getDefaultList()
344{ 344{
345 QStringList retval ; 345 QStringList retval ;
346 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 346 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") 347 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
348 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 348 << 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") 349 << 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") 350 << 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") 351 << 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") 352 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
353 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 353 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
354 retval.sort(); 354 retval.sort();
355 return retval; 355 return retval;
356} 356}
357 357
358void KOPrefs::usrReadConfig() 358void KOPrefs::usrReadConfig()
359{ 359{
360 config()->setGroup("General"); 360 config()->setGroup("General");
361 361
362 mCustomCategories = config()->readListEntry("Custom Categories"); 362 mCustomCategories = config()->readListEntry("Custom Categories");
363 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { 363 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) {
364 mLocationDefaults.clear(); 364 mLocationDefaults.clear();
365 mEventSummaryUser.clear(); 365 mEventSummaryUser.clear();
366 mTodoSummaryUser.clear(); 366 mTodoSummaryUser.clear();
367 } 367 }
368 mOldLoadedLanguage = mOldLanguage ; 368 mOldLoadedLanguage = mOldLanguage ;
369 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 369 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
370 if (mLocationDefaults.isEmpty()) { 370 if (mLocationDefaults.isEmpty()) {
371 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 371 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") 372 << 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") ; 373 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
374 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 374 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
375 mLocationDefaults.sort(); 375 mLocationDefaults.sort();
376 } 376 }
377 377
378 if (mEventSummaryUser.isEmpty()) { 378 if (mEventSummaryUser.isEmpty()) {
379 mEventSummaryUser = getDefaultList() ; 379 mEventSummaryUser = getDefaultList() ;
380 } 380 }
381 if (mTodoSummaryUser.isEmpty()) { 381 if (mTodoSummaryUser.isEmpty()) {
382 mTodoSummaryUser = getDefaultList() ; 382 mTodoSummaryUser = getDefaultList() ;
383 } 383 }
384 384
385 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 385 if (mCustomCategories.isEmpty()) setCategoryDefaults();
386 386
387 config()->setGroup("Personal Settings"); 387 config()->setGroup("Personal Settings");
388 mName = config()->readEntry("user_name",""); 388 mName = config()->readEntry("user_name","");
389 mEmail = config()->readEntry("user_email",""); 389 mEmail = config()->readEntry("user_email","");
390 fillMailDefaults(); 390 fillMailDefaults();
391 391
392 config()->setGroup("Category Colors"); 392 config()->setGroup("Category Colors");
393 QStringList::Iterator it; 393 QStringList::Iterator it;
394 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 394 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
395 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 395 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
396 396
397 } 397 }
398 398
399 KPimPrefs::usrReadConfig(); 399 KPimPrefs::usrReadConfig();
400} 400}
401 401
402 402
403void KOPrefs::usrWriteConfig() 403void KOPrefs::usrWriteConfig()
404{ 404{
405 config()->setGroup("General"); 405 config()->setGroup("General");
406 config()->writeEntry("Custom Categories",mCustomCategories); 406 config()->writeEntry("Custom Categories",mCustomCategories);
407 407
408 config()->setGroup("Personal Settings"); 408 config()->setGroup("Personal Settings");
409 config()->writeEntry("user_name",mName); 409 config()->writeEntry("user_name",mName);
410 config()->writeEntry("user_email",mEmail); 410 config()->writeEntry("user_email",mEmail);
411 411
412 config()->setGroup("Category Colors"); 412 config()->setGroup("Category Colors");
413 QDictIterator<QColor> it(mCategoryColors); 413 QDictIterator<QColor> it(mCategoryColors);
414 while (it.current()) { 414 while (it.current()) {
415 config()->writeEntry(it.currentKey(),*(it.current())); 415 config()->writeEntry(it.currentKey(),*(it.current()));
416 ++it; 416 ++it;
417 } 417 }
418 418
419 419
420 KPimPrefs::usrWriteConfig(); 420 KPimPrefs::usrWriteConfig();
421} 421}
422 422
423void KOPrefs::setCategoryColor(QString cat,const QColor & color) 423void KOPrefs::setCategoryColor(QString cat,const QColor & color)
424{ 424{
425 mCategoryColors.replace(cat,new QColor(color)); 425 mCategoryColors.replace(cat,new QColor(color));
426} 426}
427 427
428QColor *KOPrefs::categoryColor(QString cat) 428QColor *KOPrefs::categoryColor(QString cat)
429{ 429{
430 QColor *color = 0; 430 QColor *color = 0;
431 431
432 if (!cat.isEmpty()) color = mCategoryColors[cat]; 432 if (!cat.isEmpty()) color = mCategoryColors[cat];
433 433
434 if (color) return color; 434 if (color) return color;
435 else return &mDefaultCategoryColor; 435 else return &mDefaultCategoryColor;
436} 436}
437 437
438void KOPrefs::setFullName(const QString &name) 438void KOPrefs::setFullName(const QString &name)
439{ 439{
440 mName = name; 440 mName = name;
441} 441}
442 442
443void KOPrefs::setEmail(const QString &email) 443void KOPrefs::setEmail(const QString &email)
444{ 444{
445 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 445 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
446 mEmail = email; 446 mEmail = email;
447} 447}
448 448
449QString KOPrefs::fullName() 449QString KOPrefs::fullName()
450{ 450{
451 if (mEmailControlCenter) { 451 if (mEmailControlCenter) {
452 KEMailSettings settings; 452 KEMailSettings settings;
453 return settings.getSetting(KEMailSettings::RealName); 453 return settings.getSetting(KEMailSettings::RealName);
454 } else { 454 } else {
455 return mName; 455 return mName;
456 } 456 }
457} 457}
458 458
459QString KOPrefs::email() 459QString KOPrefs::email()
460{ 460{
461 if (mEmailControlCenter) { 461 if (mEmailControlCenter) {
462 KEMailSettings settings; 462 KEMailSettings settings;
463 return settings.getSetting(KEMailSettings::EmailAddress); 463 return settings.getSetting(KEMailSettings::EmailAddress);
464 } else { 464 } else {
465 return mEmail; 465 return mEmail;
466 } 466 }
467} 467}
468KConfig* KOPrefs::getConfig() 468KConfig* KOPrefs::getConfig()
469{ 469{
470 return config(); 470 return config();
471} 471}