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