summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp87
-rw-r--r--korganizer/koprefs.h32
2 files changed, 113 insertions, 6 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 8f951ee..179f586 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,511 +1,588 @@
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
50KOPrefs *KOPrefs::mInstance = 0; 50KOPrefs *KOPrefs::mInstance = 0;
51static KStaticDeleter<KOPrefs> insd; 51static KStaticDeleter<KOPrefs> insd;
52 52
53KOPrefs::KOPrefs() : 53KOPrefs::KOPrefs() :
54 KPimPrefs("korganizerrc") 54 KPimPrefs("korganizerrc")
55{ 55{
56 mCategoryColors.setAutoDelete(true); 56 mCategoryColors.setAutoDelete(true);
57 fillMailDefaults(); 57 fillMailDefaults();
58 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 58 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
59 QColor defaultHolidayColor = QColor(255,0,0); 59 QColor defaultHolidayColor = QColor(255,0,0);
60 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 60 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
61 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 61 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
63 QColor defaultTodoDueTodayColor = QColor(255,220,100); 63 QColor defaultTodoDueTodayColor = QColor(255,220,100);
64 QColor defaultTodoOverdueColor = QColor(255,153,125); 64 QColor defaultTodoOverdueColor = QColor(255,153,125);
65 QColor defaultTodoRunColor = QColor(99,194,30); 65 QColor defaultTodoRunColor = QColor(99,194,30);
66 KPrefs::setCurrentGroup("General"); 66 KPrefs::setCurrentGroup("General");
67 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 67 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
68 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 68 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
69 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 69 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
70 addItemBool("ShowIconSearch",&mShowIconSearch,true); 70 addItemBool("ShowIconSearch",&mShowIconSearch,true);
71 addItemBool("ShowIconList",&mShowIconList,true); 71 addItemBool("ShowIconList",&mShowIconList,true);
72 addItemBool("ShowIconDay1",&mShowIconDay1,true); 72 addItemBool("ShowIconDay1",&mShowIconDay1,true);
73 addItemBool("ShowIconDay5",&mShowIconDay5,true); 73 addItemBool("ShowIconDay5",&mShowIconDay5,true);
74 addItemBool("ShowIconDay6",&mShowIconDay6,true); 74 addItemBool("ShowIconDay6",&mShowIconDay6,true);
75 addItemBool("ShowIconDay7",&mShowIconDay7,true); 75 addItemBool("ShowIconDay7",&mShowIconDay7,true);
76 addItemBool("ShowIconMonth",&mShowIconMonth,true); 76 addItemBool("ShowIconMonth",&mShowIconMonth,true);
77 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 77 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
78 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 78 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
79 addItemBool("ShowIconBack",&mShowIconBack,true); 79 addItemBool("ShowIconBack",&mShowIconBack,true);
80 addItemBool("ShowIconToday",&mShowIconToday,true); 80 addItemBool("ShowIconToday",&mShowIconToday,true);
81 addItemBool("ShowIconForward",&mShowIconForward,true); 81 addItemBool("ShowIconForward",&mShowIconForward,true);
82 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 82 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
83 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 83 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
84 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); 84 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true);
85 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 85 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
86 addItemBool("ShowIconNext",&mShowIconNext,true); 86 addItemBool("ShowIconNext",&mShowIconNext,true);
87 addItemBool("ShowIconJournal",&mShowIconJournal,true); 87 addItemBool("ShowIconJournal",&mShowIconJournal,true);
88 addItemBool("ShowIconStretch",&mShowIconStretch,true); 88 addItemBool("ShowIconStretch",&mShowIconStretch,true);
89 addItemBool("ShowIconFilter",&mShowIconFilter,false); 89 addItemBool("ShowIconFilter",&mShowIconFilter,false);
90 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); 90 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true);
91 91
92 bool addIcons = false; 92 bool addIcons = false;
93#ifdef DESKTOP_VERSION 93#ifdef DESKTOP_VERSION
94 addIcons = true; 94 addIcons = true;
95#endif 95#endif
96 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); 96 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons);
97 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); 97 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons);
98 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); 98 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons);
99 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); 99 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons);
100 100
101 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 101 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
102 102
103 addItemBool("AskForQuit",&mAskForQuit,false); 103 addItemBool("AskForQuit",&mAskForQuit,false);
104 104
105#ifndef DESKTOP_VERSION 105#ifndef DESKTOP_VERSION
106 addItemBool("ShowFullMenu",&mShowFullMenu,false); 106 addItemBool("ShowFullMenu",&mShowFullMenu,false);
107#else 107#else
108 addItemBool("ShowFullMenu",&mShowFullMenu,true); 108 addItemBool("ShowFullMenu",&mShowFullMenu,true);
109#endif 109#endif
110 addItemBool("ToolBarHor",&mToolBarHor, true ); 110 addItemBool("ToolBarHor",&mToolBarHor, true );
111 addItemBool("ToolBarUp",&mToolBarUp, false ); 111 addItemBool("ToolBarUp",&mToolBarUp, false );
112 addItemBool("ToolBarHorV",&mToolBarHorV, true ); 112 addItemBool("ToolBarHorV",&mToolBarHorV, true );
113 addItemBool("ToolBarUpV",&mToolBarUpV, false ); 113 addItemBool("ToolBarUpV",&mToolBarUpV, false );
114 addItemBool("ToolBarHorN",&mToolBarHorN, true ); 114 addItemBool("ToolBarHorN",&mToolBarHorN, true );
115 addItemBool("ToolBarUpN",&mToolBarUpN, false ); 115 addItemBool("ToolBarUpN",&mToolBarUpN, false );
116 addItemBool("ToolBarHorF",&mToolBarHorF, true ); 116 addItemBool("ToolBarHorF",&mToolBarHorF, true );
117 addItemBool("ToolBarUpF",&mToolBarUpF, false ); 117 addItemBool("ToolBarUpF",&mToolBarUpF, false );
118 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 118 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
119 addItemInt("Whats Next Days",&mWhatsNextDays,3); 119 addItemInt("Whats Next Days",&mWhatsNextDays,3);
120 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 120 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
121 121
122 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 122 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
123 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); 123 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true);
124 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 124 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
125 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 125 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
126 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 126 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
127 addItemInt("AllDay Size",&mAllDaySize,28); 127 addItemInt("AllDay Size",&mAllDaySize,28);
128 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 128 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
129 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 129 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
130 130
131 addItemStringList("LocationDefaults",&mLocationDefaults ); 131 addItemStringList("LocationDefaults",&mLocationDefaults );
132 addItemStringList("EventSummary User",&mEventSummaryUser); 132 addItemStringList("EventSummary User",&mEventSummaryUser);
133 addItemStringList("TodoSummary User",&mTodoSummaryUser); 133 addItemStringList("TodoSummary User",&mTodoSummaryUser);
134 134
135 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 135 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
136 addItemBool("Enable Project View",&mEnableProjectView,false); 136 addItemBool("Enable Project View",&mEnableProjectView,false);
137 addItemBool("Auto Save",&mAutoSave,false); 137 addItemBool("Auto Save",&mAutoSave,false);
138 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 138 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
139 addItemBool("Confirm Deletes",&mConfirm,true); 139 addItemBool("Confirm Deletes",&mConfirm,true);
140 addItemString("Archive File",&mArchiveFile); 140 addItemString("Archive File",&mArchiveFile);
141 addItemString("Html Export File",&mHtmlExportFile, 141 addItemString("Html Export File",&mHtmlExportFile,
142 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 142 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
143 addItemBool("Html With Save",&mHtmlWithSave,false); 143 addItemBool("Html With Save",&mHtmlWithSave,false);
144 144
145 KPrefs::setCurrentGroup("Personal Settings"); 145 KPrefs::setCurrentGroup("Personal Settings");
146 146
147 addItemInt("Mail Client",&mMailClient,MailClientKMail); 147 addItemInt("Mail Client",&mMailClient,MailClientKMail);
148 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 148 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
149 addItemBool("Bcc",&mBcc,false); 149 addItemBool("Bcc",&mBcc,false);
150 150
151 KPrefs::setCurrentGroup("Time & Date"); 151 KPrefs::setCurrentGroup("Time & Date");
152 152
153 153
154 addItemInt("Default Start Time",&mStartTime,10); 154 addItemInt("Default Start Time",&mStartTime,10);
155 addItemInt("Default Duration",&mDefaultDuration,2); 155 addItemInt("Default Duration",&mDefaultDuration,2);
156 addItemInt("Default Alarm Time",&mAlarmTime,3); 156 addItemInt("Default Alarm Time",&mAlarmTime,3);
157 KPrefs::setCurrentGroup("AlarmSettings"); 157 KPrefs::setCurrentGroup("AlarmSettings");
158 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 158 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
159 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 159 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
160 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 160 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
161 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 161 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
162 162
163 163
164 KPrefs::setCurrentGroup("Calendar"); 164 KPrefs::setCurrentGroup("Calendar");
165 165
166 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 166 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
167 167
168 KPrefs::setCurrentGroup("Fonts"); 168 KPrefs::setCurrentGroup("Fonts");
169 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 169 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
170 QFont fon = KGlobalSettings::generalFont(); 170 QFont fon = KGlobalSettings::generalFont();
171 addItemFont("TimeBar Font",&mTimeBarFont,fon ); 171 addItemFont("TimeBar Font",&mTimeBarFont,fon );
172 addItemFont("MonthView Font",&mMonthViewFont,fon); 172 addItemFont("MonthView Font",&mMonthViewFont,fon);
173 addItemFont("AgendaView Font",&mAgendaViewFont,fon); 173 addItemFont("AgendaView Font",&mAgendaViewFont,fon);
174 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); 174 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon);
175 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); 175 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon);
176 addItemFont("TodoView Font",&mTodoViewFont,fon); 176 addItemFont("TodoView Font",&mTodoViewFont,fon);
177 addItemFont("ListView Font",&mListViewFont,fon); 177 addItemFont("ListView Font",&mListViewFont,fon);
178 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); 178 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon);
179 addItemFont("EditBox Font",&mEditBoxFont,fon); 179 addItemFont("EditBox Font",&mEditBoxFont,fon);
180 addItemFont("JournalView Font",&mJornalViewFont,fon); 180 addItemFont("JournalView Font",&mJornalViewFont,fon);
181 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); 181 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon);
182 addItemFont("EventView Font",&mEventViewFont,fon); 182 addItemFont("EventView Font",&mEventViewFont,fon);
183 183
184 KPrefs::setCurrentGroup("RemoteSyncing"); 184 KPrefs::setCurrentGroup("RemoteSyncing");
185 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 185 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
186 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 186 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
187 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 187 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
188 addItemInt("LastSyncTime",&mLastSyncTime,0); 188 addItemInt("LastSyncTime",&mLastSyncTime,0);
189 189
190#ifdef _WIN32_ 190#ifdef _WIN32_
191 QString hdp= locateLocal("data","korganizer")+"\\\\"; 191 QString hdp= locateLocal("data","korganizer")+"\\\\";
192#else 192#else
193 QString hdp= locateLocal("data","korganizer")+"/"; 193 QString hdp= locateLocal("data","korganizer")+"/";
194#endif 194#endif
195 195
196 KPrefs::setCurrentGroup("LoadSaveFileNames"); 196 KPrefs::setCurrentGroup("LoadSaveFileNames");
197 197
198 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 198 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
199 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 199 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
200 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 200 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
201 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 201 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
202 202
203 203
204 KPrefs::setCurrentGroup("Locale"); 204 KPrefs::setCurrentGroup("Locale");
205 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 205 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
206 206
207 207
208 KPrefs::setCurrentGroup("Colors"); 208 KPrefs::setCurrentGroup("Colors");
209 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 209 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
210 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 210 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
211 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 211 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
212 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 212 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
213 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 213 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
214 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 214 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
215 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 215 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
216 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 216 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
217 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); 217 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
218 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 218 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
219 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 219 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
220 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 220 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
221 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 221 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
222 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 222 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
223 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 223 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
224 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 224 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
225 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 225 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
226 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 226 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
227 addItemBool("UseAppColors",&mUseAppColors,false); 227 addItemBool("UseAppColors",&mUseAppColors,false);
228 228
229 229
230 230
231 KPrefs::setCurrentGroup("Views"); 231 KPrefs::setCurrentGroup("Views");
232 addItemBool("Block Popup Menu",&mBlockPopupMenu,true); 232 addItemBool("Block Popup Menu",&mBlockPopupMenu,true);
233 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 233 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
234 addItemInt("Hour Size",&mHourSize,8); 234 addItemInt("Hour Size",&mHourSize,8);
235 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 235 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
236 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 236 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
237 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 237 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
238 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 238 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
239 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 239 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
240 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 240 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
241 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); 241 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
242#ifdef DESKTOP_VERION 242#ifdef DESKTOP_VERION
243 addItemBool("Enable ToolTips",&mEnableToolTips,true); 243 addItemBool("Enable ToolTips",&mEnableToolTips,true);
244#else 244#else
245 addItemBool("Enable ToolTips",&mEnableToolTips,false); 245 addItemBool("Enable ToolTips",&mEnableToolTips,false);
246#endif 246#endif
247 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 247 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
248 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 248 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
249 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 249 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
250 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 250 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
251 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 251 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
252 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 252 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
253 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 253 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
254 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 254 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
255 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 255 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
256 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 256 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
257 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 257 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
258 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 258 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
259 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 259 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
260 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 260 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
261 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 261 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
262 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 262 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
263 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 263 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
264 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 264 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
265 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 265 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
266 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 266 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
267#ifdef DESKTOP_VERSION 267#ifdef DESKTOP_VERSION
268 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 268 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
269#else 269#else
270 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 270 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
271#endif 271#endif
272 addItemInt("Day Begins",&mDayBegins,7); 272 addItemInt("Day Begins",&mDayBegins,7);
273 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 273 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
274 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 274 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
275 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 275 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
276 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 276 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
277 277
278 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 278 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
279 addItemBool("Full View Month",&mFullViewMonth,true); 279 addItemBool("Full View Month",&mFullViewMonth,true);
280 addItemBool("Full View Todo",&mFullViewTodo,true); 280 addItemBool("Full View Todo",&mFullViewTodo,true);
281 addItemBool("Quick Todo",&mEnableQuickTodo,false); 281 addItemBool("Quick Todo",&mEnableQuickTodo,false);
282 282
283 addItemInt("Next X Days",&mNextXDays,3); 283 addItemInt("Next X Days",&mNextXDays,3);
284 284
285 KPrefs::setCurrentGroup("Printer"); 285 KPrefs::setCurrentGroup("Printer");
286 286
287 KPrefs::setCurrentGroup("Layout"); 287 KPrefs::setCurrentGroup("Layout");
288 288
289 addItemBool("CompactDialogs",&mCompactDialogs,false); 289 addItemBool("CompactDialogs",&mCompactDialogs,false);
290 addItemBool("VerticalScreen",&mVerticalScreen,true); 290 addItemBool("VerticalScreen",&mVerticalScreen,true);
291 291
292 KPrefs::setCurrentGroup("KOrganizer Plugins"); 292 KPrefs::setCurrentGroup("KOrganizer Plugins");
293 293
294 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 294 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
295 295
296 KPrefs::setCurrentGroup("Group Scheduling"); 296 KPrefs::setCurrentGroup("Group Scheduling");
297 297
298 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 298 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
299 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 299 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
300 addItemStringList("AdditionalMails",&mAdditionalMails,""); 300 addItemStringList("AdditionalMails",&mAdditionalMails,"");
301 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 301 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
302 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 302 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
303 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 303 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
304 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 304 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
305 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 305 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
306 306
307 KPrefs::setCurrentGroup( "Editors" ); 307 KPrefs::setCurrentGroup( "Editors" );
308 308
309 addItemStringList( "EventTemplates", &mEventTemplates ); 309 addItemStringList( "EventTemplates", &mEventTemplates );
310 addItemStringList( "TodoTemplates", &mTodoTemplates ); 310 addItemStringList( "TodoTemplates", &mTodoTemplates );
311 311
312 addItemInt("DestinationPolicy",&mDestination,standardDestination); 312 addItemInt("DestinationPolicy",&mDestination,standardDestination);
313 313
314 KPrefs::setCurrentGroup( "ViewOptions" ); 314 KPrefs::setCurrentGroup( "ViewOptions" );
315 addItemBool("EVshowDetails",&mEVshowDetails,true); 315 addItemBool("EVshowDetails",&mEVshowDetails,true);
316 addItemBool("EVshowCreated",&mEVshowCreated,true); 316 addItemBool("EVshowCreated",&mEVshowCreated,true);
317 addItemBool("EVshowChanged",&mEVshowChanged,true); 317 addItemBool("EVshowChanged",&mEVshowChanged,true);
318 addItemBool("WTshowDetails",&mWTshowDetails,false); 318 addItemBool("WTshowDetails",&mWTshowDetails,false);
319 addItemBool("WTshowCreated",&mWTshowCreated,false); 319 addItemBool("WTshowCreated",&mWTshowCreated,false);
320 addItemBool("WTshowChanged",&mWTshowChanged,false); 320 addItemBool("WTshowChanged",&mWTshowChanged,false);
321 321 mCalendars.setAutoDelete( true );
322} 322}
323 323
324 324
325KOPrefs::~KOPrefs() 325KOPrefs::~KOPrefs()
326{ 326{
327 if (mInstance == this) 327 if (mInstance == this)
328 mInstance = insd.setObject(0); 328 mInstance = insd.setObject(0);
329 329 mCalendars.setAutoDelete( true );
330 mCalendars.clear();
330 //qDebug("KOPrefs::~KOPrefs() "); 331 //qDebug("KOPrefs::~KOPrefs() ");
331} 332}
332 333
333 334
334KOPrefs *KOPrefs::instance() 335KOPrefs *KOPrefs::instance()
335{ 336{
336 if (!mInstance) { 337 if (!mInstance) {
337 mInstance = insd.setObject(new KOPrefs()); 338 mInstance = insd.setObject(new KOPrefs());
338 mInstance->readConfig(); 339 mInstance->readConfig();
339 } 340 }
340 341
341 return mInstance; 342 return mInstance;
342} 343}
343 344
344void KOPrefs::usrSetDefaults() 345void KOPrefs::usrSetDefaults()
345{ 346{
346 347
347} 348}
348 349
349void KOPrefs::fillMailDefaults() 350void KOPrefs::fillMailDefaults()
350{ 351{
351 if (mName.isEmpty()) mName = i18n("Anonymous"); 352 if (mName.isEmpty()) mName = i18n("Anonymous");
352 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
353} 354}
354 355
355void KOPrefs::setTimeZoneIdDefault() 356void KOPrefs::setTimeZoneIdDefault()
356{ 357{
357 ; 358 ;
358} 359}
359 360
360void KOPrefs::setAllDefaults() 361void KOPrefs::setAllDefaults()
361{ 362{
362 setCategoryDefaults(); 363 setCategoryDefaults();
363 mEventSummaryUser = getDefaultList() ; 364 mEventSummaryUser = getDefaultList() ;
364 mTodoSummaryUser = getDefaultList() ; 365 mTodoSummaryUser = getDefaultList() ;
365 mLocationDefaults = getLocationDefaultList(); 366 mLocationDefaults = getLocationDefaultList();
366} 367}
367 368
368void KOPrefs::setCategoryDefaults() 369void KOPrefs::setCategoryDefaults()
369{ 370{
370 mCustomCategories.clear(); 371 mCustomCategories.clear();
371 mCustomCategories = getDefaultList(); 372 mCustomCategories = getDefaultList();
372 373
373 QStringList::Iterator it; 374 QStringList::Iterator it;
374 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
375 setCategoryColor(*it,mDefaultCategoryColor); 376 setCategoryColor(*it,mDefaultCategoryColor);
376 } 377 }
377} 378}
378QStringList KOPrefs::getLocationDefaultList() 379QStringList KOPrefs::getLocationDefaultList()
379{ 380{
380 QStringList retval ; 381 QStringList retval ;
381 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
382 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
383 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
384 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
385 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
386 387
387 retval.sort(); 388 retval.sort();
388 return retval; 389 return retval;
389} 390}
390QStringList KOPrefs::getDefaultList() 391QStringList KOPrefs::getDefaultList()
391{ 392{
392 QStringList retval ; 393 QStringList retval ;
393 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
394 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 395 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
395 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 396 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
396 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
397 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 398 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
398 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 399 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
399 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 400 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
400 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 401 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
401 retval.sort(); 402 retval.sort();
402 //qDebug("cat %s ", retval.join("-").latin1()); 403 //qDebug("cat %s ", retval.join("-").latin1());
403 return retval; 404 return retval;
404} 405}
405 406
406void KOPrefs::usrReadConfig() 407void KOPrefs::usrReadConfig()
407{ 408{
408 config()->setGroup("General"); 409 config()->setGroup("General");
409 410
410 //qDebug("KOPrefs::usrReadConfig() "); 411 //qDebug("KOPrefs::usrReadConfig() ");
411 mCustomCategories = config()->readListEntry("Custom Categories"); 412 mCustomCategories = config()->readListEntry("Custom Categories");
412 mOldLoadedLanguage = mOldLanguage ; 413 mOldLoadedLanguage = mOldLanguage ;
413 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
414 if (mLocationDefaults.isEmpty()) { 415 if (mLocationDefaults.isEmpty()) {
415 mLocationDefaults = getLocationDefaultList(); 416 mLocationDefaults = getLocationDefaultList();
416 } 417 }
417 418
418 if (mEventSummaryUser.isEmpty()) { 419 if (mEventSummaryUser.isEmpty()) {
419 mEventSummaryUser = getDefaultList() ; 420 mEventSummaryUser = getDefaultList() ;
420 } 421 }
421 if (mTodoSummaryUser.isEmpty()) { 422 if (mTodoSummaryUser.isEmpty()) {
422 mTodoSummaryUser = getDefaultList() ; 423 mTodoSummaryUser = getDefaultList() ;
423 } 424 }
424 425
425 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 426 if (mCustomCategories.isEmpty()) setCategoryDefaults();
426 427
427 config()->setGroup("Personal Settings"); 428 config()->setGroup("Personal Settings");
428 mName = config()->readEntry("user_name",""); 429 mName = config()->readEntry("user_name","");
429 mEmail = config()->readEntry("user_email",""); 430 mEmail = config()->readEntry("user_email","");
430 fillMailDefaults(); 431 fillMailDefaults();
431 432
432 config()->setGroup("Category Colors"); 433 config()->setGroup("Category Colors");
433 QStringList::Iterator it; 434 QStringList::Iterator it;
434 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
435 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
436 437
437 } 438 }
438 439 config()->setGroup("CCal");
440 int numCals = config()->readNumEntry("NumberCalendars",0 );
441 mNextAvailableCalendar = 1;
442 if ( numCals == 0 ) {
443 KopiCalendarFile *kkf = getNewCalendar();
444 kkf->isStandard = true;
445 kkf->mName = i18n("Standard Calendar");
446 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
447 }
448 while ( mNextAvailableCalendar <= numCals ) {
449 qDebug("Read cal #%d ", mNextAvailableCalendar );
450 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
451 KopiCalendarFile *kkf = getNewCalendar();
452 kkf->isStandard = config()->readBoolEntry( prefix+"_isStandard", false );
453 kkf->isEnabled = config()->readBoolEntry( prefix+"_isEnabled", true);
454 kkf->isAlarmEnabled = config()->readBoolEntry( prefix+"_isAlarmEnabled", true);
455 kkf->isReadOnly = config()->readBoolEntry( prefix+"_isReadOnly", false);
456 kkf->mName = config()->readEntry( prefix+"_Name", "Calendar");
457 kkf->mFileName = config()->readEntry( prefix+"_FileName", kkf->mFileName);
458 kkf->mDefaultColor = config()->readColorEntry( prefix+"_Color",&mEventColor);
459 if ( kkf->mCalNumber == 1 ) {
460 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
461 //kkf->mName = i18n("Standard Calendar");
462 }
463 }
464
439 KPimPrefs::usrReadConfig(); 465 KPimPrefs::usrReadConfig();
440} 466}
441 467
442 468
469KopiCalendarFile * KOPrefs::getNewCalendar()
470{
471 KopiCalendarFile * kkf = new KopiCalendarFile();
472 kkf->mCalNumber = mNextAvailableCalendar;
473 mDefCalColors.resize( mNextAvailableCalendar );
474 mDefCalColors[mNextAvailableCalendar-1] = kkf;
475 ++mNextAvailableCalendar;
476 kkf->mDefaultColor = mEventColor;
477 kkf->mName = i18n("New Calendar");
478 mCalendars.append( kkf );
479 return kkf;
480}
481void KOPrefs::deleteCalendar( int num )
482{
483 KopiCalendarFile * kkf = mCalendars.first();
484 while ( kkf ) {
485 if ( kkf->mCalNumber == num ) {
486 qDebug("KOPrefs::deleteCalendar %d ", num );
487 mCalendars.remove( kkf );
488 delete kkf;
489 return;
490 }
491 kkf = mCalendars.next();
492 }
493}
494QColor KOPrefs::defaultColor( int calNum ) const
495{
496 return (mDefCalColors[calNum-1])->mDefaultColor;
497}
443void KOPrefs::usrWriteConfig() 498void KOPrefs::usrWriteConfig()
444{ 499{
445 config()->setGroup("General"); 500 config()->setGroup("General");
446 config()->writeEntry("Custom Categories",mCustomCategories); 501 config()->writeEntry("Custom Categories",mCustomCategories);
447 502
448 config()->setGroup("Personal Settings"); 503 config()->setGroup("Personal Settings");
449 config()->writeEntry("user_name",mName); 504 config()->writeEntry("user_name",mName);
450 config()->writeEntry("user_email",mEmail); 505 config()->writeEntry("user_email",mEmail);
451 506
452 config()->setGroup("Category Colors"); 507 config()->setGroup("Category Colors");
453 QDictIterator<QColor> it(mCategoryColors); 508 QDictIterator<QColor> it(mCategoryColors);
454 while (it.current()) { 509 while (it.current()) {
455 config()->writeEntry(it.currentKey(),*(it.current())); 510 config()->writeEntry(it.currentKey(),*(it.current()));
456 ++it; 511 ++it;
457 } 512 }
458 513 config()->setGroup("CCal");
459 514 config()->writeEntry("NumberCalendars",mCalendars.count());
515 int numCal = 1;
516 int writeCal = 0;
517 while ( numCal < mNextAvailableCalendar ) {
518 KopiCalendarFile * kkf = mCalendars.first();
519 while ( kkf ) {
520 qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
521 if ( kkf->mCalNumber == numCal ) {
522 ++writeCal;
523 qDebug("Write calendar %d %d ", numCal , writeCal);
524 QString prefix = "Cal_" + QString::number( writeCal );
525 config()->writeEntry( prefix+"_isStandard", kkf->isStandard );
526 config()->writeEntry( prefix+"_isEnabled", kkf->isEnabled );
527 config()->writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
528 config()->writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
529 config()->writeEntry( prefix+"_Name", kkf->mName);
530 config()->writeEntry( prefix+"_FileName", kkf->mFileName);
531 config()->writeEntry( prefix+"_Color",kkf->mDefaultColor);
532 }
533 kkf = mCalendars.next();
534 }
535 ++numCal;
536 }
460 KPimPrefs::usrWriteConfig(); 537 KPimPrefs::usrWriteConfig();
461} 538}
462 539
463void KOPrefs::setCategoryColor(QString cat,const QColor & color) 540void KOPrefs::setCategoryColor(QString cat,const QColor & color)
464{ 541{
465 mCategoryColors.replace(cat,new QColor(color)); 542 mCategoryColors.replace(cat,new QColor(color));
466} 543}
467 544
468QColor *KOPrefs::categoryColor(QString cat) 545QColor *KOPrefs::categoryColor(QString cat)
469{ 546{
470 QColor *color = 0; 547 QColor *color = 0;
471 548
472 if (!cat.isEmpty()) color = mCategoryColors[cat]; 549 if (!cat.isEmpty()) color = mCategoryColors[cat];
473 550
474 if (color) return color; 551 if (color) return color;
475 else return &mDefaultCategoryColor; 552 else return &mDefaultCategoryColor;
476} 553}
477 554
478void KOPrefs::setFullName(const QString &name) 555void KOPrefs::setFullName(const QString &name)
479{ 556{
480 mName = name; 557 mName = name;
481} 558}
482 559
483void KOPrefs::setEmail(const QString &email) 560void KOPrefs::setEmail(const QString &email)
484{ 561{
485 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 562 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
486 mEmail = email; 563 mEmail = email;
487} 564}
488 565
489QString KOPrefs::fullName() 566QString KOPrefs::fullName()
490{ 567{
491 if (mEmailControlCenter) { 568 if (mEmailControlCenter) {
492 KEMailSettings settings; 569 KEMailSettings settings;
493 return settings.getSetting(KEMailSettings::RealName); 570 return settings.getSetting(KEMailSettings::RealName);
494 } else { 571 } else {
495 return mName; 572 return mName;
496 } 573 }
497} 574}
498 575
499QString KOPrefs::email() 576QString KOPrefs::email()
500{ 577{
501 if (mEmailControlCenter) { 578 if (mEmailControlCenter) {
502 KEMailSettings settings; 579 KEMailSettings settings;
503 return settings.getSetting(KEMailSettings::EmailAddress); 580 return settings.getSetting(KEMailSettings::EmailAddress);
504 } else { 581 } else {
505 return mEmail; 582 return mEmail;
506 } 583 }
507} 584}
508KConfig* KOPrefs::getConfig() 585KConfig* KOPrefs::getConfig()
509{ 586{
510 return config(); 587 return config();
511} 588}
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 864cf1b..7d71cbd 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -1,321 +1,351 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,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#ifndef KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <qdict.h>
29#include <qdir.h>
30#include <qobject.h>
29 31
30class KConfig; 32class KConfig;
31class QFont; 33class QFont;
32class QColor; 34class QColor;
33class QStringList; 35class QStringList;
34 36
35#define VIEW_WN_VIEW 1 37#define VIEW_WN_VIEW 1
36#define VIEW_NX_VIEW 2 38#define VIEW_NX_VIEW 2
37#define VIEW_J_VIEW 3 39#define VIEW_J_VIEW 3
38#define VIEW_A_VIEW 4 40#define VIEW_A_VIEW 4
39#define VIEW_ML_VIEW 5 41#define VIEW_ML_VIEW 5
40#define VIEW_M_VIEW 6 42#define VIEW_M_VIEW 6
41#define VIEW_L_VIEW 7 43#define VIEW_L_VIEW 7
42#define VIEW_T_VIEW 8 44#define VIEW_T_VIEW 8
43 45
46class KopiCalendarFile : public QObject
47{
48 public:
49 KopiCalendarFile( ) : QObject( )
50 {
51 isStandard = false;
52 isEnabled = true;
53 isAlarmEnabled = true;
54 isReadOnly = false;
55 mName = "Calendar";
56 mFileName = QDir::homeDirPath() + "/icalfile.ics";
57 mCalNumber = 0;
58 mDefaultColor = Qt::red;
59 }
60 bool isStandard;
61 bool isEnabled;
62 bool isAlarmEnabled;
63 bool isReadOnly;
64 QString mName;
65 QString mFileName;
66 int mCalNumber;
67 QColor mDefaultColor;
68};
44class KOPrefs : public KPimPrefs 69class KOPrefs : public KPimPrefs
45{ 70{
46 public: 71 public:
47 enum { FormatVCalendar, FormatICalendar }; 72 enum { FormatVCalendar, FormatICalendar };
48 enum { MailClientKMail, MailClientSendmail }; 73 enum { MailClientKMail, MailClientSendmail };
49 enum { IMIPDummy, IMIPKMail }; 74 enum { IMIPDummy, IMIPKMail };
50 enum { IMIPOutbox, IMIPdirectsend }; 75 enum { IMIPOutbox, IMIPdirectsend };
51 enum { neverAuto, addressbookAuto, selectedAuto }; 76 enum { neverAuto, addressbookAuto, selectedAuto };
52 enum { standardDestination, askDestination }; 77 enum { standardDestination, askDestination };
53 78
54 virtual ~KOPrefs(); 79 virtual ~KOPrefs();
55 80
56 /** Get instance of KOPrefs. It is made sure that there is only one 81 /** Get instance of KOPrefs. It is made sure that there is only one
57 instance. */ 82 instance. */
58 static KOPrefs *instance(); 83 static KOPrefs *instance();
59 84
60 /** Set preferences to default values */ 85 /** Set preferences to default values */
61 void usrSetDefaults(); 86 void usrSetDefaults();
62 87
63 /** Read preferences from config file */ 88 /** Read preferences from config file */
64 void usrReadConfig(); 89 void usrReadConfig();
65 90
66 /** Write preferences to config file */ 91 /** Write preferences to config file */
67 void usrWriteConfig(); 92 void usrWriteConfig();
68 void setCategoryDefaults(); 93 void setCategoryDefaults();
69 void setAllDefaults(); 94 void setAllDefaults();
70 95 KopiCalendarFile * getNewCalendar();
96 void deleteCalendar( int );
97 QColor defaultColor( int ) const;
71 protected: 98 protected:
72 void setTimeZoneIdDefault(); 99 void setTimeZoneIdDefault();
73 100
74 /** Fill empty mail fields with default values. */ 101 /** Fill empty mail fields with default values. */
75 void fillMailDefaults(); 102 void fillMailDefaults();
76 103
77 private: 104 private:
78 /** Constructor disabled for public. Use instance() to create a KOPrefs 105 /** Constructor disabled for public. Use instance() to create a KOPrefs
79 object. */ 106 object. */
80 KOPrefs(); 107 KOPrefs();
81 108
82 static KOPrefs *mInstance; 109 static KOPrefs *mInstance;
83 QStringList getDefaultList(); 110 QStringList getDefaultList();
84 QStringList getLocationDefaultList(); 111 QStringList getLocationDefaultList();
85 public: 112 public:
86 // preferences data 113 // preferences data
87 KConfig* getConfig(); 114 KConfig* getConfig();
88 void setFullName(const QString &); 115 void setFullName(const QString &);
89 QString fullName(); 116 QString fullName();
90 void setEmail(const QString &); 117 void setEmail(const QString &);
91 QString email(); 118 QString email();
92 119
93 QString mAdditional; 120 QString mAdditional;
94 121
95 bool mEmailControlCenter; 122 bool mEmailControlCenter;
96 123
97 bool mBcc; 124 bool mBcc;
98 bool mAutoSave; 125 bool mAutoSave;
99 int mAutoSaveInterval; 126 int mAutoSaveInterval;
100 bool mConfirm; 127 bool mConfirm;
101 128
102 bool mEnableGroupScheduling; 129 bool mEnableGroupScheduling;
103 bool mEnableProjectView; 130 bool mEnableProjectView;
104 131
105 int mDefaultFormat; 132 int mDefaultFormat;
106 int mMailClient; 133 int mMailClient;
107 134
108 int mStartTime; 135 int mStartTime;
109 int mDefaultDuration; 136 int mDefaultDuration;
110 int mAlarmTime; 137 int mAlarmTime;
111 138
112 int mWorkingHoursStart; 139 int mWorkingHoursStart;
113 int mWorkingHoursEnd; 140 int mWorkingHoursEnd;
114 bool mExcludeHolidays; 141 bool mExcludeHolidays;
115 bool mExcludeSaturdays; 142 bool mExcludeSaturdays;
116 bool mMarcusBainsShowSeconds; 143 bool mMarcusBainsShowSeconds;
117 144
118 QFont mTimeBarFont; 145 QFont mTimeBarFont;
119 QFont mMonthViewFont; 146 QFont mMonthViewFont;
120 QFont mAgendaViewFont; 147 QFont mAgendaViewFont;
121 QFont mMarcusBainsFont; 148 QFont mMarcusBainsFont;
122 QFont mTimeLabelsFont; 149 QFont mTimeLabelsFont;
123 QFont mTodoViewFont; 150 QFont mTodoViewFont;
124 QFont mListViewFont; 151 QFont mListViewFont;
125 QFont mDateNavigatorFont; 152 QFont mDateNavigatorFont;
126 QFont mEditBoxFont; 153 QFont mEditBoxFont;
127 QFont mJornalViewFont; 154 QFont mJornalViewFont;
128 QFont mWhatsNextFont; 155 QFont mWhatsNextFont;
129 QFont mEventViewFont; 156 QFont mEventViewFont;
130 157
131 158
132 159
133 160
134 QColor mHolidayColor; 161 QColor mHolidayColor;
135 QColor mHighlightColor; 162 QColor mHighlightColor;
136 QColor mEventColor; 163 QColor mEventColor;
137 QColor mTodoDoneColor; 164 QColor mTodoDoneColor;
138 QColor mAgendaBgColor; 165 QColor mAgendaBgColor;
139 QColor mWorkingHoursColor; 166 QColor mWorkingHoursColor;
140 QColor mTodoDueTodayColor; 167 QColor mTodoDueTodayColor;
141 QColor mTodoOverdueColor; 168 QColor mTodoOverdueColor;
142 QColor mTodoRunColor; 169 QColor mTodoRunColor;
143 QColor mMonthViewEvenColor; 170 QColor mMonthViewEvenColor;
144 QColor mMonthViewOddColor; 171 QColor mMonthViewOddColor;
145 QColor mMonthViewHolidayColor; 172 QColor mMonthViewHolidayColor;
146 bool mMonthViewUsesDayColors; 173 bool mMonthViewUsesDayColors;
147 bool mMonthViewSatSunTog; 174 bool mMonthViewSatSunTog;
148 bool mMonthViewWeek; 175 bool mMonthViewWeek;
149 QColor mAppColor1; 176 QColor mAppColor1;
150 QColor mAppColor2; 177 QColor mAppColor2;
151 bool mUseAppColors; 178 bool mUseAppColors;
152 179
153 int mDayBegins; 180 int mDayBegins;
154 int mHourSize; 181 int mHourSize;
155 int mAllDaySize; 182 int mAllDaySize;
156 bool mShowFullMenu; 183 bool mShowFullMenu;
157 bool mDailyRecur; 184 bool mDailyRecur;
158 bool mWeeklyRecur; 185 bool mWeeklyRecur;
159 bool mMonthDailyRecur; 186 bool mMonthDailyRecur;
160 bool mMonthWeeklyRecur; 187 bool mMonthWeeklyRecur;
161 bool mMonthShowIcons; 188 bool mMonthShowIcons;
162 bool mMonthShowTimes; 189 bool mMonthShowTimes;
163 bool mMonthShowShort; 190 bool mMonthShowShort;
164 bool mEnableToolTips; 191 bool mEnableToolTips;
165 bool mEnableMonthScroll; 192 bool mEnableMonthScroll;
166 bool mFullViewMonth; 193 bool mFullViewMonth;
167 bool mMonthViewUsesCategoryColor; 194 bool mMonthViewUsesCategoryColor;
168 bool mFullViewTodo; 195 bool mFullViewTodo;
169 bool mShowCompletedTodo; 196 bool mShowCompletedTodo;
170 bool mMarcusBainsEnabled; 197 bool mMarcusBainsEnabled;
171 int mNextXDays; 198 int mNextXDays;
172 int mWhatsNextDays; 199 int mWhatsNextDays;
173 int mWhatsNextPrios; 200 int mWhatsNextPrios;
174 bool mEnableQuickTodo; 201 bool mEnableQuickTodo;
175 202
176 bool mCompactDialogs; 203 bool mCompactDialogs;
177 bool mVerticalScreen; 204 bool mVerticalScreen;
178 205
179 bool mShowIconNewTodo; 206 bool mShowIconNewTodo;
180 bool mShowIconNewEvent; 207 bool mShowIconNewEvent;
181 bool mShowIconSearch; 208 bool mShowIconSearch;
182 bool mShowIconList; 209 bool mShowIconList;
183 bool mShowIconDay1; 210 bool mShowIconDay1;
184 bool mShowIconDay5; 211 bool mShowIconDay5;
185 bool mShowIconDay6; 212 bool mShowIconDay6;
186 bool mShowIconDay7; 213 bool mShowIconDay7;
187 bool mShowIconMonth; 214 bool mShowIconMonth;
188 bool mShowIconTodoview; 215 bool mShowIconTodoview;
189 bool mShowIconBackFast; 216 bool mShowIconBackFast;
190 bool mShowIconBack; 217 bool mShowIconBack;
191 bool mShowIconToday; 218 bool mShowIconToday;
192 bool mShowIconForward; 219 bool mShowIconForward;
193 bool mShowIconForwardFast; 220 bool mShowIconForwardFast;
194 bool mShowIconWhatsThis; 221 bool mShowIconWhatsThis;
195 bool mShowIconWeekNum; 222 bool mShowIconWeekNum;
196 bool mShowIconNextDays; 223 bool mShowIconNextDays;
197 bool mShowIconNext; 224 bool mShowIconNext;
198 bool mShowIconJournal; 225 bool mShowIconJournal;
199 bool mShowIconFilter; 226 bool mShowIconFilter;
200 bool mShowIconOnetoolbar; 227 bool mShowIconOnetoolbar;
201 bool mShowIconNavigator; 228 bool mShowIconNavigator;
202 bool mShowIconAllday; 229 bool mShowIconAllday;
203 bool mShowIconFilterview; 230 bool mShowIconFilterview;
204 bool mShowIconToggleFull; 231 bool mShowIconToggleFull;
205 232
206 bool mShowIconStretch; 233 bool mShowIconStretch;
207 234
208 bool mToolBarHor; 235 bool mToolBarHor;
209 bool mToolBarUp; 236 bool mToolBarUp;
210 bool mToolBarHorV; 237 bool mToolBarHorV;
211 bool mToolBarUpV; 238 bool mToolBarUpV;
212 bool mToolBarHorN; 239 bool mToolBarHorN;
213 bool mToolBarUpN; 240 bool mToolBarUpN;
214 bool mToolBarHorF; 241 bool mToolBarHorF;
215 bool mToolBarUpF; 242 bool mToolBarUpF;
216 bool mToolBarMiniIcons; 243 bool mToolBarMiniIcons;
217 244
218 bool mAskForQuit; 245 bool mAskForQuit;
219 bool mUsePassWd; 246 bool mUsePassWd;
220 bool mShowSyncEvents; 247 bool mShowSyncEvents;
221 bool mShowTodoInAgenda; 248 bool mShowTodoInAgenda;
222 bool mShowCompletedTodoInAgenda; 249 bool mShowCompletedTodoInAgenda;
223 bool mShowTimeInAgenda; 250 bool mShowTimeInAgenda;
224 bool mHideNonStartedTodos; 251 bool mHideNonStartedTodos;
225 252
226 bool mBlockPopupMenu; 253 bool mBlockPopupMenu;
227 254
228 int mLastSyncTime; 255 int mLastSyncTime;
229 void setCategoryColor(QString cat,const QColor & color); 256 void setCategoryColor(QString cat,const QColor & color);
230 QColor *categoryColor(QString cat); 257 QColor *categoryColor(QString cat);
231 258
232 QString mArchiveFile; 259 QString mArchiveFile;
233 QString mHtmlExportFile; 260 QString mHtmlExportFile;
234 bool mHtmlWithSave; 261 bool mHtmlWithSave;
235 262
236 QStringList mSelectedPlugins; 263 QStringList mSelectedPlugins;
237 264
238 QString mLastImportFile; 265 QString mLastImportFile;
239 QString mLastVcalFile; 266 QString mLastVcalFile;
240 QString mLastSaveFile; 267 QString mLastSaveFile;
241 QString mLastLoadFile; 268 QString mLastLoadFile;
242 269
243 270
244 QString mDefaultAlarmFile; 271 QString mDefaultAlarmFile;
245 int mIMIPScheduler; 272 int mIMIPScheduler;
246 int mIMIPSend; 273 int mIMIPSend;
247 QStringList mAdditionalMails; 274 QStringList mAdditionalMails;
248 int mIMIPAutoRefresh; 275 int mIMIPAutoRefresh;
249 int mIMIPAutoInsertReply; 276 int mIMIPAutoInsertReply;
250 int mIMIPAutoInsertRequest; 277 int mIMIPAutoInsertRequest;
251 int mIMIPAutoFreeBusy; 278 int mIMIPAutoFreeBusy;
252 int mIMIPAutoFreeBusyReply; 279 int mIMIPAutoFreeBusyReply;
253 280
254 QStringList mTodoTemplates; 281 QStringList mTodoTemplates;
255 QStringList mEventTemplates; 282 QStringList mEventTemplates;
256 283
257 int mDestination; 284 int mDestination;
258 285
259 286
260 bool mEditOnDoubleClick; 287 bool mEditOnDoubleClick;
261 bool mViewChangeHoldFullscreen; 288 bool mViewChangeHoldFullscreen;
262 bool mViewChangeHoldNonFullscreen; 289 bool mViewChangeHoldNonFullscreen;
263 bool mCenterOnCurrentTime; 290 bool mCenterOnCurrentTime;
264 bool mSetTimeToDayStartAt; 291 bool mSetTimeToDayStartAt;
265 bool mHighlightCurrentDay; 292 bool mHighlightCurrentDay;
266 bool mUseHighlightLightColor; 293 bool mUseHighlightLightColor;
267 bool mListViewMonthTimespan; 294 bool mListViewMonthTimespan;
268 bool mWNViewShowsParents; 295 bool mWNViewShowsParents;
269 bool mWNViewShowsPast; 296 bool mWNViewShowsPast;
270 bool mWNViewShowLocation; 297 bool mWNViewShowLocation;
271 bool mTodoViewShowsPercentage; 298 bool mTodoViewShowsPercentage;
272 bool mTodoViewUsesCatColors; 299 bool mTodoViewUsesCatColors;
273 bool mMonthViewUsesBigFont; 300 bool mMonthViewUsesBigFont;
274 bool mTodoViewUsesSmallFont; 301 bool mTodoViewUsesSmallFont;
275 bool mTodoViewUsesForegroundColor; 302 bool mTodoViewUsesForegroundColor;
276 bool mMonthViewUsesForegroundColor; 303 bool mMonthViewUsesForegroundColor;
277 304
278 bool mHightlightDateTimeEdit; 305 bool mHightlightDateTimeEdit;
279 bool mShortDateInViewer; 306 bool mShortDateInViewer;
280 307
281 bool mShowDateNavigator; 308 bool mShowDateNavigator;
282 309
283 QStringList mLocationDefaults; 310 QStringList mLocationDefaults;
284 QStringList mEventSummaryUser; 311 QStringList mEventSummaryUser;
285 QStringList mTodoSummaryUser; 312 QStringList mTodoSummaryUser;
286 313
287 bool mUseInternalAlarmNotification; 314 bool mUseInternalAlarmNotification;
288 int mAlarmPlayBeeps; 315 int mAlarmPlayBeeps;
289 int mAlarmSuspendTime; 316 int mAlarmSuspendTime;
290 int mAlarmSuspendCount; 317 int mAlarmSuspendCount;
291 int mAlarmBeepInterval; 318 int mAlarmBeepInterval;
292 int mOldLanguage; 319 int mOldLanguage;
293 int mOldLoadedLanguage; 320 int mOldLoadedLanguage;
294 321
295 322
296 QString mActiveSyncPort; 323 QString mActiveSyncPort;
297 QString mActiveSyncIP; 324 QString mActiveSyncIP;
298 325
299 // settings for eventviewer 326 // settings for eventviewer
300 bool mEVshowDetails; 327 bool mEVshowDetails;
301 bool mEVshowCreated; 328 bool mEVshowCreated;
302 bool mEVshowChanged; 329 bool mEVshowChanged;
303 bool mWTshowDetails; 330 bool mWTshowDetails;
304 bool mWTshowCreated; 331 bool mWTshowCreated;
305 bool mWTshowChanged; 332 bool mWTshowChanged;
306 333
307 int mCurrentDisplayedView; 334 int mCurrentDisplayedView;
335 QPtrList<KopiCalendarFile> mCalendars;
336 int mNextAvailableCalendar;
308 337
309 private: 338 private:
310 QDict<QColor> mCategoryColors; 339 QDict<QColor> mCategoryColors;
340 QArray<KopiCalendarFile*> mDefCalColors;
311 QColor mDefaultCategoryColor; 341 QColor mDefaultCategoryColor;
312 342
313 QFont mDefaultTimeBarFont; 343 QFont mDefaultTimeBarFont;
314 QFont mDefaultViewFont; 344 QFont mDefaultViewFont;
315 QFont mDefaultMonthViewFont; 345 QFont mDefaultMonthViewFont;
316 346
317 QString mName; 347 QString mName;
318 QString mEmail; 348 QString mEmail;
319}; 349};
320 350
321#endif 351#endif