summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-18 20:59:18 (UTC)
committer zautrix <zautrix>2005-01-18 20:59:18 (UTC)
commitc8401418d054bf32810a5f9e07091a177bdeae37 (patch) (unidiff)
treee25fe3d5a3edcaaeab83488331c8ed8458405ff5 /korganizer
parent541a04d084d7514a31c9ec88afe6c0ee7add7b85 (diff)
downloadkdepimpi-c8401418d054bf32810a5f9e07091a177bdeae37.zip
kdepimpi-c8401418d054bf32810a5f9e07091a177bdeae37.tar.gz
kdepimpi-c8401418d054bf32810a5f9e07091a177bdeae37.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index aae4692..0a767b6 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,470 +1,470 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "koprefs.h" 46#include "koprefs.h"
47#include "mainwindow.h" 47#include "mainwindow.h"
48 48
49KOPrefs *KOPrefs::mInstance = 0; 49KOPrefs *KOPrefs::mInstance = 0;
50static KStaticDeleter<KOPrefs> insd; 50static KStaticDeleter<KOPrefs> insd;
51 51
52KOPrefs::KOPrefs() : 52KOPrefs::KOPrefs() :
53 KPimPrefs("korganizerrc") 53 KPimPrefs("korganizerrc")
54{ 54{
55 mCategoryColors.setAutoDelete(true); 55 mCategoryColors.setAutoDelete(true);
56 fillMailDefaults(); 56 fillMailDefaults();
57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
58 QColor defaultHolidayColor = QColor(255,0,0); 58 QColor defaultHolidayColor = QColor(255,0,0);
59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
62 QColor defaultTodoDueTodayColor = QColor(255,220,100); 62 QColor defaultTodoDueTodayColor = QColor(255,220,100);
63 QColor defaultTodoOverdueColor = QColor(255,153,125); 63 QColor defaultTodoOverdueColor = QColor(255,153,125);
64 64
65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
66 mDefaultViewFont = QFont("helvetica",10); 66 mDefaultViewFont = QFont("helvetica",10);
67 mDefaultMonthViewFont = QFont("helvetica",8); 67 mDefaultMonthViewFont = QFont("helvetica",8);
68 mMarcusBainsFont= QFont("helvetica",10); 68 mMarcusBainsFont= QFont("helvetica",10);
69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
70 mEditBoxFont = QFont("helvetica",12); 70 mEditBoxFont = QFont("helvetica",12);
71 mJornalViewFont = QFont("helvetica",12); 71 mJornalViewFont = QFont("helvetica",12);
72 72
73 KPrefs::setCurrentGroup("General"); 73 KPrefs::setCurrentGroup("General");
74 74
75 75
76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
77 77
78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
80 addItemBool("ShowIconSearch",&mShowIconSearch,true); 80 addItemBool("ShowIconSearch",&mShowIconSearch,true);
81 addItemBool("ShowIconList",&mShowIconList,true); 81 addItemBool("ShowIconList",&mShowIconList,true);
82 addItemBool("ShowIconDay1",&mShowIconDay1,true); 82 addItemBool("ShowIconDay1",&mShowIconDay1,true);
83 addItemBool("ShowIconDay5",&mShowIconDay5,true); 83 addItemBool("ShowIconDay5",&mShowIconDay5,true);
84 addItemBool("ShowIconDay7",&mShowIconDay7,true); 84 addItemBool("ShowIconDay7",&mShowIconDay7,true);
85 addItemBool("ShowIconMonth",&mShowIconMonth,true); 85 addItemBool("ShowIconMonth",&mShowIconMonth,true);
86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
88 addItemBool("ShowIconBack",&mShowIconBack,true); 88 addItemBool("ShowIconBack",&mShowIconBack,true);
89 addItemBool("ShowIconToday",&mShowIconToday,true); 89 addItemBool("ShowIconToday",&mShowIconToday,true);
90 addItemBool("ShowIconForward",&mShowIconForward,true); 90 addItemBool("ShowIconForward",&mShowIconForward,true);
91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); 92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
94 addItemBool("ShowIconNext",&mShowIconNext,true); 94 addItemBool("ShowIconNext",&mShowIconNext,true);
95 addItemBool("ShowIconJournal",&mShowIconJournal,true); 95 addItemBool("ShowIconJournal",&mShowIconJournal,true);
96 addItemBool("ShowIconStretch",&mShowIconStretch,true); 96 addItemBool("ShowIconStretch",&mShowIconStretch,true);
97 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 97 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
98 98
99 addItemBool("AskForQuit",&mAskForQuit,false); 99 addItemBool("AskForQuit",&mAskForQuit,false);
100 100
101#ifndef DESKTOP_VERSION 101#ifndef DESKTOP_VERSION
102 addItemBool("ShowFullMenu",&mShowFullMenu,false); 102 addItemBool("ShowFullMenu",&mShowFullMenu,false);
103#else 103#else
104 addItemBool("ShowFullMenu",&mShowFullMenu,true); 104 addItemBool("ShowFullMenu",&mShowFullMenu,true);
105#endif 105#endif
106 addItemBool("ToolBarHor",&mToolBarHor, true ); 106 addItemBool("ToolBarHor",&mToolBarHor, true );
107 addItemBool("ToolBarUp",&mToolBarUp, false ); 107 addItemBool("ToolBarUp",&mToolBarUp, false );
108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
109 addItemInt("Whats Next Days",&mWhatsNextDays,3); 109 addItemInt("Whats Next Days",&mWhatsNextDays,3);
110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
111 111
112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
116 addItemInt("AllDay Size",&mAllDaySize,28); 116 addItemInt("AllDay Size",&mAllDaySize,28);
117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
119 119
120 addItemStringList("LocationDefaults",&mLocationDefaults ); 120 addItemStringList("LocationDefaults",&mLocationDefaults );
121 addItemStringList("EventSummary User",&mEventSummaryUser); 121 addItemStringList("EventSummary User",&mEventSummaryUser);
122 addItemStringList("TodoSummary User",&mTodoSummaryUser); 122 addItemStringList("TodoSummary User",&mTodoSummaryUser);
123 123
124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
125 addItemBool("Enable Project View",&mEnableProjectView,false); 125 addItemBool("Enable Project View",&mEnableProjectView,false);
126 addItemBool("Auto Save",&mAutoSave,false); 126 addItemBool("Auto Save",&mAutoSave,false);
127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
128 addItemBool("Confirm Deletes",&mConfirm,true); 128 addItemBool("Confirm Deletes",&mConfirm,true);
129 addItemString("Archive File",&mArchiveFile); 129 addItemString("Archive File",&mArchiveFile);
130 addItemString("Html Export File",&mHtmlExportFile, 130 addItemString("Html Export File",&mHtmlExportFile,
131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
132 addItemBool("Html With Save",&mHtmlWithSave,false); 132 addItemBool("Html With Save",&mHtmlWithSave,false);
133 133
134 KPrefs::setCurrentGroup("Personal Settings"); 134 KPrefs::setCurrentGroup("Personal Settings");
135 135
136 addItemInt("Mail Client",&mMailClient,MailClientKMail); 136 addItemInt("Mail Client",&mMailClient,MailClientKMail);
137 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 137 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
138 addItemBool("Bcc",&mBcc,false); 138 addItemBool("Bcc",&mBcc,false);
139 139
140 KPrefs::setCurrentGroup("Time & Date"); 140 KPrefs::setCurrentGroup("Time & Date");
141 141
142 142
143 addItemInt("Default Start Time",&mStartTime,10); 143 addItemInt("Default Start Time",&mStartTime,10);
144 addItemInt("Default Duration",&mDefaultDuration,2); 144 addItemInt("Default Duration",&mDefaultDuration,2);
145 addItemInt("Default Alarm Time",&mAlarmTime,3); 145 addItemInt("Default Alarm Time",&mAlarmTime,3);
146 KPrefs::setCurrentGroup("AlarmSettings"); 146 KPrefs::setCurrentGroup("AlarmSettings");
147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
151 151
152 152
153 KPrefs::setCurrentGroup("Calendar"); 153 KPrefs::setCurrentGroup("Calendar");
154 154
155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
156 156
157 KPrefs::setCurrentGroup("Fonts"); 157 KPrefs::setCurrentGroup("Fonts");
158 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 158 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
159 addItemFont("TimeBar Font",&mTimeBarFont); 159 addItemFont("TimeBar Font",&mTimeBarFont);
160 addItemFont("MonthView Font",&mMonthViewFont); 160 addItemFont("MonthView Font",&mMonthViewFont);
161 addItemFont("AgendaView Font",&mAgendaViewFont); 161 addItemFont("AgendaView Font",&mAgendaViewFont);
162 addItemFont("MarcusBains Font",&mMarcusBainsFont); 162 addItemFont("MarcusBains Font",&mMarcusBainsFont);
163 addItemFont("TimeLabels Font",&mTimeLabelsFont); 163 addItemFont("TimeLabels Font",&mTimeLabelsFont);
164 addItemFont("TodoView Font",&mTodoViewFont); 164 addItemFont("TodoView Font",&mTodoViewFont);
165 addItemFont("ListView Font",&mListViewFont); 165 addItemFont("ListView Font",&mListViewFont);
166 addItemFont("DateNavigator Font",&mDateNavigatorFont); 166 addItemFont("DateNavigator Font",&mDateNavigatorFont);
167 addItemFont("EditBox Font",&mEditBoxFont); 167 addItemFont("EditBox Font",&mEditBoxFont);
168 addItemFont("JournalView Font",&mJornalViewFont); 168 addItemFont("JournalView Font",&mJornalViewFont);
169 addItemFont("WhatsNextView Font",&mWhatsNextFont); 169 addItemFont("WhatsNextView Font",&mWhatsNextFont);
170 addItemFont("EventView Font",&mEventViewFont); 170 addItemFont("EventView Font",&mEventViewFont);
171 171
172 KPrefs::setCurrentGroup("RemoteSyncing"); 172 KPrefs::setCurrentGroup("RemoteSyncing");
173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
176 addItemInt("LastSyncTime",&mLastSyncTime,0); 176 addItemInt("LastSyncTime",&mLastSyncTime,0);
177 177
178#ifdef _WIN32_ 178#ifdef _WIN32_
179 QString hdp= locateLocal("data","korganizer")+"\\\\"; 179 QString hdp= locateLocal("data","korganizer")+"\\\\";
180#else 180#else
181 QString hdp= locateLocal("data","korganizer")+"/"; 181 QString hdp= locateLocal("data","korganizer")+"/";
182#endif 182#endif
183 183
184 KPrefs::setCurrentGroup("LoadSaveFileNames"); 184 KPrefs::setCurrentGroup("LoadSaveFileNames");
185 185
186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
190 190
191 191
192 KPrefs::setCurrentGroup("Locale"); 192 KPrefs::setCurrentGroup("Locale");
193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
194 194
195 195
196 KPrefs::setCurrentGroup("Colors"); 196 KPrefs::setCurrentGroup("Colors");
197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
212 addItemBool("UseAppColors",&mUseAppColors,false); 212 addItemBool("UseAppColors",&mUseAppColors,false);
213 213
214 214
215 215
216 KPrefs::setCurrentGroup("Views"); 216 KPrefs::setCurrentGroup("Views");
217 addItemInt("Hour Size",&mHourSize,8); 217 addItemInt("Hour Size",&mHourSize,8);
218 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 218 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
219 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 219 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
220 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 220 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
221 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 221 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
222 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 222 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
223 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 223 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
224 addItemBool("Enable ToolTips",&mEnableToolTips,false); 224 addItemBool("Enable ToolTips",&mEnableToolTips,false);
225 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 225 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
226 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 226 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
227 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 227 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
228 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 228 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
229 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 229 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
230 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 230 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
231 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 231 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
232 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 232 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
233 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 233 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
234 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 234 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
235 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 235 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
236 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 236 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
237 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 237 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
238 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 238 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
239 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 239 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
240 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 240 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
241 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 241 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
242 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 242 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
243 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 243 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
244#ifdef DESKTOP_VERSION 244#ifdef DESKTOP_VERSION
245 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 245 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
246#else 246#else
247 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 247 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
248#endif 248#endif
249 addItemInt("Day Begins",&mDayBegins,7); 249 addItemInt("Day Begins",&mDayBegins,7);
250 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 250 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
251 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 251 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
252 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 252 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
253 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 253 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
254 254
255 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 255 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
256 addItemBool("Full View Month",&mFullViewMonth,true); 256 addItemBool("Full View Month",&mFullViewMonth,true);
257 addItemBool("Full View Todo",&mFullViewTodo,true); 257 addItemBool("Full View Todo",&mFullViewTodo,true);
258 addItemBool("Quick Todo",&mEnableQuickTodo,false); 258 addItemBool("Quick Todo",&mEnableQuickTodo,false);
259 259
260 addItemInt("Next X Days",&mNextXDays,3); 260 addItemInt("Next X Days",&mNextXDays,3);
261 261
262 KPrefs::setCurrentGroup("Printer"); 262 KPrefs::setCurrentGroup("Printer");
263 263
264 KPrefs::setCurrentGroup("Layout"); 264 KPrefs::setCurrentGroup("Layout");
265 265
266 addItemBool("CompactDialogs",&mCompactDialogs,false); 266 addItemBool("CompactDialogs",&mCompactDialogs,false);
267 addItemBool("VerticalScreen",&mVerticalScreen,true); 267 addItemBool("VerticalScreen",&mVerticalScreen,true);
268 268
269 KPrefs::setCurrentGroup("KOrganizer Plugins"); 269 KPrefs::setCurrentGroup("KOrganizer Plugins");
270 270
271 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 271 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
272 272
273 KPrefs::setCurrentGroup("Group Scheduling"); 273 KPrefs::setCurrentGroup("Group Scheduling");
274 274
275 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 275 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
276 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 276 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
277 addItemStringList("AdditionalMails",&mAdditionalMails,""); 277 addItemStringList("AdditionalMails",&mAdditionalMails,"");
278 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 278 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
279 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 279 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
280 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 280 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
281 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 281 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
282 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 282 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
283 283
284 KPrefs::setCurrentGroup( "Editors" ); 284 KPrefs::setCurrentGroup( "Editors" );
285 285
286 addItemStringList( "EventTemplates", &mEventTemplates ); 286 addItemStringList( "EventTemplates", &mEventTemplates );
287 addItemStringList( "TodoTemplates", &mTodoTemplates ); 287 addItemStringList( "TodoTemplates", &mTodoTemplates );
288 288
289 addItemInt("DestinationPolicy",&mDestination,standardDestination); 289 addItemInt("DestinationPolicy",&mDestination,standardDestination);
290 290
291 291
292 292
293} 293}
294 294
295 295
296KOPrefs::~KOPrefs() 296KOPrefs::~KOPrefs()
297{ 297{
298 if (mInstance == this) 298 if (mInstance == this)
299 mInstance = insd.setObject(0); 299 mInstance = insd.setObject(0);
300 300
301 //qDebug("KOPrefs::~KOPrefs() "); 301 //qDebug("KOPrefs::~KOPrefs() ");
302} 302}
303 303
304 304
305KOPrefs *KOPrefs::instance() 305KOPrefs *KOPrefs::instance()
306{ 306{
307 if (!mInstance) { 307 if (!mInstance) {
308 mInstance = insd.setObject(new KOPrefs()); 308 mInstance = insd.setObject(new KOPrefs());
309 mInstance->readConfig(); 309 mInstance->readConfig();
310 } 310 }
311 311
312 return mInstance; 312 return mInstance;
313} 313}
314 314
315void KOPrefs::usrSetDefaults() 315void KOPrefs::usrSetDefaults()
316{ 316{
317 317
318} 318}
319 319
320void KOPrefs::fillMailDefaults() 320void KOPrefs::fillMailDefaults()
321{ 321{
322 if (mName.isEmpty()) mName = i18n("Anonymous"); 322 if (mName.isEmpty()) mName = i18n("Anonymous");
323 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 323 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
324} 324}
325 325
326void KOPrefs::setTimeZoneIdDefault() 326void KOPrefs::setTimeZoneIdDefault()
327{ 327{
328 ; 328 ;
329} 329}
330 330
331void KOPrefs::setCategoryDefaults() 331void KOPrefs::setCategoryDefaults()
332{ 332{
333 mCustomCategories.clear(); 333 mCustomCategories.clear();
334 mCustomCategories = getDefaultList(); 334 mCustomCategories = getDefaultList();
335 335
336 QStringList::Iterator it; 336 QStringList::Iterator it;
337 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 337 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
338 setCategoryColor(*it,mDefaultCategoryColor); 338 setCategoryColor(*it,mDefaultCategoryColor);
339 } 339 }
340} 340}
341 341
342QStringList KOPrefs::getDefaultList() 342QStringList KOPrefs::getDefaultList()
343{ 343{
344 QStringList retval ; 344 QStringList retval ;
345 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 345 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
346 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 346 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
347 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 347 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
348 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 348 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
349 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 349 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
350 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 350 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
351 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 351 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
352 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 352 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
353 retval.sort(); 353 retval.sort();
354 return retval; 354 return retval;
355} 355}
356 356
357void KOPrefs::usrReadConfig() 357void KOPrefs::usrReadConfig()
358{ 358{
359 config()->setGroup("General"); 359 config()->setGroup("General");
360 360
361 mCustomCategories = config()->readListEntry("Custom Categories"); 361 mCustomCategories = config()->readListEntry("Custom Categories");
362 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { 362 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) {
363 mLocationDefaults.clear(); 363 mLocationDefaults.clear();
364 mEventSummaryUser.clear(); 364 mEventSummaryUser.clear();
365 mTodoSummaryUser.clear(); 365 mTodoSummaryUser.clear();
366 } 366 }
367 mOldLoadedLanguage = mOldLanguage ; 367 mOldLoadedLanguage = mOldLanguage ;
368 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 368 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
369 if (mLocationDefaults.isEmpty()) { 369 if (mLocationDefaults.isEmpty()) {
370 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 370 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
371 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 371 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
372 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 372 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
373 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 373 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
374 mLocationDefaults.sort(); 374 mLocationDefaults.sort();
375 } 375 }
376 376
377 if (mEventSummaryUser.isEmpty()) { 377 if (mEventSummaryUser.isEmpty()) {
378 mEventSummaryUser = getDefaultList() ; 378 mEventSummaryUser = getDefaultList() ;
379 } 379 }
380 if (mTodoSummaryUser.isEmpty()) { 380 if (mTodoSummaryUser.isEmpty()) {
381 mTodoSummaryUser = getDefaultList() ; 381 mTodoSummaryUser = getDefaultList() ;
382 } 382 }
383 383
384 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 384 if (mCustomCategories.isEmpty()) setCategoryDefaults();
385 385
386 config()->setGroup("Personal Settings"); 386 config()->setGroup("Personal Settings");
387 mName = config()->readEntry("user_name",""); 387 mName = config()->readEntry("user_name","");
388 mEmail = config()->readEntry("user_email",""); 388 mEmail = config()->readEntry("user_email","");
389 fillMailDefaults(); 389 fillMailDefaults();
390 390
391 config()->setGroup("Category Colors"); 391 config()->setGroup("Category Colors");
392 QStringList::Iterator it; 392 QStringList::Iterator it;
393 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 393 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
394 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 394 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
395 395
396 } 396 }
397 397
398 KPimPrefs::usrReadConfig(); 398 KPimPrefs::usrReadConfig();
399} 399}
400 400
401 401
402void KOPrefs::usrWriteConfig() 402void KOPrefs::usrWriteConfig()
403{ 403{
404 config()->setGroup("General"); 404 config()->setGroup("General");
405 config()->writeEntry("Custom Categories",mCustomCategories); 405 config()->writeEntry("Custom Categories",mCustomCategories);
406 406
407 config()->setGroup("Personal Settings"); 407 config()->setGroup("Personal Settings");
408 config()->writeEntry("user_name",mName); 408 config()->writeEntry("user_name",mName);
409 config()->writeEntry("user_email",mEmail); 409 config()->writeEntry("user_email",mEmail);
410 410
411 config()->setGroup("Category Colors"); 411 config()->setGroup("Category Colors");
412 QDictIterator<QColor> it(mCategoryColors); 412 QDictIterator<QColor> it(mCategoryColors);
413 while (it.current()) { 413 while (it.current()) {
414 config()->writeEntry(it.currentKey(),*(it.current())); 414 config()->writeEntry(it.currentKey(),*(it.current()));
415 ++it; 415 ++it;
416 } 416 }
417 417
418 418
419 KPimPrefs::usrWriteConfig(); 419 KPimPrefs::usrWriteConfig();
420} 420}
421 421
422void KOPrefs::setCategoryColor(QString cat,const QColor & color) 422void KOPrefs::setCategoryColor(QString cat,const QColor & color)
423{ 423{
424 mCategoryColors.replace(cat,new QColor(color)); 424 mCategoryColors.replace(cat,new QColor(color));
425} 425}
426 426
427QColor *KOPrefs::categoryColor(QString cat) 427QColor *KOPrefs::categoryColor(QString cat)
428{ 428{
429 QColor *color = 0; 429 QColor *color = 0;
430 430
431 if (!cat.isEmpty()) color = mCategoryColors[cat]; 431 if (!cat.isEmpty()) color = mCategoryColors[cat];
432 432
433 if (color) return color; 433 if (color) return color;
434 else return &mDefaultCategoryColor; 434 else return &mDefaultCategoryColor;
435} 435}
436 436
437void KOPrefs::setFullName(const QString &name) 437void KOPrefs::setFullName(const QString &name)
438{ 438{
439 mName = name; 439 mName = name;
440} 440}
441 441
442void KOPrefs::setEmail(const QString &email) 442void KOPrefs::setEmail(const QString &email)
443{ 443{
444 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 444 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
445 mEmail = email; 445 mEmail = email;
446} 446}
447 447
448QString KOPrefs::fullName() 448QString KOPrefs::fullName()
449{ 449{
450 if (mEmailControlCenter) { 450 if (mEmailControlCenter) {
451 KEMailSettings settings; 451 KEMailSettings settings;
452 return settings.getSetting(KEMailSettings::RealName); 452 return settings.getSetting(KEMailSettings::RealName);
453 } else { 453 } else {
454 return mName; 454 return mName;
455 } 455 }
456} 456}
457 457
458QString KOPrefs::email() 458QString KOPrefs::email()
459{ 459{
460 if (mEmailControlCenter) { 460 if (mEmailControlCenter) {
461 KEMailSettings settings; 461 KEMailSettings settings;
462 return settings.getSetting(KEMailSettings::EmailAddress); 462 return settings.getSetting(KEMailSettings::EmailAddress);
463 } else { 463 } else {
464 return mEmail; 464 return mEmail;
465 } 465 }
466} 466}
467KConfig* KOPrefs::getConfig() 467KConfig* KOPrefs::getConfig()
468{ 468{
469 return config(); 469 return config();
470} 470}