summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index f1f1442..138028d 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -160,462 +160,464 @@ KOPrefs::KOPrefs() :
160 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 160 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
161 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 161 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
162 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 162 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
163 163
164 164
165 KPrefs::setCurrentGroup("Calendar"); 165 KPrefs::setCurrentGroup("Calendar");
166 166
167 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 167 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
168 168
169 KPrefs::setCurrentGroup("Fonts"); 169 KPrefs::setCurrentGroup("Fonts");
170 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 170 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
171 QFont fon = KGlobalSettings::generalFont(); 171 QFont fon = KGlobalSettings::generalFont();
172 addItemFont("TimeBar Font",&mTimeBarFont,fon ); 172 addItemFont("TimeBar Font",&mTimeBarFont,fon );
173 addItemFont("MonthView Font",&mMonthViewFont,fon); 173 addItemFont("MonthView Font",&mMonthViewFont,fon);
174 addItemFont("AgendaView Font",&mAgendaViewFont,fon); 174 addItemFont("AgendaView Font",&mAgendaViewFont,fon);
175 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); 175 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon);
176 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); 176 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon);
177 addItemFont("TodoView Font",&mTodoViewFont,fon); 177 addItemFont("TodoView Font",&mTodoViewFont,fon);
178 addItemFont("ListView Font",&mListViewFont,fon); 178 addItemFont("ListView Font",&mListViewFont,fon);
179 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); 179 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon);
180 addItemFont("EditBox Font",&mEditBoxFont,fon); 180 addItemFont("EditBox Font",&mEditBoxFont,fon);
181 addItemFont("JournalView Font",&mJornalViewFont,fon); 181 addItemFont("JournalView Font",&mJornalViewFont,fon);
182 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); 182 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon);
183 addItemFont("EventView Font",&mEventViewFont,fon); 183 addItemFont("EventView Font",&mEventViewFont,fon);
184 184
185 KPrefs::setCurrentGroup("RemoteSyncing"); 185 KPrefs::setCurrentGroup("RemoteSyncing");
186 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 186 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
187 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 187 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
188 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 188 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
189 addItemInt("LastSyncTime",&mLastSyncTime,0); 189 addItemInt("LastSyncTime",&mLastSyncTime,0);
190 190
191#ifdef _WIN32_ 191#ifdef _WIN32_
192 QString hdp= locateLocal("data","korganizer")+"\\\\"; 192 QString hdp= locateLocal("data","korganizer")+"\\\\";
193#else 193#else
194 QString hdp= locateLocal("data","korganizer")+"/"; 194 QString hdp= locateLocal("data","korganizer")+"/";
195#endif 195#endif
196 196
197 KPrefs::setCurrentGroup("LoadSaveFileNames"); 197 KPrefs::setCurrentGroup("LoadSaveFileNames");
198 198
199 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 199 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
200 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 200 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
201 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 201 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
202 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 202 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
203 203
204 204
205 KPrefs::setCurrentGroup("Locale"); 205 KPrefs::setCurrentGroup("Locale");
206 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 206 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
207 207
208 208
209 KPrefs::setCurrentGroup("Colors"); 209 KPrefs::setCurrentGroup("Colors");
210 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 210 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
211 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 211 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
212 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 212 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
213 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 213 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
214 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 214 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
215 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 215 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
216 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 216 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
217 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 217 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
218 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); 218 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
219 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 219 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
220 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 220 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
221 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 221 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
222 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 222 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
223 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 223 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
224 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 224 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
225 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 225 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
226 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 226 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
227 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 227 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
228 addItemBool("UseAppColors",&mUseAppColors,false); 228 addItemBool("UseAppColors",&mUseAppColors,false);
229 229
230 230
231 231
232 KPrefs::setCurrentGroup("Views"); 232 KPrefs::setCurrentGroup("Views");
233 addItemBool("Block Popup Menu",&mBlockPopupMenu,false); 233 addItemBool("Block Popup Menu",&mBlockPopupMenu,false);
234 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 234 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
235 addItemInt("Hour Size",&mHourSize,8); 235 addItemInt("Hour Size",&mHourSize,8);
236 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 236 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
237 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 237 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
238 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 238 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
239 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 239 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
240 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 240 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
241 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 241 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
242 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); 242 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
243#ifdef DESKTOP_VERION 243#ifdef DESKTOP_VERION
244 addItemBool("Enable ToolTips",&mEnableToolTips,true); 244 addItemBool("Enable ToolTips",&mEnableToolTips,true);
245#else 245#else
246 addItemBool("Enable ToolTips",&mEnableToolTips,false); 246 addItemBool("Enable ToolTips",&mEnableToolTips,false);
247#endif 247#endif
248 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 248 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
249 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 249 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
250 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 250 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
251 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 251 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
252 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 252 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
253 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 253 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
254 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 254 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
255 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 255 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
256 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 256 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
257 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 257 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
258 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 258 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
259 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 259 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
260 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 260 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
261 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 261 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
262 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 262 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
263 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 263 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
264 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 264 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
265 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 265 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
266 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 266 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
267 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 267 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
268#ifdef DESKTOP_VERSION 268#ifdef DESKTOP_VERSION
269 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 269 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
270#else 270#else
271 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 271 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
272#endif 272#endif
273 addItemInt("Day Begins",&mDayBegins,7); 273 addItemInt("Day Begins",&mDayBegins,7);
274 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 274 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
275 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 275 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
276 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 276 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
277 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 277 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
278 278
279 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 279 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
280 addItemBool("Full View Month",&mFullViewMonth,true); 280 addItemBool("Full View Month",&mFullViewMonth,true);
281 addItemBool("Full View Todo",&mFullViewTodo,true); 281 addItemBool("Full View Todo",&mFullViewTodo,true);
282 addItemBool("Quick Todo",&mEnableQuickTodo,false); 282 addItemBool("Quick Todo",&mEnableQuickTodo,false);
283 283
284 addItemInt("Next X Days",&mNextXDays,3); 284 addItemInt("Next X Days",&mNextXDays,3);
285 285
286 KPrefs::setCurrentGroup("Printer"); 286 KPrefs::setCurrentGroup("Printer");
287 287
288 KPrefs::setCurrentGroup("Layout"); 288 KPrefs::setCurrentGroup("Layout");
289 289
290 addItemBool("CompactDialogs",&mCompactDialogs,false); 290 addItemBool("CompactDialogs",&mCompactDialogs,false);
291 addItemBool("VerticalScreen",&mVerticalScreen,true); 291 addItemBool("VerticalScreen",&mVerticalScreen,true);
292 292
293 KPrefs::setCurrentGroup("KOrganizer Plugins"); 293 KPrefs::setCurrentGroup("KOrganizer Plugins");
294 294
295 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 295 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
296 296
297 KPrefs::setCurrentGroup("Group Scheduling"); 297 KPrefs::setCurrentGroup("Group Scheduling");
298 298
299 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 299 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
300 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 300 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
301 addItemStringList("AdditionalMails",&mAdditionalMails,""); 301 addItemStringList("AdditionalMails",&mAdditionalMails,"");
302 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 302 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
303 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 303 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
304 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 304 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
305 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 305 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
306 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 306 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
307 307
308 KPrefs::setCurrentGroup( "Editors" ); 308 KPrefs::setCurrentGroup( "Editors" );
309 309
310 addItemStringList( "EventTemplates", &mEventTemplates ); 310 addItemStringList( "EventTemplates", &mEventTemplates );
311 addItemStringList( "TodoTemplates", &mTodoTemplates ); 311 addItemStringList( "TodoTemplates", &mTodoTemplates );
312 312
313 addItemInt("DestinationPolicy",&mDestination,standardDestination); 313 addItemInt("DestinationPolicy",&mDestination,standardDestination);
314 314
315 KPrefs::setCurrentGroup( "ViewOptions" ); 315 KPrefs::setCurrentGroup( "ViewOptions" );
316 addItemBool("EVshowDetails",&mEVshowDetails,true); 316 addItemBool("EVshowDetails",&mEVshowDetails,true);
317 addItemBool("EVshowCreated",&mEVshowCreated,true); 317 addItemBool("EVshowCreated",&mEVshowCreated,true);
318 addItemBool("EVshowChanged",&mEVshowChanged,true); 318 addItemBool("EVshowChanged",&mEVshowChanged,true);
319 addItemBool("WTshowDetails",&mWTshowDetails,false); 319 addItemBool("WTshowDetails",&mWTshowDetails,false);
320 addItemBool("WTshowCreated",&mWTshowCreated,false); 320 addItemBool("WTshowCreated",&mWTshowCreated,false);
321 addItemBool("WTshowChanged",&mWTshowChanged,false); 321 addItemBool("WTshowChanged",&mWTshowChanged,false);
322 mCalendars.setAutoDelete( true ); 322 mCalendars.setAutoDelete( true );
323} 323}
324 324
325 325
326KOPrefs::~KOPrefs() 326KOPrefs::~KOPrefs()
327{ 327{
328 if (mInstance == this) 328 if (mInstance == this)
329 mInstance = insd.setObject(0); 329 mInstance = insd.setObject(0);
330 mCalendars.setAutoDelete( true ); 330 mCalendars.setAutoDelete( true );
331 mCalendars.clear(); 331 mCalendars.clear();
332 //qDebug("KOPrefs::~KOPrefs() "); 332 //qDebug("KOPrefs::~KOPrefs() ");
333} 333}
334 334
335 335
336KOPrefs *KOPrefs::instance() 336KOPrefs *KOPrefs::instance()
337{ 337{
338 if (!mInstance) { 338 if (!mInstance) {
339 mInstance = insd.setObject(new KOPrefs()); 339 mInstance = insd.setObject(new KOPrefs());
340 mInstance->readConfig(); 340 mInstance->readConfig();
341 } 341 }
342 342
343 return mInstance; 343 return mInstance;
344} 344}
345 345
346void KOPrefs::usrSetDefaults() 346void KOPrefs::usrSetDefaults()
347{ 347{
348 348
349} 349}
350 350
351void KOPrefs::fillMailDefaults() 351void KOPrefs::fillMailDefaults()
352{ 352{
353 if (mName.isEmpty()) mName = i18n("Anonymous"); 353 if (mName.isEmpty()) mName = i18n("Anonymous");
354 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 354 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
355} 355}
356 356
357void KOPrefs::setTimeZoneIdDefault() 357void KOPrefs::setTimeZoneIdDefault()
358{ 358{
359 ; 359 ;
360} 360}
361 361
362void KOPrefs::setAllDefaults() 362void KOPrefs::setAllDefaults()
363{ 363{
364 setCategoryDefaults(); 364 setCategoryDefaults();
365 mEventSummaryUser = getDefaultList() ; 365 mEventSummaryUser = getDefaultList() ;
366 mTodoSummaryUser = getDefaultList() ; 366 mTodoSummaryUser = getDefaultList() ;
367 mJournalSummaryUser = getDefaultList() ; 367 mJournalSummaryUser = getDefaultList() ;
368 mLocationDefaults = getLocationDefaultList(); 368 mLocationDefaults = getLocationDefaultList();
369} 369}
370 370
371void KOPrefs::setCategoryDefaults() 371void KOPrefs::setCategoryDefaults()
372{ 372{
373 mCustomCategories.clear(); 373 mCustomCategories.clear();
374 mCustomCategories = getDefaultList(); 374 mCustomCategories = getDefaultList();
375 375
376 QStringList::Iterator it; 376 QStringList::Iterator it;
377 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 377 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
378 setCategoryColor(*it,mDefaultCategoryColor); 378 setCategoryColor(*it,mDefaultCategoryColor);
379 } 379 }
380} 380}
381QStringList KOPrefs::getLocationDefaultList() 381QStringList KOPrefs::getLocationDefaultList()
382{ 382{
383 QStringList retval ; 383 QStringList retval ;
384 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 384 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
385 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 385 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
386 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 386 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
387 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 387 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
388 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 388 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
389 389
390 retval.sort(); 390 retval.sort();
391 return retval; 391 return retval;
392} 392}
393QStringList KOPrefs::getDefaultList() 393QStringList KOPrefs::getDefaultList()
394{ 394{
395 QStringList retval ; 395 QStringList retval ;
396 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") 396 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer")
397 << i18n("Break") 397 << i18n("Break")
398 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") 398 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts")
399 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") 399 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts")
400 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") 400 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal")
401 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") 401 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping")
402 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") 402 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
403 << i18n("Vacation") ; 403 << i18n("Vacation") ;
404 retval.sort(); 404 retval.sort();
405 //qDebug("cat %s ", retval.join("-").latin1()); 405 //qDebug("cat %s ", retval.join("-").latin1());
406 return retval; 406 return retval;
407} 407}
408// << 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") 408// << 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")
409void KOPrefs::usrReadConfig() 409void KOPrefs::usrReadConfig()
410{ 410{
411 config()->setGroup("General"); 411 config()->setGroup("General");
412 412
413 //qDebug("KOPrefs::usrReadConfig() "); 413 //qDebug("KOPrefs::usrReadConfig() ");
414 mCustomCategories = config()->readListEntry("Custom Categories"); 414 mCustomCategories = config()->readListEntry("Custom Categories");
415 mOldLoadedLanguage = mOldLanguage ; 415 mOldLoadedLanguage = mOldLanguage ;
416 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 416 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
417 if (mLocationDefaults.isEmpty()) { 417 if (mLocationDefaults.isEmpty()) {
418 mLocationDefaults = getLocationDefaultList(); 418 mLocationDefaults = getLocationDefaultList();
419 } 419 }
420 420
421 if (mEventSummaryUser.isEmpty()) { 421 if (mEventSummaryUser.isEmpty()) {
422 mEventSummaryUser = getDefaultList() ; 422 mEventSummaryUser = getDefaultList() ;
423 } 423 }
424 if (mTodoSummaryUser.isEmpty()) { 424 if (mTodoSummaryUser.isEmpty()) {
425 mTodoSummaryUser = getDefaultList() ; 425 mTodoSummaryUser = getDefaultList() ;
426 } 426 }
427 427
428 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 428 if (mCustomCategories.isEmpty()) setCategoryDefaults();
429 429
430 config()->setGroup("Personal Settings"); 430 config()->setGroup("Personal Settings");
431 mName = config()->readEntry("user_name",""); 431 mName = config()->readEntry("user_name","");
432 mEmail = config()->readEntry("user_email",""); 432 mEmail = config()->readEntry("user_email","");
433 fillMailDefaults(); 433 fillMailDefaults();
434 434
435 config()->setGroup("Category Colors"); 435 config()->setGroup("Category Colors");
436 QStringList::Iterator it; 436 QStringList::Iterator it;
437 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 437 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
438 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 438 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
439 439
440 } 440 }
441 KConfig fc (locateLocal("config","kopicalendarrc")); 441 KConfig fc (locateLocal("config","kopicalendarrc"));
442 fc.setGroup("CC"); 442 fc.setGroup("CC");
443 int numCals = fc.readNumEntry("NumberCalendars",0 ); 443 int numCals = fc.readNumEntry("NumberCalendars",0 );
444 mNextAvailableCalendar = 1; 444 mNextAvailableCalendar = 1;
445 if ( numCals == 0 ) { 445 if ( numCals == 0 ) {
446 KopiCalendarFile *kkf = getNewCalendar(); 446 KopiCalendarFile *kkf = getNewCalendar();
447 kkf->isStandard = true; 447 kkf->isStandard = true;
448 kkf->mName = i18n("Standard"); 448 kkf->mName = i18n("Standard");
449 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 449 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
450 } 450 }
451 while ( mNextAvailableCalendar <= numCals ) { 451 while ( mNextAvailableCalendar <= numCals ) {
452 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 452 //qDebug("Read cal #%d ", mNextAvailableCalendar );
453 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 453 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
454 KopiCalendarFile *kkf = getNewCalendar(); 454 KopiCalendarFile *kkf = getNewCalendar();
455 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 455 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
456 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 456 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
457 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); 457 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false );
458 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); 458 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
459 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); 459 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
460 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); 460 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
461 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); 461 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName);
462 kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); 462 kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName);
463 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); 463 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
464 if ( kkf->mCalNumber == 1 ) { 464 if ( kkf->mCalNumber == 1 ) {
465 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 465 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
466 } 466 }
467 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); 467 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
468 if ( kkf->mName == i18n("Birthdays") ) { 468 if ( kkf->mName == i18n("Birthdays") ) {
469 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); 469 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
470 } 470 }
471 if ( kkf->isRelative ) 471 if ( kkf->isRelative )
472 kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; 472 kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName;
473 } 473 }
474 474
475 KPimPrefs::usrReadConfig(); 475 KPimPrefs::usrReadConfig();
476} 476}
477 477
478KopiCalendarFile * KOPrefs::getCalendar( int num ) 478KopiCalendarFile * KOPrefs::getCalendar( int num )
479{ 479{
480 return mDefCalColors[num-1]; 480 return mDefCalColors[num-1];
481} 481}
482 482
483KopiCalendarFile * KOPrefs::getNewCalendar() 483KopiCalendarFile * KOPrefs::getNewCalendar()
484{ 484{
485 KopiCalendarFile * kkf = new KopiCalendarFile(); 485 KopiCalendarFile * kkf = new KopiCalendarFile();
486 kkf->mCalNumber = mNextAvailableCalendar; 486 kkf->mCalNumber = mNextAvailableCalendar;
487 mDefCalColors.resize( mNextAvailableCalendar ); 487 mDefCalColors.resize( mNextAvailableCalendar );
488 mDefCalColors[mNextAvailableCalendar-1] = kkf; 488 mDefCalColors[mNextAvailableCalendar-1] = kkf;
489 ++mNextAvailableCalendar; 489 ++mNextAvailableCalendar;
490 kkf->mDefaultColor = mEventColor; 490 kkf->mDefaultColor = mEventColor;
491 kkf->mName = i18n("New Calendar"); 491 kkf->mName = i18n("New Calendar");
492 mCalendars.append( kkf ); 492 mCalendars.append( kkf );
493 return kkf; 493 return kkf;
494} 494}
495void KOPrefs::deleteCalendar( int num ) 495void KOPrefs::deleteCalendar( int num )
496{ 496{
497 KopiCalendarFile * kkf = mCalendars.first(); 497 KopiCalendarFile * kkf = mCalendars.first();
498 while ( kkf ) { 498 while ( kkf ) {
499 if ( kkf->mCalNumber == num ) { 499 if ( kkf->mCalNumber == num ) {
500 qDebug("KOPrefs::deleteCalendar %d ", num ); 500 qDebug("KOPrefs::deleteCalendar %d ", num );
501 mCalendars.remove( kkf ); 501 mCalendars.remove( kkf );
502 delete kkf; 502 delete kkf;
503 return; 503 return;
504 } 504 }
505 kkf = mCalendars.next(); 505 kkf = mCalendars.next();
506 } 506 }
507} 507}
508int KOPrefs::getCalendarID( const QString & name ) 508int KOPrefs::getCalendarID( const QString & name )
509{ 509{
510 KopiCalendarFile * kkf = mCalendars.first(); 510 KopiCalendarFile * kkf = mCalendars.first();
511 while ( kkf ) { 511 while ( kkf ) {
512 if ( name == kkf->mName) 512 if ( name == kkf->mName)
513 return kkf->mCalNumber; 513 return kkf->mCalNumber;
514 kkf = mCalendars.next(); 514 kkf = mCalendars.next();
515 } 515 }
516 return 1; 516 return 1;
517} 517}
518QString KOPrefs::calName( int calNum) const 518QString KOPrefs::calName( int calNum) const
519{ 519{
520 return (mDefCalColors[calNum-1])->mName; 520 return (mDefCalColors[calNum-1])->mName;
521} 521}
522QColor KOPrefs::defaultColor( int calNum ) const 522QColor KOPrefs::defaultColor( int calNum ) const
523{ 523{
524 if ( calNum == 1 ) return mEventColor; 524 if ( calNum == 1 ) return mEventColor;
525 return (mDefCalColors[calNum-1])->mDefaultColor; 525 return (mDefCalColors[calNum-1])->mDefaultColor;
526} 526}
527void KOPrefs::usrWriteConfig() 527void KOPrefs::usrWriteConfig()
528{ 528{
529 config()->setGroup("General"); 529 config()->setGroup("General");
530 config()->writeEntry("Custom Categories",mCustomCategories); 530 config()->writeEntry("Custom Categories",mCustomCategories);
531 531
532 config()->setGroup("Personal Settings"); 532 config()->setGroup("Personal Settings");
533 config()->writeEntry("user_name",mName); 533 config()->writeEntry("user_name",mName);
534 config()->writeEntry("user_email",mEmail); 534 config()->writeEntry("user_email",mEmail);
535 535
536 config()->setGroup("Category Colors"); 536 config()->setGroup("Category Colors");
537 QDictIterator<QColor> it(mCategoryColors); 537 QDictIterator<QColor> it(mCategoryColors);
538 while (it.current()) { 538 while (it.current()) {
539 config()->writeEntry(it.currentKey(),*(it.current())); 539 config()->writeEntry(it.currentKey(),*(it.current()));
540 ++it; 540 ++it;
541 } 541 }
542 KConfig fc (locateLocal("config","kopicalendarrc")); 542 KConfig fc (locateLocal("config","kopicalendarrc"));
543 fc.setGroup("CC"); 543 fc.setGroup("CC");
544 fc.deleteGroup( "CC");
545 fc.setGroup("CC");
544 fc.writeEntry("NumberCalendars",mCalendars.count()); 546 fc.writeEntry("NumberCalendars",mCalendars.count());
545 int numCal = 1; 547 int numCal = 1;
546 int writeCal = 0; 548 int writeCal = 0;
547 while ( numCal < mNextAvailableCalendar ) { 549 while ( numCal < mNextAvailableCalendar ) {
548 KopiCalendarFile * kkf = mCalendars.first(); 550 KopiCalendarFile * kkf = mCalendars.first();
549 while ( kkf ) { 551 while ( kkf ) {
550 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); 552 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
551 if ( kkf->mCalNumber == numCal ) { 553 if ( kkf->mCalNumber == numCal ) {
552 ++writeCal; 554 ++writeCal;
553 //qDebug("Write calendar %d %d ", numCal , writeCal); 555 //qDebug("Write calendar %d %d ", numCal , writeCal);
554 QString prefix = "Cal_" + QString::number( writeCal ); 556 QString prefix = "Cal_" + QString::number( writeCal );
555 fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); 557 fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
556 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); 558 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
557 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); 559 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
558 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); 560 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
559 fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); 561 fc.writeEntry( prefix+"_isRelative", kkf->isRelative );
560 fc.writeEntry( prefix+"_Name", kkf->mName); 562 fc.writeEntry( prefix+"_Name", kkf->mName);
561 fc.writeEntry( prefix+"_FileName", kkf->mFileName); 563 fc.writeEntry( prefix+"_FileName", kkf->mFileName);
562 fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); 564 fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName);
563 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); 565 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor);
564 } 566 }
565 kkf = mCalendars.next(); 567 kkf = mCalendars.next();
566 } 568 }
567 ++numCal; 569 ++numCal;
568 } 570 }
569 fc.sync(); 571 fc.sync();
570 KPimPrefs::usrWriteConfig(); 572 KPimPrefs::usrWriteConfig();
571} 573}
572 574
573void KOPrefs::setCategoryColor(QString cat,const QColor & color) 575void KOPrefs::setCategoryColor(QString cat,const QColor & color)
574{ 576{
575 mCategoryColors.replace(cat,new QColor(color)); 577 mCategoryColors.replace(cat,new QColor(color));
576} 578}
577 579
578QColor *KOPrefs::categoryColor(QString cat) 580QColor *KOPrefs::categoryColor(QString cat)
579{ 581{
580 QColor *color = 0; 582 QColor *color = 0;
581 583
582 if (!cat.isEmpty()) color = mCategoryColors[cat]; 584 if (!cat.isEmpty()) color = mCategoryColors[cat];
583 585
584 if (color) return color; 586 if (color) return color;
585 else return &mDefaultCategoryColor; 587 else return &mDefaultCategoryColor;
586} 588}
587 589
588void KOPrefs::setFullName(const QString &name) 590void KOPrefs::setFullName(const QString &name)
589{ 591{
590 mName = name; 592 mName = name;
591} 593}
592 594
593void KOPrefs::setEmail(const QString &email) 595void KOPrefs::setEmail(const QString &email)
594{ 596{
595 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 597 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
596 mEmail = email; 598 mEmail = email;
597} 599}
598 600
599QString KOPrefs::fullName() 601QString KOPrefs::fullName()
600{ 602{
601 if (mEmailControlCenter) { 603 if (mEmailControlCenter) {
602 KEMailSettings settings; 604 KEMailSettings settings;
603 return settings.getSetting(KEMailSettings::RealName); 605 return settings.getSetting(KEMailSettings::RealName);
604 } else { 606 } else {
605 return mName; 607 return mName;
606 } 608 }
607} 609}
608 610
609QString KOPrefs::email() 611QString KOPrefs::email()
610{ 612{
611 if (mEmailControlCenter) { 613 if (mEmailControlCenter) {
612 KEMailSettings settings; 614 KEMailSettings settings;
613 return settings.getSetting(KEMailSettings::EmailAddress); 615 return settings.getSetting(KEMailSettings::EmailAddress);
614 } else { 616 } else {
615 return mEmail; 617 return mEmail;
616 } 618 }
617} 619}
618KConfig* KOPrefs::getConfig() 620KConfig* KOPrefs::getConfig()
619{ 621{
620 return config(); 622 return config();
621} 623}