author | zautrix <zautrix> | 2004-10-08 15:50:30 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 15:50:30 (UTC) |
commit | 13bd085e06b76228321f5a004759fcdf19cca711 (patch) (unidiff) | |
tree | 66edb5db035dc88a13ff1ec9b840c549a7e81104 /korganizer | |
parent | d46e6bd77c336ce98bafe884a3f7ee5b0d884f1f (diff) | |
download | kdepimpi-13bd085e06b76228321f5a004759fcdf19cca711.zip kdepimpi-13bd085e06b76228321f5a004759fcdf19cca711.tar.gz kdepimpi-13bd085e06b76228321f5a004759fcdf19cca711.tar.bz2 |
fix loading translation
-rw-r--r-- | korganizer/koprefs.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 2cfb382..651442b 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -142,431 +142,431 @@ KOPrefs::KOPrefs() : | |||
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"); | 146 | // addItemString("Time Zone",&mTimeZone,"+0100"); |
147 | addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); | 147 | addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); |
148 | // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60); | 148 | // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60); |
149 | addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); | 149 | addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); |
150 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); | 150 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); |
151 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); | 151 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); |
152 | 152 | ||
153 | 153 | ||
154 | addItemInt("Default Start Time",&mStartTime,10); | 154 | addItemInt("Default Start Time",&mStartTime,10); |
155 | addItemInt("Default Duration",&mDefaultDuration,2); | 155 | addItemInt("Default Duration",&mDefaultDuration,2); |
156 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 156 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
157 | addItemInt("Daylight Savings",&mDaylightSavings,0); | 157 | addItemInt("Daylight Savings",&mDaylightSavings,0); |
158 | KPrefs::setCurrentGroup("AlarmSettings"); | 158 | KPrefs::setCurrentGroup("AlarmSettings"); |
159 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 159 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
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 | addItemFont("TimeBar Font",&mTimeBarFont); | 171 | addItemFont("TimeBar Font",&mTimeBarFont); |
172 | addItemFont("MonthView Font",&mMonthViewFont); | 172 | addItemFont("MonthView Font",&mMonthViewFont); |
173 | addItemFont("AgendaView Font",&mAgendaViewFont); | 173 | addItemFont("AgendaView Font",&mAgendaViewFont); |
174 | addItemFont("MarcusBains Font",&mMarcusBainsFont); | 174 | addItemFont("MarcusBains Font",&mMarcusBainsFont); |
175 | addItemFont("TimeLabels Font",&mTimeLabelsFont); | 175 | addItemFont("TimeLabels Font",&mTimeLabelsFont); |
176 | addItemFont("TodoView Font",&mTodoViewFont); | 176 | addItemFont("TodoView Font",&mTodoViewFont); |
177 | addItemFont("ListView Font",&mListViewFont); | 177 | addItemFont("ListView Font",&mListViewFont); |
178 | addItemFont("DateNavigator Font",&mDateNavigatorFont); | 178 | addItemFont("DateNavigator Font",&mDateNavigatorFont); |
179 | addItemFont("EditBox Font",&mEditBoxFont); | 179 | addItemFont("EditBox Font",&mEditBoxFont); |
180 | addItemFont("JournalView Font",&mJornalViewFont); | 180 | addItemFont("JournalView Font",&mJornalViewFont); |
181 | addItemFont("WhatsNextView Font",&mWhatsNextFont); | 181 | addItemFont("WhatsNextView Font",&mWhatsNextFont); |
182 | addItemFont("EventView Font",&mEventViewFont); | 182 | addItemFont("EventView Font",&mEventViewFont); |
183 | 183 | ||
184 | // KPrefs::setCurrentGroup("SyncProfiles"); | 184 | // KPrefs::setCurrentGroup("SyncProfiles"); |
185 | // addItemString("LocalMachineName",&mLocalMachineName, "undefined"); | 185 | // addItemString("LocalMachineName",&mLocalMachineName, "undefined"); |
186 | // addItemStringList("SyncProfileNames",&mSyncProfileNames); | 186 | // addItemStringList("SyncProfileNames",&mSyncProfileNames); |
187 | // addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); | 187 | // addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); |
188 | 188 | ||
189 | KPrefs::setCurrentGroup("RemoteSyncing"); | 189 | KPrefs::setCurrentGroup("RemoteSyncing"); |
190 | // addItemBool("UsePasswd",&mUsePassWd,false); | 190 | // addItemBool("UsePasswd",&mUsePassWd,false); |
191 | // addItemBool("WriteBackFile",&mWriteBackFile,true); | 191 | // addItemBool("WriteBackFile",&mWriteBackFile,true); |
192 | // addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); | 192 | // addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); |
193 | // addItemBool("AskForPreferences",&mAskForPreferences,true); | 193 | // addItemBool("AskForPreferences",&mAskForPreferences,true); |
194 | // addItemBool("ShowSyncSummary",&mShowSyncSummary,true); | 194 | // addItemBool("ShowSyncSummary",&mShowSyncSummary,true); |
195 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 195 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
196 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 196 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
197 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 197 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
198 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 198 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
199 | 199 | ||
200 | #ifdef _WIN32_ | 200 | #ifdef _WIN32_ |
201 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 201 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
202 | #else | 202 | #else |
203 | QString hdp= locateLocal("data","korganizer")+"/"; | 203 | QString hdp= locateLocal("data","korganizer")+"/"; |
204 | #endif | 204 | #endif |
205 | // addItemString("RemoteIP",&mRemoteIP, "192.168.0.65"); | 205 | // addItemString("RemoteIP",&mRemoteIP, "192.168.0.65"); |
206 | // addItemString("RemoteUser",&mRemoteUser, "zaurus"); | 206 | // addItemString("RemoteUser",&mRemoteUser, "zaurus"); |
207 | // addItemString("RemotePassWd",&mRemotePassWd, ""); | 207 | // addItemString("RemotePassWd",&mRemotePassWd, ""); |
208 | // addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics"); | 208 | // addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics"); |
209 | // addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" ); | 209 | // addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" ); |
210 | 210 | ||
211 | 211 | ||
212 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 212 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
213 | 213 | ||
214 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 214 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
215 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 215 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
216 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 216 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
217 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 217 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
218 | 218 | ||
219 | 219 | ||
220 | KPrefs::setCurrentGroup("Locale"); | 220 | KPrefs::setCurrentGroup("Locale"); |
221 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); | 221 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); |
222 | addItemInt("PreferredTime",&mPreferredTime,0); | 222 | addItemInt("PreferredTime",&mPreferredTime,0); |
223 | addItemInt("PreferredDate",&mPreferredDate,0); | 223 | addItemInt("PreferredDate",&mPreferredDate,0); |
224 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); | 224 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); |
225 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 225 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
226 | addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); | 226 | addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); |
227 | addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); | 227 | addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); |
228 | 228 | ||
229 | 229 | ||
230 | KPrefs::setCurrentGroup("Colors"); | 230 | KPrefs::setCurrentGroup("Colors"); |
231 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 231 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
232 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 232 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
233 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 233 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
234 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 234 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
235 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 235 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
236 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 236 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
237 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 237 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
238 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 238 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
239 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 239 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
240 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 240 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
241 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 241 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
242 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 242 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
243 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 243 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
244 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 244 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
245 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 245 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
246 | addItemBool("UseAppColors",&mUseAppColors,false); | 246 | addItemBool("UseAppColors",&mUseAppColors,false); |
247 | 247 | ||
248 | 248 | ||
249 | 249 | ||
250 | KPrefs::setCurrentGroup("Views"); | 250 | KPrefs::setCurrentGroup("Views"); |
251 | addItemInt("Hour Size",&mHourSize,8); | 251 | addItemInt("Hour Size",&mHourSize,8); |
252 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 252 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
253 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 253 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
254 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 254 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
255 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 255 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
256 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 256 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
257 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 257 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
258 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 258 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
259 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 259 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
260 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 260 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
261 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 261 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
262 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 262 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
263 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); | 263 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); |
264 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 264 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
265 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 265 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
266 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 266 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
267 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 267 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
268 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); | 268 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); |
269 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 269 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
270 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 270 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
271 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 271 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
272 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 272 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
273 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 273 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
274 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); | 274 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); |
275 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 275 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
276 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 276 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
277 | #ifdef DESKTOP_VERSION | 277 | #ifdef DESKTOP_VERSION |
278 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 278 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
279 | #else | 279 | #else |
280 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 280 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
281 | #endif | 281 | #endif |
282 | addItemInt("Day Begins",&mDayBegins,7); | 282 | addItemInt("Day Begins",&mDayBegins,7); |
283 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 283 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
284 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 284 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
285 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 285 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
286 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 286 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
287 | 287 | ||
288 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 288 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
289 | addItemBool("Full View Month",&mFullViewMonth,true); | 289 | addItemBool("Full View Month",&mFullViewMonth,true); |
290 | addItemBool("Full View Todo",&mFullViewTodo,true); | 290 | addItemBool("Full View Todo",&mFullViewTodo,true); |
291 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 291 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
292 | 292 | ||
293 | addItemInt("Next X Days",&mNextXDays,3); | 293 | addItemInt("Next X Days",&mNextXDays,3); |
294 | 294 | ||
295 | KPrefs::setCurrentGroup("Printer"); | 295 | KPrefs::setCurrentGroup("Printer"); |
296 | 296 | ||
297 | KPrefs::setCurrentGroup("Layout"); | 297 | KPrefs::setCurrentGroup("Layout"); |
298 | 298 | ||
299 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 299 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
300 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 300 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
301 | 301 | ||
302 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 302 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
303 | 303 | ||
304 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 304 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
305 | 305 | ||
306 | KPrefs::setCurrentGroup("Group Scheduling"); | 306 | KPrefs::setCurrentGroup("Group Scheduling"); |
307 | 307 | ||
308 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 308 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
309 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 309 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
310 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 310 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
311 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 311 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
312 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 312 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
313 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 313 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
314 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 314 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
315 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 315 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
316 | 316 | ||
317 | KPrefs::setCurrentGroup( "Editors" ); | 317 | KPrefs::setCurrentGroup( "Editors" ); |
318 | 318 | ||
319 | addItemStringList( "EventTemplates", &mEventTemplates ); | 319 | addItemStringList( "EventTemplates", &mEventTemplates ); |
320 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 320 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
321 | 321 | ||
322 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 322 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
323 | 323 | ||
324 | 324 | ||
325 | 325 | ||
326 | } | 326 | } |
327 | 327 | ||
328 | 328 | ||
329 | KOPrefs::~KOPrefs() | 329 | KOPrefs::~KOPrefs() |
330 | { | 330 | { |
331 | if (mInstance == this) | 331 | if (mInstance == this) |
332 | mInstance = insd.setObject(0); | 332 | mInstance = insd.setObject(0); |
333 | setLocaleDict( 0 ); | 333 | setLocaleDict( 0 ); |
334 | if ( mLocaleDict ) | 334 | if ( mLocaleDict ) |
335 | delete mLocaleDict; | 335 | delete mLocaleDict; |
336 | //qDebug("KOPrefs::~KOPrefs() "); | 336 | //qDebug("KOPrefs::~KOPrefs() "); |
337 | } | 337 | } |
338 | 338 | ||
339 | 339 | ||
340 | KOPrefs *KOPrefs::instance() | 340 | KOPrefs *KOPrefs::instance() |
341 | { | 341 | { |
342 | if (!mInstance) { | 342 | if (!mInstance) { |
343 | mInstance = insd.setObject(new KOPrefs()); | 343 | mInstance = insd.setObject(new KOPrefs()); |
344 | mInstance->readConfig(); | 344 | mInstance->readConfig(); |
345 | } | 345 | } |
346 | 346 | ||
347 | return mInstance; | 347 | return mInstance; |
348 | } | 348 | } |
349 | 349 | ||
350 | void KOPrefs::usrSetDefaults() | 350 | void KOPrefs::usrSetDefaults() |
351 | { | 351 | { |
352 | 352 | ||
353 | } | 353 | } |
354 | 354 | ||
355 | void KOPrefs::fillMailDefaults() | 355 | void KOPrefs::fillMailDefaults() |
356 | { | 356 | { |
357 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 357 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
358 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 358 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
359 | } | 359 | } |
360 | 360 | ||
361 | void KOPrefs::setTimeZoneIdDefault() | 361 | void KOPrefs::setTimeZoneIdDefault() |
362 | { | 362 | { |
363 | mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)"); | 363 | mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)"); |
364 | } | 364 | } |
365 | 365 | ||
366 | void KOPrefs::setCategoryDefaults() | 366 | void KOPrefs::setCategoryDefaults() |
367 | { | 367 | { |
368 | mCustomCategories.clear(); | 368 | mCustomCategories.clear(); |
369 | mCustomCategories = getDefaultList(); | 369 | mCustomCategories = getDefaultList(); |
370 | 370 | ||
371 | QStringList::Iterator it; | 371 | QStringList::Iterator it; |
372 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 372 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
373 | setCategoryColor(*it,mDefaultCategoryColor); | 373 | setCategoryColor(*it,mDefaultCategoryColor); |
374 | } | 374 | } |
375 | } | 375 | } |
376 | 376 | ||
377 | QStringList KOPrefs::getDefaultList() | 377 | QStringList KOPrefs::getDefaultList() |
378 | { | 378 | { |
379 | QStringList retval ; | 379 | QStringList retval ; |
380 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 380 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
381 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 381 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
382 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 382 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
383 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 383 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
384 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 384 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
385 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 385 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
386 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 386 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
387 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 387 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
388 | retval.sort(); | 388 | retval.sort(); |
389 | return retval; | 389 | return retval; |
390 | } | 390 | } |
391 | 391 | ||
392 | void KOPrefs::usrReadConfig() | 392 | void KOPrefs::usrReadConfig() |
393 | { | 393 | { |
394 | mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 394 | mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
395 | mLocaleDict = 0; | 395 | mLocaleDict = 0; |
396 | // pending LR fix translation | 396 | // pending LR fix translation |
397 | // qDebug("KOPrefs::usrReadConfig() fix translation "); | 397 | // qDebug("KOPrefs::usrReadConfig() fix translation "); |
398 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) { | 398 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { |
399 | if ( mPreferredLanguage == 1 ) { | 399 | if ( mPreferredLanguage == 1 ) { |
400 | mLocaleDict = new QDict<QString>; | 400 | mLocaleDict = new QDict<QString>; |
401 | int i = 0; | 401 | int i = 0; |
402 | QString fw ( germanwords[i] [0]); | 402 | QString fw ( germanwords[i] [0]); |
403 | while ( !fw.isEmpty() ) { | 403 | while ( !fw.isEmpty() ) { |
404 | mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); | 404 | mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); |
405 | ++i; | 405 | ++i; |
406 | fw = germanwords[i] [0]; | 406 | fw = germanwords[i] [0]; |
407 | } | 407 | } |
408 | 408 | ||
409 | setLocaleDict( mLocaleDict ); | 409 | setLocaleDict( mLocaleDict ); |
410 | } else { | 410 | } else { |
411 | QString fileName ; | 411 | QString fileName ; |
412 | if ( mPreferredLanguage == 4 ) | 412 | if ( mPreferredLanguage == 4 ) |
413 | fileName = MainWindow::resourcePath()+"usertranslation.txt"; | 413 | fileName = MainWindow::resourcePath()+"usertranslation.txt"; |
414 | else if ( mPreferredLanguage == 2 ) | 414 | else if ( mPreferredLanguage == 2 ) |
415 | fileName = MainWindow::resourcePath()+"frenchtranslation.txt"; | 415 | fileName = MainWindow::resourcePath()+"frenchtranslation.txt"; |
416 | else if ( mPreferredLanguage == 3 ) | 416 | else if ( mPreferredLanguage == 3 ) |
417 | fileName = MainWindow::resourcePath()+"italiantranslation.txt"; | 417 | fileName = MainWindow::resourcePath()+"italiantranslation.txt"; |
418 | QFile file( fileName ); | 418 | QFile file( fileName ); |
419 | if (file.open( IO_ReadOnly ) ) { | 419 | if (file.open( IO_ReadOnly ) ) { |
420 | QTextStream ts( &file ); | 420 | QTextStream ts( &file ); |
421 | ts.setEncoding( QTextStream::Latin1 ); | 421 | ts.setEncoding( QTextStream::Latin1 ); |
422 | //ts.setCodec( QTextCodec::latin1 ); | 422 | //ts.setCodec( QTextCodec::latin1 ); |
423 | QString text = ts.read(); | 423 | QString text = ts.read(); |
424 | file.close(); | 424 | file.close(); |
425 | text.replace( QRegExp("\\\\n"), "\n" ); | 425 | text.replace( QRegExp("\\\\n"), "\n" ); |
426 | QString line; | 426 | QString line; |
427 | QString we; | 427 | QString we; |
428 | QString wt; | 428 | QString wt; |
429 | int br = 0; | 429 | int br = 0; |
430 | int nbr; | 430 | int nbr; |
431 | nbr = text.find ( "},", br ); | 431 | nbr = text.find ( "},", br ); |
432 | line = text.mid( br, nbr - br ); | 432 | line = text.mid( br, nbr - br ); |
433 | br = nbr+1; | 433 | br = nbr+1; |
434 | int se, ee, st, et; | 434 | int se, ee, st, et; |
435 | mLocaleDict = new QDict<QString>; | 435 | mLocaleDict = new QDict<QString>; |
436 | QString end = "{ \"\",\"\" }"; | 436 | QString end = "{ \"\",\"\" }"; |
437 | while ( (line != end) && (br > 1) ) { | 437 | while ( (line != end) && (br > 1) ) { |
438 | //qDebug("%d *%s* ", br, line.latin1()); | 438 | //qDebug("%d *%s* ", br, line.latin1()); |
439 | se = line.find("\"")+1; | 439 | se = line.find("\"")+1; |
440 | et = line.findRev("\"",-1); | 440 | et = line.findRev("\"",-1); |
441 | ee = line.find("\",\""); | 441 | ee = line.find("\",\""); |
442 | st = ee+3; | 442 | st = ee+3; |
443 | we = line.mid( se, ee-se ); | 443 | we = line.mid( se, ee-se ); |
444 | wt = line.mid( st, et-st ); | 444 | wt = line.mid( st, et-st ); |
445 | //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); | 445 | //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); |
446 | mLocaleDict->insert( we, new QString (wt) ); | 446 | mLocaleDict->insert( we, new QString (wt) ); |
447 | nbr = text.find ( "}", br ); | 447 | nbr = text.find ( "}", br ); |
448 | line = text.mid( br, nbr - br ); | 448 | line = text.mid( br, nbr - br ); |
449 | br = nbr+1; | 449 | br = nbr+1; |
450 | } | 450 | } |
451 | //qDebug("end *%s* ", end.latin1()); | 451 | //qDebug("end *%s* ", end.latin1()); |
452 | 452 | ||
453 | setLocaleDict( mLocaleDict ); | 453 | setLocaleDict( mLocaleDict ); |
454 | } else { | 454 | } else { |
455 | qDebug("KO: Cannot find translation file %s",fileName.latin1() ); | 455 | qDebug("KO: Cannot find translation file %s",fileName.latin1() ); |
456 | } | 456 | } |
457 | 457 | ||
458 | } | 458 | } |
459 | } | 459 | } |
460 | config()->setGroup("General"); | 460 | config()->setGroup("General"); |
461 | 461 | ||
462 | mCustomCategories = config()->readListEntry("Custom Categories"); | 462 | mCustomCategories = config()->readListEntry("Custom Categories"); |
463 | if ( KOPrefs::instance()->mLanguageChanged ) { | 463 | if ( KOPrefs::instance()->mLanguageChanged ) { |
464 | mLocationDefaults.clear(); | 464 | mLocationDefaults.clear(); |
465 | mEventSummaryUser.clear(); | 465 | mEventSummaryUser.clear(); |
466 | mTodoSummaryUser.clear(); | 466 | mTodoSummaryUser.clear(); |
467 | } | 467 | } |
468 | if (mLocationDefaults.isEmpty()) { | 468 | if (mLocationDefaults.isEmpty()) { |
469 | mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 469 | mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
470 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 470 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
471 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 471 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
472 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 472 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
473 | mLocationDefaults.sort(); | 473 | mLocationDefaults.sort(); |
474 | } | 474 | } |
475 | 475 | ||
476 | if (mEventSummaryUser.isEmpty()) { | 476 | if (mEventSummaryUser.isEmpty()) { |
477 | mEventSummaryUser = getDefaultList() ; | 477 | mEventSummaryUser = getDefaultList() ; |
478 | } | 478 | } |
479 | if (mTodoSummaryUser.isEmpty()) { | 479 | if (mTodoSummaryUser.isEmpty()) { |
480 | mTodoSummaryUser = getDefaultList() ; | 480 | mTodoSummaryUser = getDefaultList() ; |
481 | } | 481 | } |
482 | 482 | ||
483 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 483 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
484 | 484 | ||
485 | config()->setGroup("Personal Settings"); | 485 | config()->setGroup("Personal Settings"); |
486 | mName = config()->readEntry("user_name",""); | 486 | mName = config()->readEntry("user_name",""); |
487 | mEmail = config()->readEntry("user_email",""); | 487 | mEmail = config()->readEntry("user_email",""); |
488 | fillMailDefaults(); | 488 | fillMailDefaults(); |
489 | 489 | ||
490 | config()->setGroup("Category Colors"); | 490 | config()->setGroup("Category Colors"); |
491 | QStringList::Iterator it; | 491 | QStringList::Iterator it; |
492 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 492 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
493 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 493 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | if (mTimeZoneId.isEmpty()) { | 497 | if (mTimeZoneId.isEmpty()) { |
498 | setTimeZoneIdDefault(); | 498 | setTimeZoneIdDefault(); |
499 | } | 499 | } |
500 | KPimPrefs::usrReadConfig(); | 500 | KPimPrefs::usrReadConfig(); |
501 | } | 501 | } |
502 | 502 | ||
503 | 503 | ||
504 | void KOPrefs::usrWriteConfig() | 504 | void KOPrefs::usrWriteConfig() |
505 | { | 505 | { |
506 | config()->setGroup("General"); | 506 | config()->setGroup("General"); |
507 | config()->writeEntry("Custom Categories",mCustomCategories); | 507 | config()->writeEntry("Custom Categories",mCustomCategories); |
508 | 508 | ||
509 | config()->setGroup("Personal Settings"); | 509 | config()->setGroup("Personal Settings"); |
510 | config()->writeEntry("user_name",mName); | 510 | config()->writeEntry("user_name",mName); |
511 | config()->writeEntry("user_email",mEmail); | 511 | config()->writeEntry("user_email",mEmail); |
512 | 512 | ||
513 | config()->setGroup("Category Colors"); | 513 | config()->setGroup("Category Colors"); |
514 | QDictIterator<QColor> it(mCategoryColors); | 514 | QDictIterator<QColor> it(mCategoryColors); |
515 | while (it.current()) { | 515 | while (it.current()) { |
516 | config()->writeEntry(it.currentKey(),*(it.current())); | 516 | config()->writeEntry(it.currentKey(),*(it.current())); |
517 | ++it; | 517 | ++it; |
518 | } | 518 | } |
519 | 519 | ||
520 | 520 | ||
521 | KPimPrefs::usrWriteConfig(); | 521 | KPimPrefs::usrWriteConfig(); |
522 | } | 522 | } |
523 | 523 | ||
524 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 524 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
525 | { | 525 | { |
526 | mCategoryColors.replace(cat,new QColor(color)); | 526 | mCategoryColors.replace(cat,new QColor(color)); |
527 | } | 527 | } |
528 | 528 | ||
529 | QColor *KOPrefs::categoryColor(QString cat) | 529 | QColor *KOPrefs::categoryColor(QString cat) |
530 | { | 530 | { |
531 | QColor *color = 0; | 531 | QColor *color = 0; |
532 | 532 | ||
533 | if (!cat.isEmpty()) color = mCategoryColors[cat]; | 533 | if (!cat.isEmpty()) color = mCategoryColors[cat]; |
534 | 534 | ||
535 | if (color) return color; | 535 | if (color) return color; |
536 | else return &mDefaultCategoryColor; | 536 | else return &mDefaultCategoryColor; |
537 | } | 537 | } |
538 | 538 | ||
539 | void KOPrefs::setFullName(const QString &name) | 539 | void KOPrefs::setFullName(const QString &name) |
540 | { | 540 | { |
541 | mName = name; | 541 | mName = name; |
542 | } | 542 | } |
543 | 543 | ||
544 | void KOPrefs::setEmail(const QString &email) | 544 | void KOPrefs::setEmail(const QString &email) |
545 | { | 545 | { |
546 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); | 546 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); |
547 | mEmail = email; | 547 | mEmail = email; |
548 | } | 548 | } |
549 | 549 | ||
550 | QString KOPrefs::fullName() | 550 | QString KOPrefs::fullName() |
551 | { | 551 | { |
552 | if (mEmailControlCenter) { | 552 | if (mEmailControlCenter) { |
553 | KEMailSettings settings; | 553 | KEMailSettings settings; |
554 | return settings.getSetting(KEMailSettings::RealName); | 554 | return settings.getSetting(KEMailSettings::RealName); |
555 | } else { | 555 | } else { |
556 | return mName; | 556 | return mName; |
557 | } | 557 | } |
558 | } | 558 | } |
559 | 559 | ||
560 | QString KOPrefs::email() | 560 | QString KOPrefs::email() |
561 | { | 561 | { |
562 | if (mEmailControlCenter) { | 562 | if (mEmailControlCenter) { |
563 | KEMailSettings settings; | 563 | KEMailSettings settings; |
564 | return settings.getSetting(KEMailSettings::EmailAddress); | 564 | return settings.getSetting(KEMailSettings::EmailAddress); |
565 | } else { | 565 | } else { |
566 | return mEmail; | 566 | return mEmail; |
567 | } | 567 | } |
568 | } | 568 | } |
569 | KConfig* KOPrefs::getConfig() | 569 | KConfig* KOPrefs::getConfig() |
570 | { | 570 | { |
571 | return config(); | 571 | return config(); |
572 | } | 572 | } |