-rw-r--r-- | korganizer/koprefs.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 258f738..ba1c6d1 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -98,108 +98,100 @@ KOPrefs::KOPrefs() : | |||
98 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); | 98 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); |
99 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 99 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
100 | addItemBool("ShowIconNext",&mShowIconNext,true); | 100 | addItemBool("ShowIconNext",&mShowIconNext,true); |
101 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 101 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
102 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 102 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
103 | addItemBool("LanguageChanged",&mLanguageChanged,false); | 103 | addItemBool("LanguageChanged",&mLanguageChanged,false); |
104 | 104 | ||
105 | addItemBool("AskForQuit",&mAskForQuit,false); | 105 | addItemBool("AskForQuit",&mAskForQuit,false); |
106 | 106 | ||
107 | #ifndef DESKTOP_VERSION | 107 | #ifndef DESKTOP_VERSION |
108 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 108 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
109 | #else | 109 | #else |
110 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 110 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
111 | #endif | 111 | #endif |
112 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 112 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
113 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 113 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
114 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 114 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
115 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 115 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
116 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 116 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
117 | 117 | ||
118 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 118 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
119 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 119 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
120 | addItemInt("AllDay Size",&mAllDaySize,28); | 120 | addItemInt("AllDay Size",&mAllDaySize,28); |
121 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 121 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
122 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 122 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
123 | 123 | ||
124 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 124 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
125 | addItemStringList("EventSummary User",&mEventSummaryUser); | 125 | addItemStringList("EventSummary User",&mEventSummaryUser); |
126 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 126 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
127 | 127 | ||
128 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 128 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
129 | addItemBool("Enable Project View",&mEnableProjectView,false); | 129 | addItemBool("Enable Project View",&mEnableProjectView,false); |
130 | addItemBool("Auto Save",&mAutoSave,false); | 130 | addItemBool("Auto Save",&mAutoSave,false); |
131 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 131 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
132 | addItemBool("Confirm Deletes",&mConfirm,true); | 132 | addItemBool("Confirm Deletes",&mConfirm,true); |
133 | addItemString("Archive File",&mArchiveFile); | 133 | addItemString("Archive File",&mArchiveFile); |
134 | addItemString("Html Export File",&mHtmlExportFile, | 134 | addItemString("Html Export File",&mHtmlExportFile, |
135 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 135 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
136 | addItemBool("Html With Save",&mHtmlWithSave,false); | 136 | addItemBool("Html With Save",&mHtmlWithSave,false); |
137 | 137 | ||
138 | KPrefs::setCurrentGroup("Personal Settings"); | 138 | KPrefs::setCurrentGroup("Personal Settings"); |
139 | 139 | ||
140 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 140 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
141 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 141 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
142 | addItemBool("Bcc",&mBcc,false); | 142 | addItemBool("Bcc",&mBcc,false); |
143 | 143 | ||
144 | KPrefs::setCurrentGroup("Time & Date"); | 144 | KPrefs::setCurrentGroup("Time & Date"); |
145 | 145 | ||
146 | // addItemString("Time Zone",&mTimeZone,"+0100"); | ||
147 | addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); | ||
148 | // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60); | ||
149 | addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); | ||
150 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); | ||
151 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); | ||
152 | |||
153 | 146 | ||
154 | addItemInt("Default Start Time",&mStartTime,10); | 147 | addItemInt("Default Start Time",&mStartTime,10); |
155 | addItemInt("Default Duration",&mDefaultDuration,2); | 148 | addItemInt("Default Duration",&mDefaultDuration,2); |
156 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 149 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
157 | addItemInt("Daylight Savings",&mDaylightSavings,0); | ||
158 | KPrefs::setCurrentGroup("AlarmSettings"); | 150 | KPrefs::setCurrentGroup("AlarmSettings"); |
159 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 151 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
160 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 152 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
161 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 153 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
162 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 154 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
163 | 155 | ||
164 | 156 | ||
165 | KPrefs::setCurrentGroup("Calendar"); | 157 | KPrefs::setCurrentGroup("Calendar"); |
166 | 158 | ||
167 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 159 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
168 | 160 | ||
169 | KPrefs::setCurrentGroup("Fonts"); | 161 | KPrefs::setCurrentGroup("Fonts"); |
170 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 162 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
171 | addItemFont("TimeBar Font",&mTimeBarFont); | 163 | addItemFont("TimeBar Font",&mTimeBarFont); |
172 | addItemFont("MonthView Font",&mMonthViewFont); | 164 | addItemFont("MonthView Font",&mMonthViewFont); |
173 | addItemFont("AgendaView Font",&mAgendaViewFont); | 165 | addItemFont("AgendaView Font",&mAgendaViewFont); |
174 | addItemFont("MarcusBains Font",&mMarcusBainsFont); | 166 | addItemFont("MarcusBains Font",&mMarcusBainsFont); |
175 | addItemFont("TimeLabels Font",&mTimeLabelsFont); | 167 | addItemFont("TimeLabels Font",&mTimeLabelsFont); |
176 | addItemFont("TodoView Font",&mTodoViewFont); | 168 | addItemFont("TodoView Font",&mTodoViewFont); |
177 | addItemFont("ListView Font",&mListViewFont); | 169 | addItemFont("ListView Font",&mListViewFont); |
178 | addItemFont("DateNavigator Font",&mDateNavigatorFont); | 170 | addItemFont("DateNavigator Font",&mDateNavigatorFont); |
179 | addItemFont("EditBox Font",&mEditBoxFont); | 171 | addItemFont("EditBox Font",&mEditBoxFont); |
180 | addItemFont("JournalView Font",&mJornalViewFont); | 172 | addItemFont("JournalView Font",&mJornalViewFont); |
181 | addItemFont("WhatsNextView Font",&mWhatsNextFont); | 173 | addItemFont("WhatsNextView Font",&mWhatsNextFont); |
182 | addItemFont("EventView Font",&mEventViewFont); | 174 | addItemFont("EventView Font",&mEventViewFont); |
183 | 175 | ||
184 | // KPrefs::setCurrentGroup("SyncProfiles"); | 176 | // KPrefs::setCurrentGroup("SyncProfiles"); |
185 | // addItemString("LocalMachineName",&mLocalMachineName, "undefined"); | 177 | // addItemString("LocalMachineName",&mLocalMachineName, "undefined"); |
186 | // addItemStringList("SyncProfileNames",&mSyncProfileNames); | 178 | // addItemStringList("SyncProfileNames",&mSyncProfileNames); |
187 | // addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); | 179 | // addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); |
188 | 180 | ||
189 | KPrefs::setCurrentGroup("RemoteSyncing"); | 181 | KPrefs::setCurrentGroup("RemoteSyncing"); |
190 | // addItemBool("UsePasswd",&mUsePassWd,false); | 182 | // addItemBool("UsePasswd",&mUsePassWd,false); |
191 | // addItemBool("WriteBackFile",&mWriteBackFile,true); | 183 | // addItemBool("WriteBackFile",&mWriteBackFile,true); |
192 | // addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); | 184 | // addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); |
193 | // addItemBool("AskForPreferences",&mAskForPreferences,true); | 185 | // addItemBool("AskForPreferences",&mAskForPreferences,true); |
194 | // addItemBool("ShowSyncSummary",&mShowSyncSummary,true); | 186 | // addItemBool("ShowSyncSummary",&mShowSyncSummary,true); |
195 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 187 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
196 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 188 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
197 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 189 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
198 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 190 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
199 | 191 | ||
200 | #ifdef _WIN32_ | 192 | #ifdef _WIN32_ |
201 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 193 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
202 | #else | 194 | #else |
203 | QString hdp= locateLocal("data","korganizer")+"/"; | 195 | QString hdp= locateLocal("data","korganizer")+"/"; |
204 | #endif | 196 | #endif |
205 | 197 | ||
@@ -309,97 +301,97 @@ KOPrefs::KOPrefs() : | |||
309 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 301 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
310 | 302 | ||
311 | KPrefs::setCurrentGroup( "Editors" ); | 303 | KPrefs::setCurrentGroup( "Editors" ); |
312 | 304 | ||
313 | addItemStringList( "EventTemplates", &mEventTemplates ); | 305 | addItemStringList( "EventTemplates", &mEventTemplates ); |
314 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 306 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
315 | 307 | ||
316 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 308 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
317 | 309 | ||
318 | 310 | ||
319 | 311 | ||
320 | } | 312 | } |
321 | 313 | ||
322 | 314 | ||
323 | KOPrefs::~KOPrefs() | 315 | KOPrefs::~KOPrefs() |
324 | { | 316 | { |
325 | if (mInstance == this) | 317 | if (mInstance == this) |
326 | mInstance = insd.setObject(0); | 318 | mInstance = insd.setObject(0); |
327 | setLocaleDict( 0 ); | 319 | setLocaleDict( 0 ); |
328 | if ( mLocaleDict ) | 320 | if ( mLocaleDict ) |
329 | delete mLocaleDict; | 321 | delete mLocaleDict; |
330 | //qDebug("KOPrefs::~KOPrefs() "); | 322 | //qDebug("KOPrefs::~KOPrefs() "); |
331 | } | 323 | } |
332 | 324 | ||
333 | 325 | ||
334 | KOPrefs *KOPrefs::instance() | 326 | KOPrefs *KOPrefs::instance() |
335 | { | 327 | { |
336 | if (!mInstance) { | 328 | if (!mInstance) { |
337 | mInstance = insd.setObject(new KOPrefs()); | 329 | mInstance = insd.setObject(new KOPrefs()); |
338 | mInstance->readConfig(); | 330 | mInstance->readConfig(); |
339 | } | 331 | } |
340 | 332 | ||
341 | return mInstance; | 333 | return mInstance; |
342 | } | 334 | } |
343 | 335 | ||
344 | void KOPrefs::usrSetDefaults() | 336 | void KOPrefs::usrSetDefaults() |
345 | { | 337 | { |
346 | 338 | ||
347 | } | 339 | } |
348 | 340 | ||
349 | void KOPrefs::fillMailDefaults() | 341 | void KOPrefs::fillMailDefaults() |
350 | { | 342 | { |
351 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 343 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
352 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 344 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
353 | } | 345 | } |
354 | 346 | ||
355 | void KOPrefs::setTimeZoneIdDefault() | 347 | void KOPrefs::setTimeZoneIdDefault() |
356 | { | 348 | { |
357 | mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)"); | 349 | ; |
358 | } | 350 | } |
359 | 351 | ||
360 | void KOPrefs::setCategoryDefaults() | 352 | void KOPrefs::setCategoryDefaults() |
361 | { | 353 | { |
362 | mCustomCategories.clear(); | 354 | mCustomCategories.clear(); |
363 | mCustomCategories = getDefaultList(); | 355 | mCustomCategories = getDefaultList(); |
364 | 356 | ||
365 | QStringList::Iterator it; | 357 | QStringList::Iterator it; |
366 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 358 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
367 | setCategoryColor(*it,mDefaultCategoryColor); | 359 | setCategoryColor(*it,mDefaultCategoryColor); |
368 | } | 360 | } |
369 | } | 361 | } |
370 | 362 | ||
371 | QStringList KOPrefs::getDefaultList() | 363 | QStringList KOPrefs::getDefaultList() |
372 | { | 364 | { |
373 | QStringList retval ; | 365 | QStringList retval ; |
374 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 366 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
375 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 367 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
376 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 368 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
377 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 369 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
378 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 370 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
379 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 371 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
380 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 372 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
381 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 373 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
382 | retval.sort(); | 374 | retval.sort(); |
383 | return retval; | 375 | return retval; |
384 | } | 376 | } |
385 | 377 | ||
386 | void KOPrefs::usrReadConfig() | 378 | void KOPrefs::usrReadConfig() |
387 | { | 379 | { |
388 | mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 380 | mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
389 | mLocaleDict = 0; | 381 | mLocaleDict = 0; |
390 | // pending LR fix translation | 382 | // pending LR fix translation |
391 | // qDebug("KOPrefs::usrReadConfig() fix translation "); | 383 | // qDebug("KOPrefs::usrReadConfig() fix translation "); |
392 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { | 384 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { |
393 | if ( mPreferredLanguage == 1 ) { | 385 | if ( mPreferredLanguage == 1 ) { |
394 | mLocaleDict = new QDict<QString>; | 386 | mLocaleDict = new QDict<QString>; |
395 | int i = 0; | 387 | int i = 0; |
396 | QString fw ( germanwords[i] [0]); | 388 | QString fw ( germanwords[i] [0]); |
397 | while ( !fw.isEmpty() ) { | 389 | while ( !fw.isEmpty() ) { |
398 | mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); | 390 | mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); |
399 | ++i; | 391 | ++i; |
400 | fw = germanwords[i] [0]; | 392 | fw = germanwords[i] [0]; |
401 | } | 393 | } |
402 | 394 | ||
403 | setLocaleDict( mLocaleDict ); | 395 | setLocaleDict( mLocaleDict ); |
404 | } else { | 396 | } else { |
405 | QString fileName ; | 397 | QString fileName ; |
@@ -442,100 +434,97 @@ void KOPrefs::usrReadConfig() | |||
442 | line = text.mid( br, nbr - br ); | 434 | line = text.mid( br, nbr - br ); |
443 | br = nbr+1; | 435 | br = nbr+1; |
444 | } | 436 | } |
445 | //qDebug("end *%s* ", end.latin1()); | 437 | //qDebug("end *%s* ", end.latin1()); |
446 | 438 | ||
447 | setLocaleDict( mLocaleDict ); | 439 | setLocaleDict( mLocaleDict ); |
448 | } else { | 440 | } else { |
449 | qDebug("KO: Cannot find translation file %s",fileName.latin1() ); | 441 | qDebug("KO: Cannot find translation file %s",fileName.latin1() ); |
450 | } | 442 | } |
451 | 443 | ||
452 | } | 444 | } |
453 | } | 445 | } |
454 | config()->setGroup("General"); | 446 | config()->setGroup("General"); |
455 | 447 | ||
456 | mCustomCategories = config()->readListEntry("Custom Categories"); | 448 | mCustomCategories = config()->readListEntry("Custom Categories"); |
457 | if ( KOPrefs::instance()->mLanguageChanged ) { | 449 | if ( KOPrefs::instance()->mLanguageChanged ) { |
458 | mLocationDefaults.clear(); | 450 | mLocationDefaults.clear(); |
459 | mEventSummaryUser.clear(); | 451 | mEventSummaryUser.clear(); |
460 | mTodoSummaryUser.clear(); | 452 | mTodoSummaryUser.clear(); |
461 | } | 453 | } |
462 | if (mLocationDefaults.isEmpty()) { | 454 | if (mLocationDefaults.isEmpty()) { |
463 | mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 455 | mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
464 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 456 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
465 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 457 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
466 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 458 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
467 | mLocationDefaults.sort(); | 459 | mLocationDefaults.sort(); |
468 | } | 460 | } |
469 | 461 | ||
470 | if (mEventSummaryUser.isEmpty()) { | 462 | if (mEventSummaryUser.isEmpty()) { |
471 | mEventSummaryUser = getDefaultList() ; | 463 | mEventSummaryUser = getDefaultList() ; |
472 | } | 464 | } |
473 | if (mTodoSummaryUser.isEmpty()) { | 465 | if (mTodoSummaryUser.isEmpty()) { |
474 | mTodoSummaryUser = getDefaultList() ; | 466 | mTodoSummaryUser = getDefaultList() ; |
475 | } | 467 | } |
476 | 468 | ||
477 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 469 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
478 | 470 | ||
479 | config()->setGroup("Personal Settings"); | 471 | config()->setGroup("Personal Settings"); |
480 | mName = config()->readEntry("user_name",""); | 472 | mName = config()->readEntry("user_name",""); |
481 | mEmail = config()->readEntry("user_email",""); | 473 | mEmail = config()->readEntry("user_email",""); |
482 | fillMailDefaults(); | 474 | fillMailDefaults(); |
483 | 475 | ||
484 | config()->setGroup("Category Colors"); | 476 | config()->setGroup("Category Colors"); |
485 | QStringList::Iterator it; | 477 | QStringList::Iterator it; |
486 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 478 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
487 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 479 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
488 | 480 | ||
489 | } | 481 | } |
490 | 482 | ||
491 | if (mTimeZoneId.isEmpty()) { | ||
492 | setTimeZoneIdDefault(); | ||
493 | } | ||
494 | KPimPrefs::usrReadConfig(); | 483 | KPimPrefs::usrReadConfig(); |
495 | } | 484 | } |
496 | 485 | ||
497 | 486 | ||
498 | void KOPrefs::usrWriteConfig() | 487 | void KOPrefs::usrWriteConfig() |
499 | { | 488 | { |
500 | config()->setGroup("General"); | 489 | config()->setGroup("General"); |
501 | config()->writeEntry("Custom Categories",mCustomCategories); | 490 | config()->writeEntry("Custom Categories",mCustomCategories); |
502 | 491 | ||
503 | config()->setGroup("Personal Settings"); | 492 | config()->setGroup("Personal Settings"); |
504 | config()->writeEntry("user_name",mName); | 493 | config()->writeEntry("user_name",mName); |
505 | config()->writeEntry("user_email",mEmail); | 494 | config()->writeEntry("user_email",mEmail); |
506 | 495 | ||
507 | config()->setGroup("Category Colors"); | 496 | config()->setGroup("Category Colors"); |
508 | QDictIterator<QColor> it(mCategoryColors); | 497 | QDictIterator<QColor> it(mCategoryColors); |
509 | while (it.current()) { | 498 | while (it.current()) { |
510 | config()->writeEntry(it.currentKey(),*(it.current())); | 499 | config()->writeEntry(it.currentKey(),*(it.current())); |
511 | ++it; | 500 | ++it; |
512 | } | 501 | } |
513 | 502 | ||
514 | 503 | ||
515 | KPimPrefs::usrWriteConfig(); | 504 | KPimPrefs::usrWriteConfig(); |
516 | } | 505 | } |
517 | 506 | ||
518 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 507 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
519 | { | 508 | { |
520 | mCategoryColors.replace(cat,new QColor(color)); | 509 | mCategoryColors.replace(cat,new QColor(color)); |
521 | } | 510 | } |
522 | 511 | ||
523 | QColor *KOPrefs::categoryColor(QString cat) | 512 | QColor *KOPrefs::categoryColor(QString cat) |
524 | { | 513 | { |
525 | QColor *color = 0; | 514 | QColor *color = 0; |
526 | 515 | ||
527 | if (!cat.isEmpty()) color = mCategoryColors[cat]; | 516 | if (!cat.isEmpty()) color = mCategoryColors[cat]; |
528 | 517 | ||
529 | if (color) return color; | 518 | if (color) return color; |
530 | else return &mDefaultCategoryColor; | 519 | else return &mDefaultCategoryColor; |
531 | } | 520 | } |
532 | 521 | ||
533 | void KOPrefs::setFullName(const QString &name) | 522 | void KOPrefs::setFullName(const QString &name) |
534 | { | 523 | { |
535 | mName = name; | 524 | mName = name; |
536 | } | 525 | } |
537 | 526 | ||
538 | void KOPrefs::setEmail(const QString &email) | 527 | void KOPrefs::setEmail(const QString &email) |
539 | { | 528 | { |
540 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); | 529 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); |
541 | mEmail = email; | 530 | mEmail = email; |