summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-07-10 10:29:33 (UTC)
committer zautrix <zautrix>2004-07-10 10:29:33 (UTC)
commitabac12317e02aa83579102d04a75e027e45ec667 (patch) (unidiff)
tree2348fa00a852184b4d0e6b6ab9e882918b8d0748 /korganizer
parentadaa664ac87d6b78e9431d3376f7a24461edf469 (diff)
downloadkdepimpi-abac12317e02aa83579102d04a75e027e45ec667.zip
kdepimpi-abac12317e02aa83579102d04a75e027e45ec667.tar.gz
kdepimpi-abac12317e02aa83579102d04a75e027e45ec667.tar.bz2
Turned on internal alarm on dektop as default
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp4
-rw-r--r--korganizer/mainwindow.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 2900a40..3ba5ab2 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -82,385 +82,389 @@ KOPrefs::KOPrefs() :
82 addItemBool("ShowIconSearch",&mShowIconSearch,true); 82 addItemBool("ShowIconSearch",&mShowIconSearch,true);
83 addItemBool("ShowIconList",&mShowIconList,true); 83 addItemBool("ShowIconList",&mShowIconList,true);
84 addItemBool("ShowIconDay1",&mShowIconDay1,true); 84 addItemBool("ShowIconDay1",&mShowIconDay1,true);
85 addItemBool("ShowIconDay5",&mShowIconDay5,true); 85 addItemBool("ShowIconDay5",&mShowIconDay5,true);
86 addItemBool("ShowIconDay7",&mShowIconDay7,true); 86 addItemBool("ShowIconDay7",&mShowIconDay7,true);
87 addItemBool("ShowIconMonth",&mShowIconMonth,true); 87 addItemBool("ShowIconMonth",&mShowIconMonth,true);
88 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 88 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
89 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 89 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
90 addItemBool("ShowIconBack",&mShowIconBack,true); 90 addItemBool("ShowIconBack",&mShowIconBack,true);
91 addItemBool("ShowIconToday",&mShowIconToday,true); 91 addItemBool("ShowIconToday",&mShowIconToday,true);
92 addItemBool("ShowIconForward",&mShowIconForward,true); 92 addItemBool("ShowIconForward",&mShowIconForward,true);
93 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 93 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
94 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); 94 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false);
95 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 95 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
96 addItemBool("ShowIconNext",&mShowIconNext,true); 96 addItemBool("ShowIconNext",&mShowIconNext,true);
97 addItemBool("ShowIconJournal",&mShowIconJournal,true); 97 addItemBool("ShowIconJournal",&mShowIconJournal,true);
98 addItemBool("ShowIconStretch",&mShowIconStretch,true); 98 addItemBool("ShowIconStretch",&mShowIconStretch,true);
99 addItemBool("LanguageChanged",&mLanguageChanged,false); 99 addItemBool("LanguageChanged",&mLanguageChanged,false);
100 100
101 addItemBool("AskForQuit",&mAskForQuit,false); 101 addItemBool("AskForQuit",&mAskForQuit,false);
102 102
103#ifndef DESKTOP_VERSION 103#ifndef DESKTOP_VERSION
104 addItemBool("ShowFullMenu",&mShowFullMenu,false); 104 addItemBool("ShowFullMenu",&mShowFullMenu,false);
105#else 105#else
106 addItemBool("ShowFullMenu",&mShowFullMenu,true); 106 addItemBool("ShowFullMenu",&mShowFullMenu,true);
107#endif 107#endif
108 addItemBool("ToolBarHor",&mToolBarHor, true ); 108 addItemBool("ToolBarHor",&mToolBarHor, true );
109 addItemBool("ToolBarUp",&mToolBarUp, false ); 109 addItemBool("ToolBarUp",&mToolBarUp, false );
110 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 110 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
111 addItemInt("Whats Next Days",&mWhatsNextDays,3); 111 addItemInt("Whats Next Days",&mWhatsNextDays,3);
112 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 112 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
113 113
114 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 114 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
116 addItemInt("AllDay Size",&mAllDaySize,28); 116 addItemInt("AllDay Size",&mAllDaySize,28);
117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
119 119
120 addItemStringList("LocationDefaults",&mLocationDefaults ); 120 addItemStringList("LocationDefaults",&mLocationDefaults );
121 addItemStringList("EventSummary User",&mEventSummaryUser); 121 addItemStringList("EventSummary User",&mEventSummaryUser);
122 addItemStringList("TodoSummary User",&mTodoSummaryUser); 122 addItemStringList("TodoSummary User",&mTodoSummaryUser);
123 123
124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
125 addItemBool("Enable Project View",&mEnableProjectView,false); 125 addItemBool("Enable Project View",&mEnableProjectView,false);
126 addItemBool("Auto Save",&mAutoSave,false); 126 addItemBool("Auto Save",&mAutoSave,false);
127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
128 addItemBool("Confirm Deletes",&mConfirm,true); 128 addItemBool("Confirm Deletes",&mConfirm,true);
129 addItemString("Archive File",&mArchiveFile); 129 addItemString("Archive File",&mArchiveFile);
130 addItemString("Html Export File",&mHtmlExportFile, 130 addItemString("Html Export File",&mHtmlExportFile,
131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
132 addItemBool("Html With Save",&mHtmlWithSave,false); 132 addItemBool("Html With Save",&mHtmlWithSave,false);
133 133
134 KPrefs::setCurrentGroup("Personal Settings"); 134 KPrefs::setCurrentGroup("Personal Settings");
135 135
136 addItemInt("Mail Client",&mMailClient,MailClientKMail); 136 addItemInt("Mail Client",&mMailClient,MailClientKMail);
137 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 137 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
138 addItemBool("Bcc",&mBcc,false); 138 addItemBool("Bcc",&mBcc,false);
139 139
140 KPrefs::setCurrentGroup("Time & Date"); 140 KPrefs::setCurrentGroup("Time & Date");
141 141
142 // addItemString("Time Zone",&mTimeZone,"+0100"); 142 // addItemString("Time Zone",&mTimeZone,"+0100");
143 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); 143 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
144 // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60); 144 // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60);
145 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 145 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
146 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 146 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
147 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 147 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
148 148
149 149
150 addItemInt("Default Start Time",&mStartTime,10); 150 addItemInt("Default Start Time",&mStartTime,10);
151 addItemInt("Default Duration",&mDefaultDuration,2); 151 addItemInt("Default Duration",&mDefaultDuration,2);
152 addItemInt("Default Alarm Time",&mAlarmTime,3); 152 addItemInt("Default Alarm Time",&mAlarmTime,3);
153 addItemInt("Daylight Savings",&mDaylightSavings,0); 153 addItemInt("Daylight Savings",&mDaylightSavings,0);
154 KPrefs::setCurrentGroup("AlarmSettings"); 154 KPrefs::setCurrentGroup("AlarmSettings");
155 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 155 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
156 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 156 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
157 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 157 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
158 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 158 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
159 159
160 160
161 KPrefs::setCurrentGroup("Calendar"); 161 KPrefs::setCurrentGroup("Calendar");
162 162
163 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 163 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
164 164
165 KPrefs::setCurrentGroup("Fonts"); 165 KPrefs::setCurrentGroup("Fonts");
166 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 166 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
167 addItemFont("TimeBar Font",&mTimeBarFont); 167 addItemFont("TimeBar Font",&mTimeBarFont);
168 addItemFont("MonthView Font",&mMonthViewFont); 168 addItemFont("MonthView Font",&mMonthViewFont);
169 addItemFont("AgendaView Font",&mAgendaViewFont); 169 addItemFont("AgendaView Font",&mAgendaViewFont);
170 addItemFont("MarcusBains Font",&mMarcusBainsFont); 170 addItemFont("MarcusBains Font",&mMarcusBainsFont);
171 addItemFont("TimeLabels Font",&mTimeLabelsFont); 171 addItemFont("TimeLabels Font",&mTimeLabelsFont);
172 addItemFont("TodoView Font",&mTodoViewFont); 172 addItemFont("TodoView Font",&mTodoViewFont);
173 addItemFont("ListView Font",&mListViewFont); 173 addItemFont("ListView Font",&mListViewFont);
174 addItemFont("DateNavigator Font",&mDateNavigatorFont); 174 addItemFont("DateNavigator Font",&mDateNavigatorFont);
175 addItemFont("EditBox Font",&mEditBoxFont); 175 addItemFont("EditBox Font",&mEditBoxFont);
176 addItemFont("JournalView Font",&mJornalViewFont); 176 addItemFont("JournalView Font",&mJornalViewFont);
177 addItemFont("WhatsNextView Font",&mWhatsNextFont); 177 addItemFont("WhatsNextView Font",&mWhatsNextFont);
178 addItemFont("EventView Font",&mEventViewFont); 178 addItemFont("EventView Font",&mEventViewFont);
179 179
180 KPrefs::setCurrentGroup("SyncProfiles"); 180 KPrefs::setCurrentGroup("SyncProfiles");
181 addItemString("LocalMachineName",&mLocalMachineName, "undefined"); 181 addItemString("LocalMachineName",&mLocalMachineName, "undefined");
182 addItemStringList("SyncProfileNames",&mSyncProfileNames); 182 addItemStringList("SyncProfileNames",&mSyncProfileNames);
183 183
184 KPrefs::setCurrentGroup("RemoteSyncing"); 184 KPrefs::setCurrentGroup("RemoteSyncing");
185 addItemBool("UsePasswd",&mUsePassWd,false); 185 addItemBool("UsePasswd",&mUsePassWd,false);
186 addItemBool("WriteBackFile",&mWriteBackFile,true); 186 addItemBool("WriteBackFile",&mWriteBackFile,true);
187 addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); 187 addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false);
188 addItemBool("AskForPreferences",&mAskForPreferences,true); 188 addItemBool("AskForPreferences",&mAskForPreferences,true);
189 addItemBool("ShowSyncSummary",&mShowSyncSummary,true); 189 addItemBool("ShowSyncSummary",&mShowSyncSummary,true);
190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
191 addItemInt("LastSyncTime",&mLastSyncTime,0); 191 addItemInt("LastSyncTime",&mLastSyncTime,0);
192 addItemInt("SyncAlgoPrefs",&mSyncAlgoPrefs,3); 192 addItemInt("SyncAlgoPrefs",&mSyncAlgoPrefs,3);
193 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); 193 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3);
194 194
195#ifdef _WIN32_ 195#ifdef _WIN32_
196 QString hdp= locateLocal("data","korganizer")+"\\\\"; 196 QString hdp= locateLocal("data","korganizer")+"\\\\";
197#else 197#else
198 QString hdp= locateLocal("data","korganizer")+"/"; 198 QString hdp= locateLocal("data","korganizer")+"/";
199#endif 199#endif
200 addItemString("RemoteIP",&mRemoteIP, "192.168.0.65"); 200 addItemString("RemoteIP",&mRemoteIP, "192.168.0.65");
201 addItemString("RemoteUser",&mRemoteUser, "zaurus"); 201 addItemString("RemoteUser",&mRemoteUser, "zaurus");
202 addItemString("RemotePassWd",&mRemotePassWd, ""); 202 addItemString("RemotePassWd",&mRemotePassWd, "");
203 addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics"); 203 addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics");
204 addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" ); 204 addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" );
205 205
206 206
207 KPrefs::setCurrentGroup("LoadSaveFileNames"); 207 KPrefs::setCurrentGroup("LoadSaveFileNames");
208 208
209 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 209 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
210 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 210 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
211 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 211 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
212 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 212 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
213 addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" ); 213 addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" );
214 214
215 215
216 KPrefs::setCurrentGroup("Locale"); 216 KPrefs::setCurrentGroup("Locale");
217 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 217 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
218 addItemInt("PreferredTime",&mPreferredTime,0); 218 addItemInt("PreferredTime",&mPreferredTime,0);
219 addItemInt("PreferredDate",&mPreferredDate,0); 219 addItemInt("PreferredDate",&mPreferredDate,0);
220 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 220 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
221 addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); 221 addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
222 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 222 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
223 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 223 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
224 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 224 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
225 225
226 226
227 KPrefs::setCurrentGroup("Colors"); 227 KPrefs::setCurrentGroup("Colors");
228 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 228 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
229 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 229 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
230 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 230 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
231 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 231 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
232 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 232 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
233 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 233 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
234 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 234 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
235 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 235 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
236 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 236 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
237 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 237 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
238 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 238 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
239 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 239 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
240 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 240 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
241 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 241 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
242 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 242 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
243 addItemBool("UseAppColors",&mUseAppColors,false); 243 addItemBool("UseAppColors",&mUseAppColors,false);
244 244
245 245
246 246
247 KPrefs::setCurrentGroup("Views"); 247 KPrefs::setCurrentGroup("Views");
248 addItemInt("Hour Size",&mHourSize,8); 248 addItemInt("Hour Size",&mHourSize,8);
249 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 249 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
250 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 250 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
251 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 251 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
252 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 252 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
253 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 253 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
254 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 254 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
255 addItemBool("Enable ToolTips",&mEnableToolTips,false); 255 addItemBool("Enable ToolTips",&mEnableToolTips,false);
256 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 256 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
257 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 257 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
258 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 258 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
259 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 259 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
260 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 260 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
261 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 261 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
262 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 262 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
263 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 263 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
264 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 264 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
265 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); 265 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);
266 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 266 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
267 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 267 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
268 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 268 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
269 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 269 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
270 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 270 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
271 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 271 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
272 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 272 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
273 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 273 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
274#ifdef DESKTOP_VERSION
275 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
276#else
274 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 277 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
278#endif
275 addItemInt("Day Begins",&mDayBegins,7); 279 addItemInt("Day Begins",&mDayBegins,7);
276 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 280 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
277 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 281 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
278 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 282 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
279 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 283 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
280 284
281 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 285 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
282 addItemBool("Full View Month",&mFullViewMonth,true); 286 addItemBool("Full View Month",&mFullViewMonth,true);
283 addItemBool("Full View Todo",&mFullViewTodo,true); 287 addItemBool("Full View Todo",&mFullViewTodo,true);
284 addItemBool("Quick Todo",&mEnableQuickTodo,false); 288 addItemBool("Quick Todo",&mEnableQuickTodo,false);
285 289
286 addItemInt("Next X Days",&mNextXDays,3); 290 addItemInt("Next X Days",&mNextXDays,3);
287 291
288 KPrefs::setCurrentGroup("Printer"); 292 KPrefs::setCurrentGroup("Printer");
289 293
290 KPrefs::setCurrentGroup("Layout"); 294 KPrefs::setCurrentGroup("Layout");
291 295
292 addItemBool("CompactDialogs",&mCompactDialogs,false); 296 addItemBool("CompactDialogs",&mCompactDialogs,false);
293 addItemBool("VerticalScreen",&mVerticalScreen,true); 297 addItemBool("VerticalScreen",&mVerticalScreen,true);
294 298
295 KPrefs::setCurrentGroup("KOrganizer Plugins"); 299 KPrefs::setCurrentGroup("KOrganizer Plugins");
296 300
297 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 301 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
298 302
299 KPrefs::setCurrentGroup("Group Scheduling"); 303 KPrefs::setCurrentGroup("Group Scheduling");
300 304
301 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 305 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
302 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 306 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
303 addItemStringList("AdditionalMails",&mAdditionalMails,""); 307 addItemStringList("AdditionalMails",&mAdditionalMails,"");
304 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 308 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
305 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 309 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
306 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 310 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
307 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 311 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
308 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 312 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
309 313
310 KPrefs::setCurrentGroup( "Editors" ); 314 KPrefs::setCurrentGroup( "Editors" );
311 315
312 addItemStringList( "EventTemplates", &mEventTemplates ); 316 addItemStringList( "EventTemplates", &mEventTemplates );
313 addItemStringList( "TodoTemplates", &mTodoTemplates ); 317 addItemStringList( "TodoTemplates", &mTodoTemplates );
314 318
315 addItemInt("DestinationPolicy",&mDestination,standardDestination); 319 addItemInt("DestinationPolicy",&mDestination,standardDestination);
316 320
317 321
318 322
319} 323}
320 324
321 325
322KOPrefs::~KOPrefs() 326KOPrefs::~KOPrefs()
323{ 327{
324 if (mInstance == this) 328 if (mInstance == this)
325 mInstance = insd.setObject(0); 329 mInstance = insd.setObject(0);
326 setLocaleDict( 0 ); 330 setLocaleDict( 0 );
327 if ( mLocaleDict ) 331 if ( mLocaleDict )
328 delete mLocaleDict; 332 delete mLocaleDict;
329 //qDebug("KOPrefs::~KOPrefs() "); 333 //qDebug("KOPrefs::~KOPrefs() ");
330} 334}
331 335
332 336
333KOPrefs *KOPrefs::instance() 337KOPrefs *KOPrefs::instance()
334{ 338{
335 if (!mInstance) { 339 if (!mInstance) {
336 mInstance = insd.setObject(new KOPrefs()); 340 mInstance = insd.setObject(new KOPrefs());
337 mInstance->readConfig(); 341 mInstance->readConfig();
338 } 342 }
339 343
340 return mInstance; 344 return mInstance;
341} 345}
342 346
343void KOPrefs::usrSetDefaults() 347void KOPrefs::usrSetDefaults()
344{ 348{
345 349
346} 350}
347 351
348void KOPrefs::fillMailDefaults() 352void KOPrefs::fillMailDefaults()
349{ 353{
350 if (mName.isEmpty()) mName = i18n("Anonymous"); 354 if (mName.isEmpty()) mName = i18n("Anonymous");
351 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 355 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
352} 356}
353 357
354void KOPrefs::setTimeZoneIdDefault() 358void KOPrefs::setTimeZoneIdDefault()
355{ 359{
356 mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)"); 360 mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)");
357} 361}
358 362
359void KOPrefs::setCategoryDefaults() 363void KOPrefs::setCategoryDefaults()
360{ 364{
361 mCustomCategories.clear(); 365 mCustomCategories.clear();
362 mCustomCategories = getDefaultList(); 366 mCustomCategories = getDefaultList();
363 367
364 QStringList::Iterator it; 368 QStringList::Iterator it;
365 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 369 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
366 setCategoryColor(*it,mDefaultCategoryColor); 370 setCategoryColor(*it,mDefaultCategoryColor);
367 } 371 }
368} 372}
369 373
370QStringList KOPrefs::getDefaultList() 374QStringList KOPrefs::getDefaultList()
371{ 375{
372 QStringList retval ; 376 QStringList retval ;
373 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 377 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
374 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 378 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
375 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 379 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
376 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 380 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
377 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 381 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
378 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 382 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
379 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 383 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
380 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 384 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
381 retval.sort(); 385 retval.sort();
382 return retval; 386 return retval;
383} 387}
384 388
385void KOPrefs::usrReadConfig() 389void KOPrefs::usrReadConfig()
386{ 390{
387 mLocaleDict = 0; 391 mLocaleDict = 0;
388 // pending LR fix translation 392 // pending LR fix translation
389 // qDebug("KOPrefs::usrReadConfig() fix translation "); 393 // qDebug("KOPrefs::usrReadConfig() fix translation ");
390 if ( mPreferredLanguage == 1 ) { 394 if ( mPreferredLanguage == 1 ) {
391 mLocaleDict = new QDict<QString>; 395 mLocaleDict = new QDict<QString>;
392 int i = 0; 396 int i = 0;
393 QString fw ( germanwords[i] [0]); 397 QString fw ( germanwords[i] [0]);
394 while ( !fw.isEmpty() ) { 398 while ( !fw.isEmpty() ) {
395 mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); 399 mLocaleDict->insert( fw, new QString (germanwords[i] [1] ));
396 ++i; 400 ++i;
397 fw = germanwords[i] [0]; 401 fw = germanwords[i] [0];
398 } 402 }
399 403
400 setLocaleDict( mLocaleDict ); 404 setLocaleDict( mLocaleDict );
401 } 405 }
402 if ( mPreferredLanguage == 3 ) { 406 if ( mPreferredLanguage == 3 ) {
403 QString fileName = MainWindow::resourcePath()+"usertranslation.txt"; 407 QString fileName = MainWindow::resourcePath()+"usertranslation.txt";
404 QFile file( fileName ); 408 QFile file( fileName );
405 if (file.open( IO_ReadOnly ) ) { 409 if (file.open( IO_ReadOnly ) ) {
406 QTextStream ts( &file ); 410 QTextStream ts( &file );
407 ts.setCodec( QTextCodec::codecForLocale() ); 411 ts.setCodec( QTextCodec::codecForLocale() );
408 QString text = ts.read(); 412 QString text = ts.read();
409 file.close(); 413 file.close();
410 414
411 QString line; 415 QString line;
412 QString we; 416 QString we;
413 QString wt; 417 QString wt;
414 int br = 0; 418 int br = 0;
415 int nbr; 419 int nbr;
416 nbr = text.find ( "},", br ); 420 nbr = text.find ( "},", br );
417 line = text.mid( br, nbr - br ); 421 line = text.mid( br, nbr - br );
418 br = nbr+1; 422 br = nbr+1;
419 int se, ee, st, et; 423 int se, ee, st, et;
420 mLocaleDict = new QDict<QString>; 424 mLocaleDict = new QDict<QString>;
421 QString end = "{ \"\",\"\" }"; 425 QString end = "{ \"\",\"\" }";
422 while ( (line != end) && (br > 1) ) { 426 while ( (line != end) && (br > 1) ) {
423 //qDebug("%d *%s* ", br, line.latin1()); 427 //qDebug("%d *%s* ", br, line.latin1());
424 se = line.find("\"")+1; 428 se = line.find("\"")+1;
425 et = line.findRev("\"",-1); 429 et = line.findRev("\"",-1);
426 ee = line.find("\",\""); 430 ee = line.find("\",\"");
427 st = ee+3; 431 st = ee+3;
428 we = line.mid( se, ee-se ); 432 we = line.mid( se, ee-se );
429 wt = line.mid( st, et-st ); 433 wt = line.mid( st, et-st );
430 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); 434 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1());
431 mLocaleDict->insert( we, new QString (wt) ); 435 mLocaleDict->insert( we, new QString (wt) );
432 nbr = text.find ( "}", br ); 436 nbr = text.find ( "}", br );
433 line = text.mid( br, nbr - br ); 437 line = text.mid( br, nbr - br );
434 br = nbr+1; 438 br = nbr+1;
435 } 439 }
436 //qDebug("end *%s* ", end.latin1()); 440 //qDebug("end *%s* ", end.latin1());
437 441
438 setLocaleDict( mLocaleDict ); 442 setLocaleDict( mLocaleDict );
439 } else { 443 } else {
440 qDebug("KO: Cannot find translation file usertranslation.txt"); 444 qDebug("KO: Cannot find translation file usertranslation.txt");
441 } 445 }
442 } 446 }
443 config()->setGroup("General"); 447 config()->setGroup("General");
444 448
445 mCustomCategories = config()->readListEntry("Custom Categories"); 449 mCustomCategories = config()->readListEntry("Custom Categories");
446 if ( KOPrefs::instance()->mLanguageChanged ) { 450 if ( KOPrefs::instance()->mLanguageChanged ) {
447 mLocationDefaults.clear(); 451 mLocationDefaults.clear();
448 mEventSummaryUser.clear(); 452 mEventSummaryUser.clear();
449 mTodoSummaryUser.clear(); 453 mTodoSummaryUser.clear();
450 } 454 }
451 if (mLocationDefaults.isEmpty()) { 455 if (mLocationDefaults.isEmpty()) {
452 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Libary") << i18n("School") << i18n("Doctor") << i18n("Beach") 456 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Libary") << i18n("School") << i18n("Doctor") << i18n("Beach")
453 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarden") 457 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarden")
454 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 458 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
455 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 459 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
456 mLocationDefaults.sort(); 460 mLocationDefaults.sort();
457 } 461 }
458 462
459 if (mEventSummaryUser.isEmpty()) { 463 if (mEventSummaryUser.isEmpty()) {
460 mEventSummaryUser = getDefaultList() ; 464 mEventSummaryUser = getDefaultList() ;
461 } 465 }
462 if (mTodoSummaryUser.isEmpty()) { 466 if (mTodoSummaryUser.isEmpty()) {
463 mTodoSummaryUser = getDefaultList() ; 467 mTodoSummaryUser = getDefaultList() ;
464 } 468 }
465 469
466 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 470 if (mCustomCategories.isEmpty()) setCategoryDefaults();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index be69be7..a487f14 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -940,385 +940,385 @@ void MainWindow::slotSyncMenu( int action )
940 //qDebug("syncaction %d ", action); 940 //qDebug("syncaction %d ", action);
941 if ( action == 0 ) { 941 if ( action == 0 ) {
942 942
943 confSync(); 943 confSync();
944 944
945 return; 945 return;
946 } 946 }
947 if ( action == 1 ) { 947 if ( action == 1 ) {
948 multiSync( true ); 948 multiSync( true );
949 return; 949 return;
950 } 950 }
951 951
952 if (mBlockSaveFlag) 952 if (mBlockSaveFlag)
953 return; 953 return;
954 mBlockSaveFlag = true; 954 mBlockSaveFlag = true;
955 mCurrentSyncProfile = action - 1000 ; 955 mCurrentSyncProfile = action - 1000 ;
956 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); 956 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] );
957 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 957 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
958 KConfig *config = KOGlobals::config(); 958 KConfig *config = KOGlobals::config();
959 KSyncProfile* temp = new KSyncProfile (); 959 KSyncProfile* temp = new KSyncProfile ();
960 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); 960 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
961 temp->readConfig(config); 961 temp->readConfig(config);
962 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 962 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
963 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); 963 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs();
964 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 964 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
965 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 965 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
966 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); 966 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync();
967 if ( action == 1000 ) { 967 if ( action == 1000 ) {
968 syncSharp(); 968 syncSharp();
969 969
970 } else if ( action == 1001 ) { 970 } else if ( action == 1001 ) {
971 syncLocalFile(); 971 syncLocalFile();
972 972
973 } else if ( action == 1002 ) { 973 } else if ( action == 1002 ) {
974 quickSyncLocalFile(); 974 quickSyncLocalFile();
975 975
976 } else if ( action >= 1003 ) { 976 } else if ( action >= 1003 ) {
977 if ( temp->getIsLocalFileSync() ) { 977 if ( temp->getIsLocalFileSync() ) {
978 if ( syncWithFile( temp->getRemoteFileName( ), false ) ) 978 if ( syncWithFile( temp->getRemoteFileName( ), false ) )
979 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 979 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
980 } else { 980 } else {
981 syncRemote( temp ); 981 syncRemote( temp );
982 982
983 } 983 }
984 } 984 }
985 delete temp; 985 delete temp;
986 mBlockSaveFlag = false; 986 mBlockSaveFlag = false;
987} 987}
988void MainWindow::setDefaultPreferences() 988void MainWindow::setDefaultPreferences()
989{ 989{
990 KOPrefs *p = KOPrefs::instance(); 990 KOPrefs *p = KOPrefs::instance();
991 991
992 p->mCompactDialogs = true; 992 p->mCompactDialogs = true;
993 p->mConfirm = true; 993 p->mConfirm = true;
994 // p->mEnableQuickTodo = false; 994 // p->mEnableQuickTodo = false;
995} 995}
996 996
997QString MainWindow::resourcePath() 997QString MainWindow::resourcePath()
998{ 998{
999 return KGlobal::iconLoader()->iconPath(); 999 return KGlobal::iconLoader()->iconPath();
1000} 1000}
1001 1001
1002void MainWindow::displayText( QString text ,QString cap ) 1002void MainWindow::displayText( QString text ,QString cap )
1003{ 1003{
1004 QDialog dia( this, "name", true ); ; 1004 QDialog dia( this, "name", true ); ;
1005 dia.setCaption( cap ); 1005 dia.setCaption( cap );
1006 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1006 QVBoxLayout* lay = new QVBoxLayout( &dia );
1007 lay->setSpacing( 3 ); 1007 lay->setSpacing( 3 );
1008 lay->setMargin( 3 ); 1008 lay->setMargin( 3 );
1009 QTextBrowser tb ( &dia ); 1009 QTextBrowser tb ( &dia );
1010 lay->addWidget( &tb ); 1010 lay->addWidget( &tb );
1011 tb.setText( text ); 1011 tb.setText( text );
1012#ifdef DESKTOP_VERSION 1012#ifdef DESKTOP_VERSION
1013 dia.resize( 640, 480); 1013 dia.resize( 640, 480);
1014#else 1014#else
1015 dia.showMaximized(); 1015 dia.showMaximized();
1016#endif 1016#endif
1017 dia.exec(); 1017 dia.exec();
1018} 1018}
1019void MainWindow::displayFile( QString fn, QString cap ) 1019void MainWindow::displayFile( QString fn, QString cap )
1020{ 1020{
1021 QString fileName = resourcePath() + fn; 1021 QString fileName = resourcePath() + fn;
1022 QString text; 1022 QString text;
1023 QFile file( fileName ); 1023 QFile file( fileName );
1024 if (!file.open( IO_ReadOnly ) ) { 1024 if (!file.open( IO_ReadOnly ) ) {
1025 return ; 1025 return ;
1026 1026
1027 } 1027 }
1028 QTextStream ts( &file ); 1028 QTextStream ts( &file );
1029 text = ts.read(); 1029 text = ts.read();
1030 file.close(); 1030 file.close();
1031 displayText( text, cap); 1031 displayText( text, cap);
1032} 1032}
1033void MainWindow::features() 1033void MainWindow::features()
1034{ 1034{
1035 1035
1036 displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); 1036 displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") );
1037} 1037}
1038 1038
1039void MainWindow::usertrans() 1039void MainWindow::usertrans()
1040{ 1040{
1041 1041
1042 displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); 1042 displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") );
1043} 1043}
1044void MainWindow::synchowto() 1044void MainWindow::synchowto()
1045{ 1045{
1046 1046
1047 displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); 1047 displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") );
1048} 1048}
1049void MainWindow::faq() 1049void MainWindow::faq()
1050{ 1050{
1051 displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); 1051 displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") );
1052 1052
1053} 1053}
1054void MainWindow::whatsNew() 1054void MainWindow::whatsNew()
1055{ 1055{
1056 displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); 1056 displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") );
1057 1057
1058} 1058}
1059void MainWindow::about() 1059void MainWindow::about()
1060{ 1060{
1061 QString version; 1061 QString version;
1062#include <../version> 1062#include <../version>
1063 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1063 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1064 i18n("KOrganizer/Platform-independent\n") + 1064 i18n("KOrganizer/Platform-independent\n") +
1065 "(KO/Pi) " + version + " - " + 1065 "(KO/Pi) " + version + " - " +
1066 1066
1067#ifdef DESKTOP_VERSION 1067#ifdef DESKTOP_VERSION
1068 i18n("Desktop Edition\n") + 1068 i18n("Desktop Edition\n") +
1069#else 1069#else
1070 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + 1070 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") +
1071#endif 1071#endif
1072 i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); 1072 i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") );
1073} 1073}
1074void MainWindow::keyBindings() 1074void MainWindow::keyBindings()
1075{ 1075{
1076 QString cap = i18n("Key bindings KOrganizer/Pi"); 1076 QString cap = i18n("Key bindings KOrganizer/Pi");
1077 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1077 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1078 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1078 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1079 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1079 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1080 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1080 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1081 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1081 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1082 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1082 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1083 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1083 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1084 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1084 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+
1085 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1085 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1086 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1086 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1087 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1087 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1088 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1088 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1089 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1089 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1090 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1090 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+
1091 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1091 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1092 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1092 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1093 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1093 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1094 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1094 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1095 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1095 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1096 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1096 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1097 i18n("<p><h3>In agenda view:</h3></p>\n") + 1097 i18n("<p><h3>In agenda view:</h3></p>\n") +
1098 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1098 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1099 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1099 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1100 i18n("<p><h3>In todo view:</h3></p>\n") + 1100 i18n("<p><h3>In todo view:</h3></p>\n") +
1101 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1101 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1102 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1102 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1103 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1103 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1104 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1104 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1105 i18n("<p><h3>In list view:</h3></p>\n") + 1105 i18n("<p><h3>In list view:</h3></p>\n") +
1106 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1106 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1107 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1107 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1108 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1108 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1109 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1109 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1110 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1110 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1111 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1111 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1112 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1112 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1113 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1113 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1114 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1114 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1115 i18n("<p><b>E</b>: Edit item</p>\n") + 1115 i18n("<p><b>E</b>: Edit item</p>\n") +
1116 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1116 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1117 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1117 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1118 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1118 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1119 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1119 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1120 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1120 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1121 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1121 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1122 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1122 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1123 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1123 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1124 i18n("<p><b>White</b>: Item readonly</p>\n"); 1124 i18n("<p><b>White</b>: Item readonly</p>\n");
1125 displayText( text, cap); 1125 displayText( text, cap);
1126 1126
1127} 1127}
1128void MainWindow::aboutAutoSaving() 1128void MainWindow::aboutAutoSaving()
1129{ 1129{
1130 QMessageBox* msg; 1130 QMessageBox* msg;
1131 msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), 1131 msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"),
1132 i18n("After changing something, the data is\nautomatically saved to the file\n~/Applications/korganizer/calendar/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon, 1132 i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon,
1133 QMessageBox::Ok, 1133 QMessageBox::Ok,
1134 QMessageBox::NoButton, 1134 QMessageBox::NoButton,
1135 QMessageBox::NoButton); 1135 QMessageBox::NoButton);
1136 msg->exec(); 1136 msg->exec();
1137 delete msg; 1137 delete msg;
1138 1138
1139 1139
1140} 1140}
1141void MainWindow::aboutKnownBugs() 1141void MainWindow::aboutKnownBugs()
1142{ 1142{
1143 QMessageBox* msg; 1143 QMessageBox* msg;
1144 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1144 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1145 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1145 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1146 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1146 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1147 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + 1147 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") +
1148 i18n("\nor report them in the bugtracker on\n") + 1148 i18n("\nor report them in the bugtracker on\n") +
1149 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1149 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1150 QMessageBox::NoIcon, 1150 QMessageBox::NoIcon,
1151 QMessageBox::Ok, 1151 QMessageBox::Ok,
1152 QMessageBox::NoButton, 1152 QMessageBox::NoButton,
1153 QMessageBox::NoButton); 1153 QMessageBox::NoButton);
1154 msg->exec(); 1154 msg->exec();
1155 delete msg; 1155 delete msg;
1156 1156
1157} 1157}
1158 1158
1159QString MainWindow::defaultFileName() 1159QString MainWindow::defaultFileName()
1160{ 1160{
1161 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1161 return locateLocal( "data", "korganizer/mycalendar.ics" );
1162} 1162}
1163 1163
1164void MainWindow::processIncidenceSelection( Incidence *incidence ) 1164void MainWindow::processIncidenceSelection( Incidence *incidence )
1165{ 1165{
1166 if ( !incidence ) { 1166 if ( !incidence ) {
1167 enableIncidenceActions( false ); 1167 enableIncidenceActions( false );
1168 1168
1169 mNewSubTodoAction->setEnabled( false ); 1169 mNewSubTodoAction->setEnabled( false );
1170 setCaptionToDates(); 1170 setCaptionToDates();
1171 return; 1171 return;
1172 1172
1173 } 1173 }
1174 1174
1175 //KGlobal::locale()->formatDateTime(nextA, true); 1175 //KGlobal::locale()->formatDateTime(nextA, true);
1176 QString startString = ""; 1176 QString startString = "";
1177 if ( incidence->type() != "Todo" ) { 1177 if ( incidence->type() != "Todo" ) {
1178 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1178 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1179 if ( incidence->doesFloat() ) { 1179 if ( incidence->doesFloat() ) {
1180 startString += ": "+incidence->dtStartDateStr( true ); 1180 startString += ": "+incidence->dtStartDateStr( true );
1181 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1181 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1182 1182
1183 } else { 1183 } else {
1184 startString = ": "+incidence->dtStartStr(true); 1184 startString = ": "+incidence->dtStartStr(true);
1185 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1185 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1186 1186
1187 } 1187 }
1188 1188
1189 } else { 1189 } else {
1190 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1190 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1191 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1191 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1192 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1192 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1193 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1193 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1194 } 1194 }
1195 1195
1196 } 1196 }
1197 else 1197 else
1198 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1198 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1199 if ( !incidence->location().isEmpty() ) 1199 if ( !incidence->location().isEmpty() )
1200 startString += " (" +incidence->location()+")"; 1200 startString += " (" +incidence->location()+")";
1201 setCaption( incidence->summary()+startString); 1201 setCaption( incidence->summary()+startString);
1202 1202
1203 enableIncidenceActions( true ); 1203 enableIncidenceActions( true );
1204 1204
1205 if ( incidence->type() == "Event" ) { 1205 if ( incidence->type() == "Event" ) {
1206 mShowAction->setText( i18n("Show Event...") ); 1206 mShowAction->setText( i18n("Show Event...") );
1207 mEditAction->setText( i18n("Edit Event...") ); 1207 mEditAction->setText( i18n("Edit Event...") );
1208 mDeleteAction->setText( i18n("Delete Event...") ); 1208 mDeleteAction->setText( i18n("Delete Event...") );
1209 1209
1210 mNewSubTodoAction->setEnabled( false ); 1210 mNewSubTodoAction->setEnabled( false );
1211 } else if ( incidence->type() == "Todo" ) { 1211 } else if ( incidence->type() == "Todo" ) {
1212 mShowAction->setText( i18n("Show Todo...") ); 1212 mShowAction->setText( i18n("Show Todo...") );
1213 mEditAction->setText( i18n("Edit Todo...") ); 1213 mEditAction->setText( i18n("Edit Todo...") );
1214 mDeleteAction->setText( i18n("Delete Todo...") ); 1214 mDeleteAction->setText( i18n("Delete Todo...") );
1215 1215
1216 mNewSubTodoAction->setEnabled( true ); 1216 mNewSubTodoAction->setEnabled( true );
1217 } else { 1217 } else {
1218 mShowAction->setText( i18n("Show...") ); 1218 mShowAction->setText( i18n("Show...") );
1219 mShowAction->setText( i18n("Edit...") ); 1219 mShowAction->setText( i18n("Edit...") );
1220 mShowAction->setText( i18n("Delete...") ); 1220 mShowAction->setText( i18n("Delete...") );
1221 1221
1222 mNewSubTodoAction->setEnabled( false ); 1222 mNewSubTodoAction->setEnabled( false );
1223 } 1223 }
1224} 1224}
1225 1225
1226void MainWindow::enableIncidenceActions( bool enabled ) 1226void MainWindow::enableIncidenceActions( bool enabled )
1227{ 1227{
1228 mShowAction->setEnabled( enabled ); 1228 mShowAction->setEnabled( enabled );
1229 mEditAction->setEnabled( enabled ); 1229 mEditAction->setEnabled( enabled );
1230 mDeleteAction->setEnabled( enabled ); 1230 mDeleteAction->setEnabled( enabled );
1231} 1231}
1232 1232
1233void MainWindow::importOL() 1233void MainWindow::importOL()
1234{ 1234{
1235#ifdef _WIN32_ 1235#ifdef _WIN32_
1236 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1236 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1237 id->exec(); 1237 id->exec();
1238 delete id; 1238 delete id;
1239 mView->updateView(); 1239 mView->updateView();
1240#endif 1240#endif
1241} 1241}
1242void MainWindow::importBday() 1242void MainWindow::importBday()
1243{ 1243{
1244 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1244 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1245 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1245 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1246 i18n("Import!"), i18n("Cancel"), 0, 1246 i18n("Import!"), i18n("Cancel"), 0,
1247 0, 1 ); 1247 0, 1 );
1248 if ( result == 0 ) { 1248 if ( result == 0 ) {
1249 mView->importBday(); 1249 mView->importBday();
1250 1250
1251 } 1251 }
1252 1252
1253 1253
1254} 1254}
1255void MainWindow::importQtopia() 1255void MainWindow::importQtopia()
1256{ 1256{
1257#ifndef DESKTOP_VERSION 1257#ifndef DESKTOP_VERSION
1258 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1258 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1259 i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), 1259 i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"),
1260 i18n("Import!"), i18n("Cancel"), 0, 1260 i18n("Import!"), i18n("Cancel"), 0,
1261 0, 1 ); 1261 0, 1 );
1262 if ( result == 0 ) { 1262 if ( result == 0 ) {
1263 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1263 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1264 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1264 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1265 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1265 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1266 mView->importQtopia( categories, datebook, todolist ); 1266 mView->importQtopia( categories, datebook, todolist );
1267 } 1267 }
1268#else 1268#else
1269 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1269 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1270 i18n("Not supported \non desktop!\n"), 1270 i18n("Not supported \non desktop!\n"),
1271 i18n("Ok"), i18n("Cancel"), 0, 1271 i18n("Ok"), i18n("Cancel"), 0,
1272 0, 1 ); 1272 0, 1 );
1273 1273
1274#endif 1274#endif
1275} 1275}
1276 1276
1277void MainWindow::saveOnClose() 1277void MainWindow::saveOnClose()
1278{ 1278{
1279 KOPrefs *p = KOPrefs::instance(); 1279 KOPrefs *p = KOPrefs::instance();
1280 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1280 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1281 p->mToolBarUp = iconToolBar->x() > width()/2 || 1281 p->mToolBarUp = iconToolBar->x() > width()/2 ||
1282 iconToolBar->y() > height()/2; 1282 iconToolBar->y() > height()/2;
1283 mView->writeSettings(); 1283 mView->writeSettings();
1284 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1284 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1285 save(); 1285 save();
1286} 1286}
1287void MainWindow::slotModifiedChanged( bool changed ) 1287void MainWindow::slotModifiedChanged( bool changed )
1288{ 1288{
1289 if ( mBlockAtStartup ) 1289 if ( mBlockAtStartup )
1290 return; 1290 return;
1291 int msec; 1291 int msec;
1292 // we store the changes after 1 minute, 1292 // we store the changes after 1 minute,
1293 // and for safety reasons after 10 minutes again 1293 // and for safety reasons after 10 minutes again
1294 if ( !mBlockSaveFlag ) 1294 if ( !mBlockSaveFlag )
1295 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1295 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1296 else 1296 else
1297 msec = 1000 * 600; 1297 msec = 1000 * 600;
1298 mSaveTimer.start( msec, true ); // 1 minute 1298 mSaveTimer.start( msec, true ); // 1 minute
1299 qDebug("KO: Saving File in %d secs!", msec/1000); 1299 qDebug("KO: Saving File in %d secs!", msec/1000);
1300 mCalendarModifiedFlag = true; 1300 mCalendarModifiedFlag = true;
1301} 1301}
1302#include <qfileinfo.h> 1302#include <qfileinfo.h>
1303void MainWindow::save() 1303void MainWindow::save()
1304{ 1304{
1305 if ( mBlockSaveFlag ) 1305 if ( mBlockSaveFlag )
1306 return; 1306 return;
1307 bool store = mBlockSaveFlag; 1307 bool store = mBlockSaveFlag;
1308 mBlockSaveFlag = true; 1308 mBlockSaveFlag = true;
1309 if ( mView->checkFileVersion( defaultFileName()) ) { 1309 if ( mView->checkFileVersion( defaultFileName()) ) {
1310 1310
1311 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1311 QTime neededSaveTime = QDateTime::currentDateTime().time();
1312 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1312 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1313 qDebug("KO: Start saving data to file!"); 1313 qDebug("KO: Start saving data to file!");
1314 mView->saveCalendar( defaultFileName() ); 1314 mView->saveCalendar( defaultFileName() );
1315 1315
1316 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1316 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1317 mView->setLoadedFileVersion(QDateTime::currentDateTime()); 1317 mView->setLoadedFileVersion(QDateTime::currentDateTime());
1318 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1318 qDebug("KO: Needed %d ms for saving.",msNeeded );
1319 QString savemes; 1319 QString savemes;
1320 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1320 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1321 setCaption(savemes); 1321 setCaption(savemes);
1322 } else 1322 } else
1323 setCaption(i18n("Saving cancelled!")); 1323 setCaption(i18n("Saving cancelled!"));
1324 mCalendarModifiedFlag = false; 1324 mCalendarModifiedFlag = false;