summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-07-10 10:29:33 (UTC)
committer zautrix <zautrix>2004-07-10 10:29:33 (UTC)
commitabac12317e02aa83579102d04a75e027e45ec667 (patch) (unidiff)
tree2348fa00a852184b4d0e6b6ab9e882918b8d0748
parentadaa664ac87d6b78e9431d3376f7a24461edf469 (diff)
downloadkdepimpi-abac12317e02aa83579102d04a75e027e45ec667.zip
kdepimpi-abac12317e02aa83579102d04a75e027e45ec667.tar.gz
kdepimpi-abac12317e02aa83579102d04a75e027e45ec667.tar.bz2
Turned on internal alarm on dektop as default
Diffstat (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
@@ -1,555 +1,559 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qfont.h> 32#include <qfont.h>
33#include <qcolor.h> 33#include <qcolor.h>
34#include <qstringlist.h> 34#include <qstringlist.h>
35#include <stdlib.h> 35#include <stdlib.h>
36 36
37#include <kglobal.h> 37#include <kglobal.h>
38#include <kconfig.h> 38#include <kconfig.h>
39#include <klocale.h> 39#include <klocale.h>
40#include <kdebug.h> 40#include <kdebug.h>
41#include <kemailsettings.h> 41#include <kemailsettings.h>
42#include <kstaticdeleter.h> 42#include <kstaticdeleter.h>
43 43
44#include "koprefs.h" 44#include "koprefs.h"
45#include "mainwindow.h" 45#include "mainwindow.h"
46 46
47const char *germanwords[][2] = { 47const char *germanwords[][2] = {
48#include "wordsgerman.h" 48#include "wordsgerman.h"
49 "", "" 49 "", ""
50}; 50};
51 51
52KOPrefs *KOPrefs::mInstance = 0; 52KOPrefs *KOPrefs::mInstance = 0;
53static KStaticDeleter<KOPrefs> insd; 53static KStaticDeleter<KOPrefs> insd;
54 54
55KOPrefs::KOPrefs() : 55KOPrefs::KOPrefs() :
56 KPimPrefs("korganizerrc") 56 KPimPrefs("korganizerrc")
57{ 57{
58 mCategoryColors.setAutoDelete(true); 58 mCategoryColors.setAutoDelete(true);
59 mLocaleDict = 0; 59 mLocaleDict = 0;
60 fillMailDefaults(); 60 fillMailDefaults();
61 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 61 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
62 QColor defaultHolidayColor = QColor(255,0,0); 62 QColor defaultHolidayColor = QColor(255,0,0);
63 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 63 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
64 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 64 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
65 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 65 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
66 QColor defaultTodoDueTodayColor = QColor(255,220,100); 66 QColor defaultTodoDueTodayColor = QColor(255,220,100);
67 QColor defaultTodoOverdueColor = QColor(255,153,125); 67 QColor defaultTodoOverdueColor = QColor(255,153,125);
68 68
69 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 69 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
70 mDefaultViewFont = QFont("helvetica",10); 70 mDefaultViewFont = QFont("helvetica",10);
71 mDefaultMonthViewFont = QFont("helvetica",8); 71 mDefaultMonthViewFont = QFont("helvetica",8);
72 mMarcusBainsFont= QFont("helvetica",10); 72 mMarcusBainsFont= QFont("helvetica",10);
73 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 73 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
74 mEditBoxFont = QFont("helvetica",12); 74 mEditBoxFont = QFont("helvetica",12);
75 mJornalViewFont = QFont("helvetica",12); 75 mJornalViewFont = QFont("helvetica",12);
76 76
77 KPrefs::setCurrentGroup("General"); 77 KPrefs::setCurrentGroup("General");
78 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 78 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
79 79
80 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 80 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
81 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 81 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
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();
467 471
468 config()->setGroup("Personal Settings"); 472 config()->setGroup("Personal Settings");
469 mName = config()->readEntry("user_name",""); 473 mName = config()->readEntry("user_name","");
470 mEmail = config()->readEntry("user_email",""); 474 mEmail = config()->readEntry("user_email","");
471 fillMailDefaults(); 475 fillMailDefaults();
472 476
473 config()->setGroup("Category Colors"); 477 config()->setGroup("Category Colors");
474 QStringList::Iterator it; 478 QStringList::Iterator it;
475 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 479 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
476 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 480 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
477 481
478 } 482 }
479 483
480 if (mTimeZoneId.isEmpty()) { 484 if (mTimeZoneId.isEmpty()) {
481 setTimeZoneIdDefault(); 485 setTimeZoneIdDefault();
482 } 486 }
483 KPimPrefs::usrReadConfig(); 487 KPimPrefs::usrReadConfig();
484} 488}
485 489
486 490
487void KOPrefs::usrWriteConfig() 491void KOPrefs::usrWriteConfig()
488{ 492{
489 config()->setGroup("General"); 493 config()->setGroup("General");
490 config()->writeEntry("Custom Categories",mCustomCategories); 494 config()->writeEntry("Custom Categories",mCustomCategories);
491 495
492 config()->setGroup("Personal Settings"); 496 config()->setGroup("Personal Settings");
493 config()->writeEntry("user_name",mName); 497 config()->writeEntry("user_name",mName);
494 config()->writeEntry("user_email",mEmail); 498 config()->writeEntry("user_email",mEmail);
495 499
496 config()->setGroup("Category Colors"); 500 config()->setGroup("Category Colors");
497 QDictIterator<QColor> it(mCategoryColors); 501 QDictIterator<QColor> it(mCategoryColors);
498 while (it.current()) { 502 while (it.current()) {
499 config()->writeEntry(it.currentKey(),*(it.current())); 503 config()->writeEntry(it.currentKey(),*(it.current()));
500 ++it; 504 ++it;
501 } 505 }
502 506
503 507
504 KPimPrefs::usrWriteConfig(); 508 KPimPrefs::usrWriteConfig();
505} 509}
506 510
507void KOPrefs::setCategoryColor(QString cat,const QColor & color) 511void KOPrefs::setCategoryColor(QString cat,const QColor & color)
508{ 512{
509 mCategoryColors.replace(cat,new QColor(color)); 513 mCategoryColors.replace(cat,new QColor(color));
510} 514}
511 515
512QColor *KOPrefs::categoryColor(QString cat) 516QColor *KOPrefs::categoryColor(QString cat)
513{ 517{
514 QColor *color = 0; 518 QColor *color = 0;
515 519
516 if (!cat.isEmpty()) color = mCategoryColors[cat]; 520 if (!cat.isEmpty()) color = mCategoryColors[cat];
517 521
518 if (color) return color; 522 if (color) return color;
519 else return &mDefaultCategoryColor; 523 else return &mDefaultCategoryColor;
520} 524}
521 525
522void KOPrefs::setFullName(const QString &name) 526void KOPrefs::setFullName(const QString &name)
523{ 527{
524 mName = name; 528 mName = name;
525} 529}
526 530
527void KOPrefs::setEmail(const QString &email) 531void KOPrefs::setEmail(const QString &email)
528{ 532{
529 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 533 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
530 mEmail = email; 534 mEmail = email;
531} 535}
532 536
533QString KOPrefs::fullName() 537QString KOPrefs::fullName()
534{ 538{
535 if (mEmailControlCenter) { 539 if (mEmailControlCenter) {
536 KEMailSettings settings; 540 KEMailSettings settings;
537 return settings.getSetting(KEMailSettings::RealName); 541 return settings.getSetting(KEMailSettings::RealName);
538 } else { 542 } else {
539 return mName; 543 return mName;
540 } 544 }
541} 545}
542 546
543QString KOPrefs::email() 547QString KOPrefs::email()
544{ 548{
545 if (mEmailControlCenter) { 549 if (mEmailControlCenter) {
546 KEMailSettings settings; 550 KEMailSettings settings;
547 return settings.getSetting(KEMailSettings::EmailAddress); 551 return settings.getSetting(KEMailSettings::EmailAddress);
548 } else { 552 } else {
549 return mEmail; 553 return mEmail;
550 } 554 }
551} 555}
552KConfig* KOPrefs::getConfig() 556KConfig* KOPrefs::getConfig()
553{ 557{
554 return config(); 558 return config();
555} 559}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index be69be7..a487f14 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -108,1887 +108,1887 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
108#ifndef DESKTOP_VERSION 108#ifndef DESKTOP_VERSION
109 showMaximized(); 109 showMaximized();
110#endif 110#endif
111 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 111 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
112 setDefaultPreferences(); 112 setDefaultPreferences();
113 mCalendar = new CalendarLocal(); 113 mCalendar = new CalendarLocal();
114 mView = new CalendarView( mCalendar, this,"mCalendar " ); 114 mView = new CalendarView( mCalendar, this,"mCalendar " );
115 mView->hide(); 115 mView->hide();
116 //mView->resize(splash->size() ); 116 //mView->resize(splash->size() );
117 initActions(); 117 initActions();
118#ifndef DESKTOP_VERSION 118#ifndef DESKTOP_VERSION
119 iconToolBar->show(); 119 iconToolBar->show();
120 qApp->processEvents(); 120 qApp->processEvents();
121#endif 121#endif
122 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 122 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
123 int vh = height() ; 123 int vh = height() ;
124 int vw = width(); 124 int vw = width();
125 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 125 //qDebug("Toolbar hei %d ",iconToolBar->height() );
126 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 126 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
127 vh -= iconToolBar->height(); 127 vh -= iconToolBar->height();
128 } else { 128 } else {
129 vw -= iconToolBar->height(); 129 vw -= iconToolBar->height();
130 } 130 }
131 //mView->setMaximumSize( splash->size() ); 131 //mView->setMaximumSize( splash->size() );
132 //mView->resize( splash->size() ); 132 //mView->resize( splash->size() );
133 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 133 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
134 mView->readSettings(); 134 mView->readSettings();
135 bool oldOpened = false; 135 bool oldOpened = false;
136 bool newFile = false; 136 bool newFile = false;
137 if( !QFile::exists( defaultFileName() ) ) { 137 if( !QFile::exists( defaultFileName() ) ) {
138 QFileInfo finfo ( defaultFileName() ); 138 QFileInfo finfo ( defaultFileName() );
139 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 139 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
140 qDebug("oldfile %s ", oldFile.latin1()); 140 qDebug("oldfile %s ", oldFile.latin1());
141 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 141 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
142 finfo.setFile( oldFile ); 142 finfo.setFile( oldFile );
143 if (finfo.exists() ) { 143 if (finfo.exists() ) {
144 KMessageBox::information( this, message); 144 KMessageBox::information( this, message);
145 mView->openCalendar( oldFile ); 145 mView->openCalendar( oldFile );
146 qApp->processEvents(); 146 qApp->processEvents();
147 } else { 147 } else {
148 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 148 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
149 finfo.setFile( oldFile ); 149 finfo.setFile( oldFile );
150 if (finfo.exists() ) { 150 if (finfo.exists() ) {
151 KMessageBox::information( this, message); 151 KMessageBox::information( this, message);
152 mView->openCalendar( oldFile ); 152 mView->openCalendar( oldFile );
153 qApp->processEvents(); 153 qApp->processEvents();
154 } 154 }
155 } 155 }
156 mView->saveCalendar( defaultFileName() ); 156 mView->saveCalendar( defaultFileName() );
157 newFile = true; 157 newFile = true;
158 } 158 }
159 159
160 QTime neededSaveTime = QDateTime::currentDateTime().time(); 160 QTime neededSaveTime = QDateTime::currentDateTime().time();
161 if ( ! oldOpened ) 161 if ( ! oldOpened )
162 mView->openCalendar( defaultFileName() ); 162 mView->openCalendar( defaultFileName() );
163 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 163 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
164 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 164 qDebug("KO: Calendar loading time: %d ms",msNeeded );
165 165
166 if ( KOPrefs::instance()->mLanguageChanged ) { 166 if ( KOPrefs::instance()->mLanguageChanged ) {
167 KOPrefs::instance()->setCategoryDefaults(); 167 KOPrefs::instance()->setCategoryDefaults();
168 int count = mView->addCategories(); 168 int count = mView->addCategories();
169 KOPrefs::instance()->mLanguageChanged = false; 169 KOPrefs::instance()->mLanguageChanged = false;
170 } 170 }
171 processIncidenceSelection( 0 ); 171 processIncidenceSelection( 0 );
172 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 172 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
173 SLOT( processIncidenceSelection( Incidence * ) ) ); 173 SLOT( processIncidenceSelection( Incidence * ) ) );
174 connect( mView, SIGNAL( modifiedChanged( bool ) ), 174 connect( mView, SIGNAL( modifiedChanged( bool ) ),
175 SLOT( slotModifiedChanged( bool ) ) ); 175 SLOT( slotModifiedChanged( bool ) ) );
176 176
177 177
178 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 178 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
179 mView->setModified( false ); 179 mView->setModified( false );
180 mBlockAtStartup = false; 180 mBlockAtStartup = false;
181 mView->setModified( false ); 181 mView->setModified( false );
182 setCentralWidget( mView ); 182 setCentralWidget( mView );
183 globalFlagBlockStartup = 0; 183 globalFlagBlockStartup = 0;
184 mView->show(); 184 mView->show();
185 delete splash; 185 delete splash;
186 if ( newFile ) 186 if ( newFile )
187 mView->updateConfig(); 187 mView->updateConfig();
188 // qApp->processEvents(); 188 // qApp->processEvents();
189 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 189 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
190 fillSyncMenu(); 190 fillSyncMenu();
191 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 191 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
192 if ( showWarning ) { 192 if ( showWarning ) {
193 KMessageBox::information( this, 193 KMessageBox::information( this,
194 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 194 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
195 qApp->processEvents(); 195 qApp->processEvents();
196 mView->dialogManager()->showSyncOptions(); 196 mView->dialogManager()->showSyncOptions();
197 } 197 }
198} 198}
199MainWindow::~MainWindow() 199MainWindow::~MainWindow()
200{ 200{
201 //qDebug("MainWindow::~MainWindow() "); 201 //qDebug("MainWindow::~MainWindow() ");
202 //save toolbar location 202 //save toolbar location
203 203
204 delete mCalendar; 204 delete mCalendar;
205 delete KOPrefs::instance(); 205 delete KOPrefs::instance();
206 delete KIncidenceFormatter::instance(); 206 delete KIncidenceFormatter::instance();
207 207
208 208
209} 209}
210void MainWindow::closeEvent( QCloseEvent* ce ) 210void MainWindow::closeEvent( QCloseEvent* ce )
211{ 211{
212 212
213 213
214 214
215 if ( ! KOPrefs::instance()->mAskForQuit ) { 215 if ( ! KOPrefs::instance()->mAskForQuit ) {
216 saveOnClose(); 216 saveOnClose();
217 ce->accept(); 217 ce->accept();
218 return; 218 return;
219 219
220 } 220 }
221 221
222 switch( QMessageBox::information( this, "KO/Pi", 222 switch( QMessageBox::information( this, "KO/Pi",
223 i18n("Do you really want\nto close KO/Pi?"), 223 i18n("Do you really want\nto close KO/Pi?"),
224 i18n("Close"), i18n("No"), 224 i18n("Close"), i18n("No"),
225 0, 0 ) ) { 225 0, 0 ) ) {
226 case 0: 226 case 0:
227 saveOnClose(); 227 saveOnClose();
228 ce->accept(); 228 ce->accept();
229 break; 229 break;
230 case 1: 230 case 1:
231 ce->ignore(); 231 ce->ignore();
232 break; 232 break;
233 case 2: 233 case 2:
234 234
235 default: 235 default:
236 break; 236 break;
237 } 237 }
238 238
239 239
240} 240}
241 241
242void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 242void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
243{ 243{
244 QDataStream stream( data, IO_ReadOnly ); 244 QDataStream stream( data, IO_ReadOnly );
245 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 245 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
246 //QString datamess; 246 //QString datamess;
247 //qDebug("message "); 247 //qDebug("message ");
248 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 248 qDebug("KO: QCOP message received: %s ", cmsg.data() );
249 if ( cmsg == "-writeFile" ) { 249 if ( cmsg == "-writeFile" ) {
250 // I made from the "-writeFile" an "-writeAlarm" 250 // I made from the "-writeFile" an "-writeAlarm"
251 mView->viewManager()->showWhatsNextView(); 251 mView->viewManager()->showWhatsNextView();
252 mCalendar->checkAlarmForIncidence( 0, true); 252 mCalendar->checkAlarmForIncidence( 0, true);
253 showMaximized(); 253 showMaximized();
254 raise(); 254 raise();
255 return; 255 return;
256 256
257 } 257 }
258 if ( cmsg == "-writeFileSilent" ) { 258 if ( cmsg == "-writeFileSilent" ) {
259 // I made from the "-writeFile" an "-writeAlarm" 259 // I made from the "-writeFile" an "-writeAlarm"
260 // mView->viewManager()->showWhatsNextView(); 260 // mView->viewManager()->showWhatsNextView();
261 mCalendar->checkAlarmForIncidence( 0, true); 261 mCalendar->checkAlarmForIncidence( 0, true);
262 //showMaximized(); 262 //showMaximized();
263 //raise(); 263 //raise();
264 hide(); 264 hide();
265 return; 265 return;
266 } 266 }
267 if ( cmsg == "-newCountdown" ) { 267 if ( cmsg == "-newCountdown" ) {
268 qDebug("newCountdown "); 268 qDebug("newCountdown ");
269 269
270 } 270 }
271 QString msg ; 271 QString msg ;
272 QString allmsg = cmsg; 272 QString allmsg = cmsg;
273 while ( allmsg.length() > 0 ) { 273 while ( allmsg.length() > 0 ) {
274 int nextC = allmsg.find( "-", 1 ); 274 int nextC = allmsg.find( "-", 1 );
275 if ( nextC == -1 ) { 275 if ( nextC == -1 ) {
276 msg = allmsg; 276 msg = allmsg;
277 allmsg = ""; 277 allmsg = "";
278 } else{ 278 } else{
279 msg = allmsg.left( nextC ); 279 msg = allmsg.left( nextC );
280 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 280 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
281 } 281 }
282 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 282 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
283 if ( msg == "-newEvent" ) { 283 if ( msg == "-newEvent" ) {
284 mView->newEvent(); 284 mView->newEvent();
285 } 285 }
286 if ( msg == "-newTodo" ) { 286 if ( msg == "-newTodo" ) {
287 mView->newTodo(); 287 mView->newTodo();
288 288
289 } 289 }
290 if ( msg == "-showWN" ) { 290 if ( msg == "-showWN" ) {
291 mView->viewManager()->showWhatsNextView(); 291 mView->viewManager()->showWhatsNextView();
292 } 292 }
293 if ( msg == "-showTodo" ) { 293 if ( msg == "-showTodo" ) {
294 mView->viewManager()->showTodoView(); 294 mView->viewManager()->showTodoView();
295 } 295 }
296 if ( msg == "-showList" ) { 296 if ( msg == "-showList" ) {
297 mView->viewManager()->showListView(); 297 mView->viewManager()->showListView();
298 } 298 }
299 else if ( msg == "-showDay" ) { 299 else if ( msg == "-showDay" ) {
300 mView->viewManager()->showDayView(); 300 mView->viewManager()->showDayView();
301 } 301 }
302 else if ( msg == "-showWWeek" ) { 302 else if ( msg == "-showWWeek" ) {
303 mView->viewManager()->showWorkWeekView(); 303 mView->viewManager()->showWorkWeekView();
304 } 304 }
305 else if ( msg == "-ringSync" ) { 305 else if ( msg == "-ringSync" ) {
306 multiSync( false ); 306 multiSync( false );
307 } 307 }
308 else if ( msg == "-showWeek" ) { 308 else if ( msg == "-showWeek" ) {
309 mView->viewManager()->showWeekView(); 309 mView->viewManager()->showWeekView();
310 } 310 }
311 else if ( msg == "-showTodo" ) { 311 else if ( msg == "-showTodo" ) {
312 mView->viewManager()->showTodoView(); 312 mView->viewManager()->showTodoView();
313 } 313 }
314 else if ( msg == "-showJournal" ) { 314 else if ( msg == "-showJournal" ) {
315 mView->dateNavigator()->selectDates( 1 ); 315 mView->dateNavigator()->selectDates( 1 );
316 mView->dateNavigator()->selectToday(); 316 mView->dateNavigator()->selectToday();
317 mView->viewManager()->showJournalView(); 317 mView->viewManager()->showJournalView();
318 } 318 }
319 else if ( msg == "-showKO" ) { 319 else if ( msg == "-showKO" ) {
320 mView->viewManager()->showNextXView(); 320 mView->viewManager()->showNextXView();
321 } 321 }
322 else if ( msg == "-showWNext" || msg == "nextView()" ) { 322 else if ( msg == "-showWNext" || msg == "nextView()" ) {
323 mView->viewManager()->showWhatsNextView(); 323 mView->viewManager()->showWhatsNextView();
324 } 324 }
325 else if ( msg == "-showNextXView" ) { 325 else if ( msg == "-showNextXView" ) {
326 mView->viewManager()->showNextXView(); 326 mView->viewManager()->showNextXView();
327 } 327 }
328 328
329 329
330 } 330 }
331 331
332 showMaximized(); 332 showMaximized();
333 raise(); 333 raise();
334} 334}
335 335
336QPixmap MainWindow::loadPixmap( QString name ) 336QPixmap MainWindow::loadPixmap( QString name )
337{ 337{
338 return SmallIcon( name ); 338 return SmallIcon( name );
339 339
340} 340}
341void MainWindow::initActions() 341void MainWindow::initActions()
342{ 342{
343 //KOPrefs::instance()->mShowFullMenu 343 //KOPrefs::instance()->mShowFullMenu
344 iconToolBar->clear(); 344 iconToolBar->clear();
345 KOPrefs *p = KOPrefs::instance(); 345 KOPrefs *p = KOPrefs::instance();
346 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 346 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
347 347
348 QPopupMenu *viewMenu = new QPopupMenu( this ); 348 QPopupMenu *viewMenu = new QPopupMenu( this );
349 QPopupMenu *actionMenu = new QPopupMenu( this ); 349 QPopupMenu *actionMenu = new QPopupMenu( this );
350 QPopupMenu *importMenu = new QPopupMenu( this ); 350 QPopupMenu *importMenu = new QPopupMenu( this );
351 351
352 syncMenu = new QPopupMenu( this ); 352 syncMenu = new QPopupMenu( this );
353 configureAgendaMenu = new QPopupMenu( this ); 353 configureAgendaMenu = new QPopupMenu( this );
354 configureToolBarMenu = new QPopupMenu( this ); 354 configureToolBarMenu = new QPopupMenu( this );
355 QPopupMenu *helpMenu = new QPopupMenu( this ); 355 QPopupMenu *helpMenu = new QPopupMenu( this );
356 if ( KOPrefs::instance()->mShowFullMenu ) { 356 if ( KOPrefs::instance()->mShowFullMenu ) {
357 QMenuBar *menuBar1; 357 QMenuBar *menuBar1;
358 menuBar1 = menuBar(); 358 menuBar1 = menuBar();
359 menuBar1->insertItem( i18n("File"), importMenu ); 359 menuBar1->insertItem( i18n("File"), importMenu );
360 menuBar1->insertItem( i18n("View"), viewMenu ); 360 menuBar1->insertItem( i18n("View"), viewMenu );
361 menuBar1->insertItem( i18n("Actions"), actionMenu ); 361 menuBar1->insertItem( i18n("Actions"), actionMenu );
362 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 362 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
363 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 363 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
364 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 364 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
365 menuBar1->insertItem( i18n("Help"), helpMenu ); 365 menuBar1->insertItem( i18n("Help"), helpMenu );
366 } else { 366 } else {
367 QPEMenuBar *menuBar1; 367 QPEMenuBar *menuBar1;
368 menuBar1 = new QPEMenuBar( iconToolBar ); 368 menuBar1 = new QPEMenuBar( iconToolBar );
369 QPopupMenu *menuBar = new QPopupMenu( this ); 369 QPopupMenu *menuBar = new QPopupMenu( this );
370 menuBar1->insertItem( i18n("ME"), menuBar); 370 menuBar1->insertItem( i18n("ME"), menuBar);
371 menuBar->insertItem( i18n("File"), importMenu ); 371 menuBar->insertItem( i18n("File"), importMenu );
372 menuBar->insertItem( i18n("View"), viewMenu ); 372 menuBar->insertItem( i18n("View"), viewMenu );
373 menuBar->insertItem( i18n("Actions"), actionMenu ); 373 menuBar->insertItem( i18n("Actions"), actionMenu );
374 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 374 menuBar->insertItem( i18n("Synchronize"), syncMenu );
375 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 375 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
376 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 376 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
377 menuBar->insertItem( i18n("Help"), helpMenu ); 377 menuBar->insertItem( i18n("Help"), helpMenu );
378 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 378 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
379 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 379 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
380 } 380 }
381 connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) ); 381 connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) );
382 // ****************** 382 // ******************
383 QAction *action; 383 QAction *action;
384 QIconSet icon; 384 QIconSet icon;
385 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 385 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
386 configureToolBarMenu->setCheckable( true ); 386 configureToolBarMenu->setCheckable( true );
387 387
388 QString pathString = ""; 388 QString pathString = "";
389 if ( !p->mToolBarMiniIcons ) { 389 if ( !p->mToolBarMiniIcons ) {
390 if ( QApplication::desktop()->width() < 480 ) 390 if ( QApplication::desktop()->width() < 480 )
391 pathString += "icons16/"; 391 pathString += "icons16/";
392 } else 392 } else
393 pathString += "iconsmini/"; 393 pathString += "iconsmini/";
394 configureAgendaMenu->setCheckable( true ); 394 configureAgendaMenu->setCheckable( true );
395 configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); 395 configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 );
396 configureAgendaMenu->insertSeparator(); 396 configureAgendaMenu->insertSeparator();
397 configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); 397 configureAgendaMenu->insertItem(i18n("Tiny"), 4 );
398 configureAgendaMenu->insertItem(i18n("Small"), 6 ); 398 configureAgendaMenu->insertItem(i18n("Small"), 6 );
399 configureAgendaMenu->insertItem(i18n("Medium"), 8 ); 399 configureAgendaMenu->insertItem(i18n("Medium"), 8 );
400 configureAgendaMenu->insertItem(i18n("Normal"), 10 ); 400 configureAgendaMenu->insertItem(i18n("Normal"), 10 );
401 configureAgendaMenu->insertItem(i18n("Large"), 12 ); 401 configureAgendaMenu->insertItem(i18n("Large"), 12 );
402 configureAgendaMenu->insertItem(i18n("Big"), 14 ); 402 configureAgendaMenu->insertItem(i18n("Big"), 14 );
403 configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); 403 configureAgendaMenu->insertItem(i18n("Bigger"), 16 );
404 configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); 404 configureAgendaMenu->insertItem(i18n("Biggest"), 18 );
405 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 405 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
406 406
407 icon = loadPixmap( pathString + "configure" ); 407 icon = loadPixmap( pathString + "configure" );
408 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 408 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
409 action->addTo( actionMenu ); 409 action->addTo( actionMenu );
410 connect( action, SIGNAL( activated() ), 410 connect( action, SIGNAL( activated() ),
411 mView, SLOT( edit_options() ) ); 411 mView, SLOT( edit_options() ) );
412 actionMenu->insertSeparator(); 412 actionMenu->insertSeparator();
413 icon = loadPixmap( pathString + "newevent" ); 413 icon = loadPixmap( pathString + "newevent" );
414 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 414 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
415 configureToolBarMenu->insertSeparator(); 415 configureToolBarMenu->insertSeparator();
416 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 416 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
417 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 417 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
418 ne_action->addTo( actionMenu ); 418 ne_action->addTo( actionMenu );
419 connect( ne_action, SIGNAL( activated() ), 419 connect( ne_action, SIGNAL( activated() ),
420 mView, SLOT( newEvent() ) ); 420 mView, SLOT( newEvent() ) );
421 icon = loadPixmap( pathString + "newtodo" ); 421 icon = loadPixmap( pathString + "newtodo" );
422 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 422 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
423 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 423 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
424 nt_action->addTo( actionMenu ); 424 nt_action->addTo( actionMenu );
425 connect( nt_action, SIGNAL( activated() ), 425 connect( nt_action, SIGNAL( activated() ),
426 mView, SLOT( newTodo() ) ); 426 mView, SLOT( newTodo() ) );
427 icon = loadPixmap( pathString + "navi" ); 427 icon = loadPixmap( pathString + "navi" );
428 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 428 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
429 action->addTo( viewMenu ); 429 action->addTo( viewMenu );
430 connect( action, SIGNAL( activated() ), 430 connect( action, SIGNAL( activated() ),
431 mView, SLOT( toggleDateNavigatorWidget() ) ); 431 mView, SLOT( toggleDateNavigatorWidget() ) );
432 icon = loadPixmap( pathString + "filter" ); 432 icon = loadPixmap( pathString + "filter" );
433 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 433 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
434 action->addTo( viewMenu ); 434 action->addTo( viewMenu );
435 connect( action, SIGNAL( activated() ), 435 connect( action, SIGNAL( activated() ),
436 mView, SLOT( toggleFilter() ) ); 436 mView, SLOT( toggleFilter() ) );
437 437
438 438
439 viewMenu->insertSeparator(); 439 viewMenu->insertSeparator();
440 icon = loadPixmap( pathString + "picker" ); 440 icon = loadPixmap( pathString + "picker" );
441 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 441 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
442 action->addTo( viewMenu ); 442 action->addTo( viewMenu );
443 connect( action, SIGNAL( activated() ), 443 connect( action, SIGNAL( activated() ),
444 mView, SLOT( showDatePicker() ) ); 444 mView, SLOT( showDatePicker() ) );
445 action->addTo( iconToolBar ); 445 action->addTo( iconToolBar );
446 viewMenu->insertSeparator(); 446 viewMenu->insertSeparator();
447 icon = loadPixmap( pathString + "list" ); 447 icon = loadPixmap( pathString + "list" );
448 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 448 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
449 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 449 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
450 showlist_action->addTo( viewMenu ); 450 showlist_action->addTo( viewMenu );
451 connect( showlist_action, SIGNAL( activated() ), 451 connect( showlist_action, SIGNAL( activated() ),
452 mView->viewManager(), SLOT( showListView() ) ); 452 mView->viewManager(), SLOT( showListView() ) );
453 453
454 454
455 icon = loadPixmap( pathString + "day" ); 455 icon = loadPixmap( pathString + "day" );
456 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 456 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
457 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 457 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
458 day1_action->addTo( viewMenu ); 458 day1_action->addTo( viewMenu );
459 // action->addTo( toolBar ); 459 // action->addTo( toolBar );
460 connect( day1_action, SIGNAL( activated() ), 460 connect( day1_action, SIGNAL( activated() ),
461 mView->viewManager(), SLOT( showDayView() ) ); 461 mView->viewManager(), SLOT( showDayView() ) );
462 462
463 icon = loadPixmap( pathString + "workweek" ); 463 icon = loadPixmap( pathString + "workweek" );
464 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 464 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
465 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 465 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
466 day5_action->addTo( viewMenu ); 466 day5_action->addTo( viewMenu );
467 connect( day5_action, SIGNAL( activated() ), 467 connect( day5_action, SIGNAL( activated() ),
468 mView->viewManager(), SLOT( showWorkWeekView() ) ); 468 mView->viewManager(), SLOT( showWorkWeekView() ) );
469 469
470 icon = loadPixmap( pathString + "week" ); 470 icon = loadPixmap( pathString + "week" );
471 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 471 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
472 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 472 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
473 day7_action->addTo( viewMenu ); 473 day7_action->addTo( viewMenu );
474 connect( day7_action, SIGNAL( activated() ), 474 connect( day7_action, SIGNAL( activated() ),
475 mView->viewManager(), SLOT( showWeekView() ) ); 475 mView->viewManager(), SLOT( showWeekView() ) );
476 476
477 icon = loadPixmap( pathString + "month" ); 477 icon = loadPixmap( pathString + "month" );
478 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 478 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
479 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 479 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
480 month_action->addTo( viewMenu ); 480 month_action->addTo( viewMenu );
481 connect( month_action, SIGNAL( activated() ), 481 connect( month_action, SIGNAL( activated() ),
482 mView->viewManager(), SLOT( showMonthView() ) ); 482 mView->viewManager(), SLOT( showMonthView() ) );
483 483
484 icon = loadPixmap( pathString + "todo" ); 484 icon = loadPixmap( pathString + "todo" );
485 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 485 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
486 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 486 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
487 todoview_action->addTo( viewMenu ); 487 todoview_action->addTo( viewMenu );
488 connect( todoview_action, SIGNAL( activated() ), 488 connect( todoview_action, SIGNAL( activated() ),
489 mView->viewManager(), SLOT( showTodoView() ) ); 489 mView->viewManager(), SLOT( showTodoView() ) );
490 490
491 icon = loadPixmap( pathString + "journal" ); 491 icon = loadPixmap( pathString + "journal" );
492 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 492 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
493 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 493 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
494 viewjournal_action->addTo( viewMenu ); 494 viewjournal_action->addTo( viewMenu );
495 connect( viewjournal_action, SIGNAL( activated() ), 495 connect( viewjournal_action, SIGNAL( activated() ),
496 mView->viewManager(), SLOT( showJournalView() ) ); 496 mView->viewManager(), SLOT( showJournalView() ) );
497 497
498 icon = loadPixmap( pathString + "xdays" ); 498 icon = loadPixmap( pathString + "xdays" );
499 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); 499 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 );
500 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 500 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
501 xdays_action->addTo( viewMenu ); 501 xdays_action->addTo( viewMenu );
502 connect( xdays_action, SIGNAL( activated() ), 502 connect( xdays_action, SIGNAL( activated() ),
503 mView->viewManager(), SLOT( showNextXView() ) ); 503 mView->viewManager(), SLOT( showNextXView() ) );
504 504
505 icon = loadPixmap( pathString + "whatsnext" ); 505 icon = loadPixmap( pathString + "whatsnext" );
506 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); 506 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 );
507 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 507 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
508 whatsnext_action->addTo( viewMenu ); 508 whatsnext_action->addTo( viewMenu );
509 connect( whatsnext_action, SIGNAL( activated() ), 509 connect( whatsnext_action, SIGNAL( activated() ),
510 mView->viewManager(), SLOT( showWhatsNextView() ) ); 510 mView->viewManager(), SLOT( showWhatsNextView() ) );
511 511
512#if 0 512#if 0
513 action = new QAction( "view_timespan", "Time Span", 0, this ); 513 action = new QAction( "view_timespan", "Time Span", 0, this );
514 action->addTo( viewMenu ); 514 action->addTo( viewMenu );
515 connect( action, SIGNAL( activated() ), 515 connect( action, SIGNAL( activated() ),
516 mView->viewManager(), SLOT( showTimeSpanView() ) ); 516 mView->viewManager(), SLOT( showTimeSpanView() ) );
517#endif 517#endif
518 518
519 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 519 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
520 this ); 520 this );
521 mNewSubTodoAction->addTo( actionMenu ); 521 mNewSubTodoAction->addTo( actionMenu );
522 connect( mNewSubTodoAction, SIGNAL( activated() ), 522 connect( mNewSubTodoAction, SIGNAL( activated() ),
523 mView, SLOT( newSubTodo() ) ); 523 mView, SLOT( newSubTodo() ) );
524 524
525 actionMenu->insertSeparator(); 525 actionMenu->insertSeparator();
526 526
527 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 527 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
528 mShowAction->addTo( actionMenu ); 528 mShowAction->addTo( actionMenu );
529 connect( mShowAction, SIGNAL( activated() ), 529 connect( mShowAction, SIGNAL( activated() ),
530 mView, SLOT( showIncidence() ) ); 530 mView, SLOT( showIncidence() ) );
531 531
532 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 532 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
533 mEditAction->addTo( actionMenu ); 533 mEditAction->addTo( actionMenu );
534 connect( mEditAction, SIGNAL( activated() ), 534 connect( mEditAction, SIGNAL( activated() ),
535 mView, SLOT( editIncidence() ) ); 535 mView, SLOT( editIncidence() ) );
536 536
537 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 537 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
538 mDeleteAction->addTo( actionMenu ); 538 mDeleteAction->addTo( actionMenu );
539 connect( mDeleteAction, SIGNAL( activated() ), 539 connect( mDeleteAction, SIGNAL( activated() ),
540 mView, SLOT( deleteIncidence() ) ); 540 mView, SLOT( deleteIncidence() ) );
541 541
542 actionMenu->insertSeparator(); 542 actionMenu->insertSeparator();
543 543
544 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 544 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
545 this ); 545 this );
546 action->addTo( actionMenu ); 546 action->addTo( actionMenu );
547 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 547 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
548 548
549 icon = loadPixmap( pathString + "search" ); 549 icon = loadPixmap( pathString + "search" );
550 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 550 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
551 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); 551 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4);
552 search_action->addTo( actionMenu ); 552 search_action->addTo( actionMenu );
553 connect( search_action, SIGNAL( activated() ), 553 connect( search_action, SIGNAL( activated() ),
554 mView->dialogManager(), SLOT( showSearchDialog() ) ); 554 mView->dialogManager(), SLOT( showSearchDialog() ) );
555 555
556 icon = loadPixmap( pathString + "today" ); 556 icon = loadPixmap( pathString + "today" );
557 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 557 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
558 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 558 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
559 today_action->addTo( actionMenu ); 559 today_action->addTo( actionMenu );
560 connect( today_action, SIGNAL( activated() ), 560 connect( today_action, SIGNAL( activated() ),
561 mView, SLOT( goToday() ) ); 561 mView, SLOT( goToday() ) );
562 562
563 if ( KOPrefs::instance()->mShowFullMenu ) { 563 if ( KOPrefs::instance()->mShowFullMenu ) {
564 actionMenu->insertSeparator(); 564 actionMenu->insertSeparator();
565 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 565 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
566 566
567 } 567 }
568 // actionMenu->insertSeparator(); 568 // actionMenu->insertSeparator();
569 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 569 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
570 this ); 570 this );
571 action->addTo( importMenu ); 571 action->addTo( importMenu );
572 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 572 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
573 action = new QAction( "import_quick", i18n("Import last file"), 0, 573 action = new QAction( "import_quick", i18n("Import last file"), 0,
574 this ); 574 this );
575 action->addTo( importMenu ); 575 action->addTo( importMenu );
576 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 576 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
577 importMenu->insertSeparator(); 577 importMenu->insertSeparator();
578 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 578 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
579 this ); 579 this );
580 action->addTo( importMenu ); 580 action->addTo( importMenu );
581 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 581 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
582#ifndef DESKTOP_VERSION 582#ifndef DESKTOP_VERSION
583 importMenu->insertSeparator(); 583 importMenu->insertSeparator();
584 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 584 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
585 this ); 585 this );
586 action->addTo( importMenu ); 586 action->addTo( importMenu );
587 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 587 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
588#else 588#else
589#ifdef _WIN32_ 589#ifdef _WIN32_
590 importMenu->insertSeparator(); 590 importMenu->insertSeparator();
591 action = new QAction( "import_ol", i18n("Import from OL"), 0, 591 action = new QAction( "import_ol", i18n("Import from OL"), 0,
592 this ); 592 this );
593 action->addTo( importMenu ); 593 action->addTo( importMenu );
594 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 594 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
595#endif 595#endif
596#endif 596#endif
597 597
598 importMenu->insertSeparator(); 598 importMenu->insertSeparator();
599 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 599 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
600 this ); 600 this );
601 action->addTo( importMenu ); 601 action->addTo( importMenu );
602 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 602 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
603 603
604 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 604 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
605 this ); 605 this );
606 action->addTo( importMenu ); 606 action->addTo( importMenu );
607 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 607 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
608 608
609 importMenu->insertSeparator(); 609 importMenu->insertSeparator();
610 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 610 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
611 this ); 611 this );
612 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 612 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
613 importMenu->insertSeparator(); 613 importMenu->insertSeparator();
614 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 614 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
615 this ); 615 this );
616 action->addTo( importMenu ); 616 action->addTo( importMenu );
617 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 617 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
618#ifndef DESKTOP_VERSION 618#ifndef DESKTOP_VERSION
619 importMenu->insertSeparator(); 619 importMenu->insertSeparator();
620 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 620 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
621 this ); 621 this );
622 action->addTo( importMenu ); 622 action->addTo( importMenu );
623 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 623 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
624 624
625 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 625 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
626 this ); 626 this );
627 action->addTo( importMenu ); 627 action->addTo( importMenu );
628 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 628 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
629#else 629#else
630 importMenu->insertSeparator(); 630 importMenu->insertSeparator();
631 icon = loadPixmap( pathString + "print" ); 631 icon = loadPixmap( pathString + "print" );
632 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 632 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
633 action->addTo( importMenu ); 633 action->addTo( importMenu );
634 connect( action, SIGNAL( activated() ), 634 connect( action, SIGNAL( activated() ),
635 this, SLOT( printCal() ) ); 635 this, SLOT( printCal() ) );
636 636
637 icon = loadPixmap( pathString + "print" ); 637 icon = loadPixmap( pathString + "print" );
638 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 638 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
639 action->addTo( importMenu ); 639 action->addTo( importMenu );
640 connect( action, SIGNAL( activated() ), 640 connect( action, SIGNAL( activated() ),
641 this, SLOT( printSel() ) ); 641 this, SLOT( printSel() ) );
642#endif 642#endif
643 importMenu->insertSeparator(); 643 importMenu->insertSeparator();
644 action = new QAction( "beam all", i18n("Save"), 0, 644 action = new QAction( "beam all", i18n("Save"), 0,
645 this ); 645 this );
646 action->addTo( importMenu ); 646 action->addTo( importMenu );
647 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 647 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
648 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 648 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
649 this ); 649 this );
650 action->addTo( importMenu ); 650 action->addTo( importMenu );
651 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 651 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
652 652
653 //menuBar->insertItem( "Configure",configureMenu ); 653 //menuBar->insertItem( "Configure",configureMenu );
654 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 654 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
655 icon = loadPixmap( "korganizer/korganizer" ); 655 icon = loadPixmap( "korganizer/korganizer" );
656 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 656 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
657 action->addTo( helpMenu ); 657 action->addTo( helpMenu );
658 connect( action, SIGNAL( activated() ), 658 connect( action, SIGNAL( activated() ),
659 SLOT( keyBindings() ) ); 659 SLOT( keyBindings() ) );
660 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 660 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
661 action->addTo( helpMenu ); 661 action->addTo( helpMenu );
662 connect( action, SIGNAL( activated() ), 662 connect( action, SIGNAL( activated() ),
663 SLOT( features() ) ); 663 SLOT( features() ) );
664 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 664 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
665 action->addTo( helpMenu ); 665 action->addTo( helpMenu );
666 connect( action, SIGNAL( activated() ), 666 connect( action, SIGNAL( activated() ),
667 SLOT( aboutAutoSaving() ) ); 667 SLOT( aboutAutoSaving() ) );
668 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 668 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
669 action->addTo( helpMenu ); 669 action->addTo( helpMenu );
670 connect( action, SIGNAL( activated() ), 670 connect( action, SIGNAL( activated() ),
671 SLOT( aboutKnownBugs() ) ); 671 SLOT( aboutKnownBugs() ) );
672 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 672 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
673 action->addTo( helpMenu ); 673 action->addTo( helpMenu );
674 connect( action, SIGNAL( activated() ), 674 connect( action, SIGNAL( activated() ),
675 SLOT( usertrans() ) ); 675 SLOT( usertrans() ) );
676 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 676 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
677 action->addTo( helpMenu ); 677 action->addTo( helpMenu );
678 connect( action, SIGNAL( activated() ), 678 connect( action, SIGNAL( activated() ),
679 SLOT( synchowto() ) ); 679 SLOT( synchowto() ) );
680 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 680 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
681 action->addTo( helpMenu ); 681 action->addTo( helpMenu );
682 connect( action, SIGNAL( activated() ), 682 connect( action, SIGNAL( activated() ),
683 SLOT( whatsNew() ) ); 683 SLOT( whatsNew() ) );
684 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 684 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
685 action->addTo( helpMenu ); 685 action->addTo( helpMenu );
686 connect( action, SIGNAL( activated() ), 686 connect( action, SIGNAL( activated() ),
687 SLOT( faq() ) ); 687 SLOT( faq() ) );
688 688
689 689
690 action = new QAction( "about", i18n("About..."), 0, this ); 690 action = new QAction( "about", i18n("About..."), 0, this );
691 action->addTo( helpMenu ); 691 action->addTo( helpMenu );
692 connect( action, SIGNAL( activated() ), 692 connect( action, SIGNAL( activated() ),
693 SLOT( about() ) ); 693 SLOT( about() ) );
694 //menuBar->insertSeparator(); 694 //menuBar->insertSeparator();
695 695
696 // ****************************************************** 696 // ******************************************************
697 // menubar icons 697 // menubar icons
698 698
699 699
700 iconToolBar->setHorizontalStretchable (true ); 700 iconToolBar->setHorizontalStretchable (true );
701 //menuBar->insertItem( iconToolBar ); 701 //menuBar->insertItem( iconToolBar );
702 //xdays_action 702 //xdays_action
703 if (p-> mShowIconNewEvent) 703 if (p-> mShowIconNewEvent)
704 ne_action->addTo( iconToolBar ); 704 ne_action->addTo( iconToolBar );
705 if (p->mShowIconNewTodo ) 705 if (p->mShowIconNewTodo )
706 nt_action->addTo( iconToolBar ); 706 nt_action->addTo( iconToolBar );
707 if (p-> mShowIconSearch) 707 if (p-> mShowIconSearch)
708 search_action->addTo( iconToolBar ); 708 search_action->addTo( iconToolBar );
709 if (p-> mShowIconNext) 709 if (p-> mShowIconNext)
710 whatsnext_action->addTo( iconToolBar ); 710 whatsnext_action->addTo( iconToolBar );
711 if (p-> mShowIconNextDays) 711 if (p-> mShowIconNextDays)
712 xdays_action->addTo( iconToolBar ); 712 xdays_action->addTo( iconToolBar );
713 if (p-> mShowIconList) 713 if (p-> mShowIconList)
714 showlist_action->addTo( iconToolBar ); 714 showlist_action->addTo( iconToolBar );
715 if (p-> mShowIconDay1) 715 if (p-> mShowIconDay1)
716 day1_action->addTo( iconToolBar ); 716 day1_action->addTo( iconToolBar );
717 if (p-> mShowIconDay5) 717 if (p-> mShowIconDay5)
718 day5_action->addTo( iconToolBar ); 718 day5_action->addTo( iconToolBar );
719 if (p-> mShowIconDay7) 719 if (p-> mShowIconDay7)
720 day7_action->addTo( iconToolBar ); 720 day7_action->addTo( iconToolBar );
721 if (p-> mShowIconMonth) 721 if (p-> mShowIconMonth)
722 month_action->addTo( iconToolBar ); 722 month_action->addTo( iconToolBar );
723 if (p-> mShowIconTodoview) 723 if (p-> mShowIconTodoview)
724 todoview_action->addTo( iconToolBar ); 724 todoview_action->addTo( iconToolBar );
725 if (p-> mShowIconJournal) 725 if (p-> mShowIconJournal)
726 viewjournal_action->addTo( iconToolBar ); 726 viewjournal_action->addTo( iconToolBar );
727 icon = loadPixmap( pathString + "2leftarrowB" ); 727 icon = loadPixmap( pathString + "2leftarrowB" );
728 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 728 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
729 if (p-> mShowIconBackFast) { 729 if (p-> mShowIconBackFast) {
730 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 730 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
731 connect( action, SIGNAL( activated() ), 731 connect( action, SIGNAL( activated() ),
732 mView, SLOT( goPreviousMonth() ) ); 732 mView, SLOT( goPreviousMonth() ) );
733 action->addTo( iconToolBar ); 733 action->addTo( iconToolBar );
734 } 734 }
735 icon = loadPixmap( pathString + "1leftarrowB" ); 735 icon = loadPixmap( pathString + "1leftarrowB" );
736 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 736 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
737 if (p-> mShowIconBack) { 737 if (p-> mShowIconBack) {
738 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 738 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
739 connect( action, SIGNAL( activated() ), 739 connect( action, SIGNAL( activated() ),
740 mView, SLOT( goPrevious() ) ); 740 mView, SLOT( goPrevious() ) );
741 action->addTo( iconToolBar ); 741 action->addTo( iconToolBar );
742 } 742 }
743 if (p-> mShowIconToday) 743 if (p-> mShowIconToday)
744 today_action->addTo( iconToolBar ); 744 today_action->addTo( iconToolBar );
745 icon = loadPixmap( pathString + "1rightarrowB" ); 745 icon = loadPixmap( pathString + "1rightarrowB" );
746 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 746 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
747 if (p-> mShowIconForward) { 747 if (p-> mShowIconForward) {
748 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 748 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
749 connect( action, SIGNAL( activated() ), 749 connect( action, SIGNAL( activated() ),
750 mView, SLOT( goNext() ) ); 750 mView, SLOT( goNext() ) );
751 action->addTo( iconToolBar ); 751 action->addTo( iconToolBar );
752 } 752 }
753 icon = loadPixmap( pathString + "2rightarrowB" ); 753 icon = loadPixmap( pathString + "2rightarrowB" );
754 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 754 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
755 if (p-> mShowIconForwardFast) { 755 if (p-> mShowIconForwardFast) {
756 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 756 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
757 connect( action, SIGNAL( activated() ), 757 connect( action, SIGNAL( activated() ),
758 mView, SLOT( goNextMonth() ) ); 758 mView, SLOT( goNextMonth() ) );
759 action->addTo( iconToolBar ); 759 action->addTo( iconToolBar );
760 } 760 }
761 761
762 762
763 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 763 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
764 764
765 if (p-> mShowIconNewEvent) 765 if (p-> mShowIconNewEvent)
766 configureToolBarMenu->setItemChecked( 10, true ); 766 configureToolBarMenu->setItemChecked( 10, true );
767 if (p->mShowIconNewTodo ) 767 if (p->mShowIconNewTodo )
768 configureToolBarMenu->setItemChecked( 20, true ); 768 configureToolBarMenu->setItemChecked( 20, true );
769 if (p-> mShowIconSearch) 769 if (p-> mShowIconSearch)
770 configureToolBarMenu->setItemChecked( 120, true ); 770 configureToolBarMenu->setItemChecked( 120, true );
771 if (p-> mShowIconList) 771 if (p-> mShowIconList)
772 configureToolBarMenu->setItemChecked( 30, true ); 772 configureToolBarMenu->setItemChecked( 30, true );
773 if (p-> mShowIconDay1) 773 if (p-> mShowIconDay1)
774 configureToolBarMenu->setItemChecked( 40, true ); 774 configureToolBarMenu->setItemChecked( 40, true );
775 if (p-> mShowIconDay5) 775 if (p-> mShowIconDay5)
776 configureToolBarMenu->setItemChecked( 50, true ); 776 configureToolBarMenu->setItemChecked( 50, true );
777 if (p-> mShowIconDay7) 777 if (p-> mShowIconDay7)
778 configureToolBarMenu->setItemChecked( 60, true ); 778 configureToolBarMenu->setItemChecked( 60, true );
779 if (p-> mShowIconMonth) 779 if (p-> mShowIconMonth)
780 configureToolBarMenu->setItemChecked( 70, true ); 780 configureToolBarMenu->setItemChecked( 70, true );
781 if (p-> mShowIconTodoview) 781 if (p-> mShowIconTodoview)
782 configureToolBarMenu->setItemChecked( 80, true ); 782 configureToolBarMenu->setItemChecked( 80, true );
783 if (p-> mShowIconBackFast) 783 if (p-> mShowIconBackFast)
784 configureToolBarMenu->setItemChecked( 200, true ); 784 configureToolBarMenu->setItemChecked( 200, true );
785 if (p-> mShowIconBack) 785 if (p-> mShowIconBack)
786 configureToolBarMenu->setItemChecked( 210, true ); 786 configureToolBarMenu->setItemChecked( 210, true );
787 if (p-> mShowIconToday) 787 if (p-> mShowIconToday)
788 configureToolBarMenu->setItemChecked( 130, true ); 788 configureToolBarMenu->setItemChecked( 130, true );
789 if (p-> mShowIconForward) 789 if (p-> mShowIconForward)
790 configureToolBarMenu->setItemChecked( 220, true ); 790 configureToolBarMenu->setItemChecked( 220, true );
791 if (p-> mShowIconForwardFast) 791 if (p-> mShowIconForwardFast)
792 configureToolBarMenu->setItemChecked( 230, true ); 792 configureToolBarMenu->setItemChecked( 230, true );
793 if (p-> mShowIconNextDays) 793 if (p-> mShowIconNextDays)
794 configureToolBarMenu->setItemChecked( 100, true ); 794 configureToolBarMenu->setItemChecked( 100, true );
795 if (p-> mShowIconNext) 795 if (p-> mShowIconNext)
796 configureToolBarMenu->setItemChecked( 110, true ); 796 configureToolBarMenu->setItemChecked( 110, true );
797 if (p-> mShowIconJournal) 797 if (p-> mShowIconJournal)
798 configureToolBarMenu->setItemChecked( 90, true ); 798 configureToolBarMenu->setItemChecked( 90, true );
799 if (p-> mShowIconWhatsThis) 799 if (p-> mShowIconWhatsThis)
800 configureToolBarMenu->setItemChecked( 300, true ); 800 configureToolBarMenu->setItemChecked( 300, true );
801 801
802 QLabel* dummy = new QLabel( iconToolBar ); 802 QLabel* dummy = new QLabel( iconToolBar );
803 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 803 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
804 if (!p-> mShowIconStretch) 804 if (!p-> mShowIconStretch)
805 iconToolBar->setStretchableWidget ( dummy ) ; 805 iconToolBar->setStretchableWidget ( dummy ) ;
806 else 806 else
807 configureToolBarMenu->setItemChecked( 5, true ); 807 configureToolBarMenu->setItemChecked( 5, true );
808 if (p-> mShowIconWhatsThis) 808 if (p-> mShowIconWhatsThis)
809 QWhatsThis::whatsThisButton ( iconToolBar ); 809 QWhatsThis::whatsThisButton ( iconToolBar );
810 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 810 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
811 configureAgenda( p->mHourSize ); 811 configureAgenda( p->mHourSize );
812 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 812 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
813} 813}
814void MainWindow::fillSyncMenu() 814void MainWindow::fillSyncMenu()
815{ 815{
816 syncMenu->clear(); 816 syncMenu->clear();
817 syncMenu->insertItem( i18n("Configure..."), 0 ); 817 syncMenu->insertItem( i18n("Configure..."), 0 );
818 syncMenu->insertSeparator(); 818 syncMenu->insertSeparator();
819 syncMenu->insertItem( i18n("Multiple sync"), 1 ); 819 syncMenu->insertItem( i18n("Multiple sync"), 1 );
820 syncMenu->insertSeparator(); 820 syncMenu->insertSeparator();
821 821
822 QStringList prof = KOPrefs::instance()->mSyncProfileNames; 822 QStringList prof = KOPrefs::instance()->mSyncProfileNames;
823 823
824 if ( prof.count() < 3 ) { 824 if ( prof.count() < 3 ) {
825 KConfig *config = KOGlobals::config(); 825 KConfig *config = KOGlobals::config();
826 prof.clear(); 826 prof.clear();
827 prof << i18n("Sharp-DTM"); 827 prof << i18n("Sharp-DTM");
828 prof << i18n("Local file"); 828 prof << i18n("Local file");
829 prof << i18n("Last file"); 829 prof << i18n("Last file");
830 KSyncProfile* temp = new KSyncProfile (); 830 KSyncProfile* temp = new KSyncProfile ();
831 temp->setName( prof[0] ); 831 temp->setName( prof[0] );
832 temp->writeConfig(config); 832 temp->writeConfig(config);
833 temp->setName( prof[1] ); 833 temp->setName( prof[1] );
834 temp->writeConfig(config); 834 temp->writeConfig(config);
835 temp->setName( prof[2] ); 835 temp->setName( prof[2] );
836 temp->writeConfig(config); 836 temp->writeConfig(config);
837 config->sync(); 837 config->sync();
838 delete temp; 838 delete temp;
839 KOPrefs::instance()->mSyncProfileNames = prof; 839 KOPrefs::instance()->mSyncProfileNames = prof;
840 } 840 }
841 841
842 int i; 842 int i;
843 for ( i = 0; i < prof.count(); ++i ) { 843 for ( i = 0; i < prof.count(); ++i ) {
844 844
845 syncMenu->insertItem( prof[i], 1000+i ); 845 syncMenu->insertItem( prof[i], 1000+i );
846 if ( i == 2 ) 846 if ( i == 2 )
847 syncMenu->insertSeparator(); 847 syncMenu->insertSeparator();
848 } 848 }
849 QDir app_dir; 849 QDir app_dir;
850 if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { 850 if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) {
851 syncMenu->setItemEnabled( false , 1000 ); 851 syncMenu->setItemEnabled( false , 1000 );
852 } 852 }
853} 853}
854 854
855int MainWindow::ringSync() 855int MainWindow::ringSync()
856{ 856{
857 int syncedProfiles = 0; 857 int syncedProfiles = 0;
858 int i; 858 int i;
859 QTime timer; 859 QTime timer;
860 KConfig *config = KOGlobals::config(); 860 KConfig *config = KOGlobals::config();
861 QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; 861 QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames;
862 KSyncProfile* temp = new KSyncProfile (); 862 KSyncProfile* temp = new KSyncProfile ();
863 KOPrefs::instance()->mAskForPreferences = false; 863 KOPrefs::instance()->mAskForPreferences = false;
864 for ( i = 0; i < syncProfileNames.count(); ++i ) { 864 for ( i = 0; i < syncProfileNames.count(); ++i ) {
865 mCurrentSyncProfile = i; 865 mCurrentSyncProfile = i;
866 temp->setName(syncProfileNames[mCurrentSyncProfile]); 866 temp->setName(syncProfileNames[mCurrentSyncProfile]);
867 temp->readConfig(config); 867 temp->readConfig(config);
868 if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { 868 if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) {
869 setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); 869 setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
870 ++syncedProfiles; 870 ++syncedProfiles;
871 // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 871 // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
872 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 872 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
873 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 873 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
874 KOPrefs::instance()->mShowSyncSummary = false; 874 KOPrefs::instance()->mShowSyncSummary = false;
875 mView->setSyncDevice(syncProfileNames[i] ); 875 mView->setSyncDevice(syncProfileNames[i] );
876 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 876 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
877 if ( i == 0 ) { 877 if ( i == 0 ) {
878 syncSharp(); 878 syncSharp();
879 } else { 879 } else {
880 if ( temp->getIsLocalFileSync() ) { 880 if ( temp->getIsLocalFileSync() ) {
881 if ( syncWithFile( temp->getRemoteFileName( ), true ) ) 881 if ( syncWithFile( temp->getRemoteFileName( ), true ) )
882 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 882 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
883 } else { 883 } else {
884 syncRemote( temp, false ); 884 syncRemote( temp, false );
885 885
886 } 886 }
887 } 887 }
888 timer.start(); 888 timer.start();
889 setCaption(i18n("Multiple sync in progress ... please wait!") ); 889 setCaption(i18n("Multiple sync in progress ... please wait!") );
890 while ( timer.elapsed () < 2000 ) { 890 while ( timer.elapsed () < 2000 ) {
891 qApp->processEvents(); 891 qApp->processEvents();
892#ifndef _WIN32_ 892#ifndef _WIN32_
893 sleep (1); 893 sleep (1);
894#endif 894#endif
895 } 895 }
896 896
897 } 897 }
898 898
899 } 899 }
900 delete temp; 900 delete temp;
901 return syncedProfiles; 901 return syncedProfiles;
902} 902}
903 903
904void MainWindow::multiSync( bool askforPrefs ) 904void MainWindow::multiSync( bool askforPrefs )
905{ 905{
906 if (mBlockSaveFlag) 906 if (mBlockSaveFlag)
907 return; 907 return;
908 mBlockSaveFlag = true; 908 mBlockSaveFlag = true;
909 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 909 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
910 if ( QMessageBox::information( this, i18n("KO/Pi Sync"), 910 if ( QMessageBox::information( this, i18n("KO/Pi Sync"),
911 question, 911 question,
912 i18n("Yes"), i18n("No"), 912 i18n("Yes"), i18n("No"),
913 0, 0 ) != 0 ) { 913 0, 0 ) != 0 ) {
914 mBlockSaveFlag = false; 914 mBlockSaveFlag = false;
915 setCaption(i18n("Aborted! Nothing synced!")); 915 setCaption(i18n("Aborted! Nothing synced!"));
916 return; 916 return;
917 } 917 }
918 mView->setSyncDevice(i18n("Multiple profiles") ); 918 mView->setSyncDevice(i18n("Multiple profiles") );
919 KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; 919 KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs;
920 if ( askforPrefs ) { 920 if ( askforPrefs ) {
921 mView->edit_sync_options(); 921 mView->edit_sync_options();
922 KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; 922 KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs;
923 } 923 }
924 setCaption(i18n("Multiple sync started.") ); 924 setCaption(i18n("Multiple sync started.") );
925 qApp->processEvents(); 925 qApp->processEvents();
926 int num = ringSync() ; 926 int num = ringSync() ;
927 if ( num > 1 ) 927 if ( num > 1 )
928 ringSync(); 928 ringSync();
929 mBlockSaveFlag = false; 929 mBlockSaveFlag = false;
930 if ( num ) 930 if ( num )
931 save(); 931 save();
932 if ( num ) 932 if ( num )
933 setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); 933 setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) );
934 else 934 else
935 setCaption(i18n("Nothing synced! No profiles defined for multisync!")); 935 setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
936 return; 936 return;
937} 937}
938void MainWindow::slotSyncMenu( int action ) 938void MainWindow::slotSyncMenu( int action )
939{ 939{
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;
1325 mBlockSaveFlag = store; 1325 mBlockSaveFlag = store;
1326} 1326}
1327 1327
1328void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1328void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1329{ 1329{
1330 if ( !e->isAutoRepeat() ) { 1330 if ( !e->isAutoRepeat() ) {
1331 mFlagKeyPressed = false; 1331 mFlagKeyPressed = false;
1332 } 1332 }
1333} 1333}
1334void MainWindow::keyPressEvent ( QKeyEvent * e ) 1334void MainWindow::keyPressEvent ( QKeyEvent * e )
1335{ 1335{
1336 qApp->processEvents(); 1336 qApp->processEvents();
1337 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1337 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1338 e->ignore(); 1338 e->ignore();
1339 // qDebug(" ignore %d",e->isAutoRepeat() ); 1339 // qDebug(" ignore %d",e->isAutoRepeat() );
1340 return; 1340 return;
1341 } 1341 }
1342 if (! e->isAutoRepeat() ) 1342 if (! e->isAutoRepeat() )
1343 mFlagKeyPressed = true; 1343 mFlagKeyPressed = true;
1344 KOPrefs *p = KOPrefs::instance(); 1344 KOPrefs *p = KOPrefs::instance();
1345 bool showSelectedDates = false; 1345 bool showSelectedDates = false;
1346 int size; 1346 int size;
1347 int pro = 0; 1347 int pro = 0;
1348 //qDebug("MainWindow::keyPressEvent "); 1348 //qDebug("MainWindow::keyPressEvent ");
1349 switch ( e->key() ) { 1349 switch ( e->key() ) {
1350 case Qt::Key_Right: 1350 case Qt::Key_Right:
1351 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1351 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1352 mView->goNextMonth(); 1352 mView->goNextMonth();
1353 else 1353 else
1354 mView->goNext(); 1354 mView->goNext();
1355 showSelectedDates = true; 1355 showSelectedDates = true;
1356 break; 1356 break;
1357 case Qt::Key_Left: 1357 case Qt::Key_Left:
1358 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1358 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1359 mView->goPreviousMonth(); 1359 mView->goPreviousMonth();
1360 else 1360 else
1361 mView->goPrevious(); 1361 mView->goPrevious();
1362 showSelectedDates = true; 1362 showSelectedDates = true;
1363 break; 1363 break;
1364 case Qt::Key_Down: 1364 case Qt::Key_Down:
1365 mView->viewManager()->agendaView()->scrollOneHourDown(); 1365 mView->viewManager()->agendaView()->scrollOneHourDown();
1366 break; 1366 break;
1367 case Qt::Key_Up: 1367 case Qt::Key_Up:
1368 mView->viewManager()->agendaView()->scrollOneHourUp(); 1368 mView->viewManager()->agendaView()->scrollOneHourUp();
1369 break; 1369 break;
1370 case Qt::Key_I: 1370 case Qt::Key_I:
1371 mView->showIncidence(); 1371 mView->showIncidence();
1372 break; 1372 break;
1373 case Qt::Key_Delete: 1373 case Qt::Key_Delete:
1374 case Qt::Key_Backspace: 1374 case Qt::Key_Backspace:
1375 mView->deleteIncidence(); 1375 mView->deleteIncidence();
1376 break; 1376 break;
1377 case Qt::Key_D: 1377 case Qt::Key_D:
1378 mView->viewManager()->showDayView(); 1378 mView->viewManager()->showDayView();
1379 showSelectedDates = true; 1379 showSelectedDates = true;
1380 break; 1380 break;
1381 case Qt::Key_O: 1381 case Qt::Key_O:
1382 mView->toggleFilerEnabled( ); 1382 mView->toggleFilerEnabled( );
1383 break; 1383 break;
1384 case Qt::Key_0: 1384 case Qt::Key_0:
1385 case Qt::Key_1: 1385 case Qt::Key_1:
1386 case Qt::Key_2: 1386 case Qt::Key_2:
1387 case Qt::Key_3: 1387 case Qt::Key_3:
1388 case Qt::Key_4: 1388 case Qt::Key_4:
1389 case Qt::Key_5: 1389 case Qt::Key_5:
1390 case Qt::Key_6: 1390 case Qt::Key_6:
1391 case Qt::Key_7: 1391 case Qt::Key_7:
1392 case Qt::Key_8: 1392 case Qt::Key_8:
1393 case Qt::Key_9: 1393 case Qt::Key_9:
1394 pro = e->key()-48; 1394 pro = e->key()-48;
1395 if ( pro == 0 ) 1395 if ( pro == 0 )
1396 pro = 10; 1396 pro = 10;
1397 if ( e->state() == Qt::ControlButton) 1397 if ( e->state() == Qt::ControlButton)
1398 pro += 10; 1398 pro += 10;
1399 break; 1399 break;
1400 case Qt::Key_M: 1400 case Qt::Key_M:
1401 mView->viewManager()->showMonthView(); 1401 mView->viewManager()->showMonthView();
1402 showSelectedDates = true; 1402 showSelectedDates = true;
1403 break; 1403 break;
1404 case Qt::Key_Insert: 1404 case Qt::Key_Insert:
1405 mView->newEvent(); 1405 mView->newEvent();
1406 break; 1406 break;
1407 case Qt::Key_S : 1407 case Qt::Key_S :
1408 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1408 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1409 mView->newSubTodo(); 1409 mView->newSubTodo();
1410 else 1410 else
1411 mView->dialogManager()->showSearchDialog(); 1411 mView->dialogManager()->showSearchDialog();
1412 break; 1412 break;
1413 case Qt::Key_Y : 1413 case Qt::Key_Y :
1414 case Qt::Key_Z : 1414 case Qt::Key_Z :
1415 mView->viewManager()->showWorkWeekView(); 1415 mView->viewManager()->showWorkWeekView();
1416 showSelectedDates = true; 1416 showSelectedDates = true;
1417 break; 1417 break;
1418 case Qt::Key_U : 1418 case Qt::Key_U :
1419 mView->viewManager()->showWeekView(); 1419 mView->viewManager()->showWeekView();
1420 showSelectedDates = true; 1420 showSelectedDates = true;
1421 break; 1421 break;
1422 case Qt::Key_H : 1422 case Qt::Key_H :
1423 keyBindings(); 1423 keyBindings();
1424 break; 1424 break;
1425 case Qt::Key_W: 1425 case Qt::Key_W:
1426 mView->viewManager()->showWhatsNextView(); 1426 mView->viewManager()->showWhatsNextView();
1427 break; 1427 break;
1428 case Qt::Key_L: 1428 case Qt::Key_L:
1429 mView->viewManager()->showListView(); 1429 mView->viewManager()->showListView();
1430 break; 1430 break;
1431 case Qt::Key_N: 1431 case Qt::Key_N:
1432 mView->viewManager()->showNextXView(); 1432 mView->viewManager()->showNextXView();
1433 showSelectedDates = true; 1433 showSelectedDates = true;
1434 break; 1434 break;
1435 case Qt::Key_V: 1435 case Qt::Key_V:
1436 mView->viewManager()->showTodoView(); 1436 mView->viewManager()->showTodoView();
1437 break; 1437 break;
1438 case Qt::Key_C: 1438 case Qt::Key_C:
1439 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1439 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1440 break; 1440 break;
1441 case Qt::Key_P: 1441 case Qt::Key_P:
1442 mView->showDatePicker( ); 1442 mView->showDatePicker( );
1443 break; 1443 break;
1444 case Qt::Key_F: 1444 case Qt::Key_F:
1445 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1445 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1446 mView->editFilters(); 1446 mView->editFilters();
1447 else 1447 else
1448 mView->toggleFilter(); 1448 mView->toggleFilter();
1449 break; 1449 break;
1450 case Qt::Key_X: 1450 case Qt::Key_X:
1451 mView->toggleDateNavigatorWidget(); 1451 mView->toggleDateNavigatorWidget();
1452 break; 1452 break;
1453 case Qt::Key_Space: 1453 case Qt::Key_Space:
1454 mView->toggleExpand(); 1454 mView->toggleExpand();
1455 break; 1455 break;
1456 case Qt::Key_A: 1456 case Qt::Key_A:
1457 mView->toggleAllDaySize(); 1457 mView->toggleAllDaySize();
1458 break; 1458 break;
1459 case Qt::Key_T: 1459 case Qt::Key_T:
1460 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1460 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1461 mView->newTodo(); 1461 mView->newTodo();
1462 else { 1462 else {
1463 mView->goToday(); 1463 mView->goToday();
1464 showSelectedDates = true; 1464 showSelectedDates = true;
1465 } 1465 }
1466 break; 1466 break;
1467 case Qt::Key_J: 1467 case Qt::Key_J:
1468 mView->viewManager()->showJournalView(); 1468 mView->viewManager()->showJournalView();
1469 break; 1469 break;
1470 case Qt::Key_B: 1470 case Qt::Key_B:
1471 mView->editIncidenceDescription();; 1471 mView->editIncidenceDescription();;
1472 break; 1472 break;
1473 // case Qt::Key_Return: 1473 // case Qt::Key_Return:
1474 case Qt::Key_E: 1474 case Qt::Key_E:
1475 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1475 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1476 mView->newEvent(); 1476 mView->newEvent();
1477 else 1477 else
1478 mView->editIncidence(); 1478 mView->editIncidence();
1479 break; 1479 break;
1480 case Qt::Key_Plus: 1480 case Qt::Key_Plus:
1481 size = p->mHourSize +2; 1481 size = p->mHourSize +2;
1482 if ( size <= 18 ) 1482 if ( size <= 18 )
1483 configureAgenda( size ); 1483 configureAgenda( size );
1484 break; 1484 break;
1485 case Qt::Key_Minus: 1485 case Qt::Key_Minus:
1486 size = p->mHourSize - 2; 1486 size = p->mHourSize - 2;
1487 if ( size >= 4 ) 1487 if ( size >= 4 )
1488 configureAgenda( size ); 1488 configureAgenda( size );
1489 break; 1489 break;
1490 1490
1491 1491
1492 default: 1492 default:
1493 e->ignore(); 1493 e->ignore();
1494 } 1494 }
1495 if ( pro > 0 ) { 1495 if ( pro > 0 ) {
1496 mView->selectFilter( pro-1 ); 1496 mView->selectFilter( pro-1 );
1497 } 1497 }
1498 if ( showSelectedDates ) { 1498 if ( showSelectedDates ) {
1499 ;// setCaptionToDates(); 1499 ;// setCaptionToDates();
1500 } 1500 }
1501 1501
1502} 1502}
1503 1503
1504void MainWindow::configureToolBar( int item ) 1504void MainWindow::configureToolBar( int item )
1505{ 1505{
1506 1506
1507 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1507 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1508 KOPrefs *p = KOPrefs::instance(); 1508 KOPrefs *p = KOPrefs::instance();
1509 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1509 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1510 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1510 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1511 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1511 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1512 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1512 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
1513 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 1513 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
1514 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 1514 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
1515 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 1515 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
1516 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 1516 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
1517 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 1517 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
1518 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 1518 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
1519 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 1519 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
1520 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 1520 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
1521 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 1521 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
1522 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 1522 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
1523 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 1523 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
1524 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 1524 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
1525 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 1525 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
1526 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 1526 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
1527 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 1527 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
1528 // initActions(); 1528 // initActions();
1529} 1529}
1530 1530
1531void MainWindow::setCaptionToDates() 1531void MainWindow::setCaptionToDates()
1532{ 1532{
1533 QString selDates; 1533 QString selDates;
1534 selDates = KGlobal::locale()->formatDate(mView->startDate(), true); 1534 selDates = KGlobal::locale()->formatDate(mView->startDate(), true);
1535 if (mView->startDate() < mView->endDate() ) 1535 if (mView->startDate() < mView->endDate() )
1536 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 1536 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
1537 setCaption( i18n("Dates: ") + selDates ); 1537 setCaption( i18n("Dates: ") + selDates );
1538 1538
1539} 1539}
1540// parameter item == 0: reinit 1540// parameter item == 0: reinit
1541void MainWindow::configureAgenda( int item ) 1541void MainWindow::configureAgenda( int item )
1542{ 1542{
1543 1543
1544 KOPrefs *p = KOPrefs::instance(); 1544 KOPrefs *p = KOPrefs::instance();
1545 1545
1546 int i; 1546 int i;
1547 if ( item == 1 ) { 1547 if ( item == 1 ) {
1548 mView->toggleAllDaySize(); 1548 mView->toggleAllDaySize();
1549 return; 1549 return;
1550 } 1550 }
1551 // do not allow 4 for widgets higher than 480 1551 // do not allow 4 for widgets higher than 480
1552 // if ( QApplication::desktop()->height() > 480 ) { 1552 // if ( QApplication::desktop()->height() > 480 ) {
1553// if ( item == 4 ) 1553// if ( item == 4 )
1554// item = 6; 1554// item = 6;
1555// } 1555// }
1556 for ( i = 4; i <= 18; i= i+2 ) 1556 for ( i = 4; i <= 18; i= i+2 )
1557 configureAgendaMenu->setItemChecked( i, false ); 1557 configureAgendaMenu->setItemChecked( i, false );
1558 configureAgendaMenu->setItemChecked( item, true ); 1558 configureAgendaMenu->setItemChecked( item, true );
1559 if ( p->mHourSize == item ) 1559 if ( p->mHourSize == item )
1560 return; 1560 return;
1561 p->mHourSize=item; 1561 p->mHourSize=item;
1562 mView->viewManager()->agendaView()->updateConfig(); 1562 mView->viewManager()->agendaView()->updateConfig();
1563} 1563}
1564 1564
1565void MainWindow::saveCalendar() 1565void MainWindow::saveCalendar()
1566{ 1566{
1567 QString fn = KOPrefs::instance()->mLastSaveFile; 1567 QString fn = KOPrefs::instance()->mLastSaveFile;
1568 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); 1568 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this );
1569 1569
1570 if ( fn == "" ) 1570 if ( fn == "" )
1571 return; 1571 return;
1572 QFileInfo info; 1572 QFileInfo info;
1573 info.setFile( fn ); 1573 info.setFile( fn );
1574 QString mes; 1574 QString mes;
1575 bool createbup = true; 1575 bool createbup = true;
1576 if ( info. exists() ) { 1576 if ( info. exists() ) {
1577 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; 1577 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ;
1578 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 1578 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
1579 i18n("Overwrite!"), i18n("Cancel"), 0, 1579 i18n("Overwrite!"), i18n("Cancel"), 0,
1580 0, 1 ); 1580 0, 1 );
1581 if ( result != 0 ) { 1581 if ( result != 0 ) {
1582 createbup = false; 1582 createbup = false;
1583 } 1583 }
1584 } 1584 }
1585 if ( createbup ) { 1585 if ( createbup ) {
1586 mView->saveCalendar( fn ); 1586 mView->saveCalendar( fn );
1587 mes = i18n("KO/Pi:Saved %1").arg(fn); 1587 mes = i18n("KO/Pi:Saved %1").arg(fn);
1588 KOPrefs::instance()->mLastSaveFile = fn; 1588 KOPrefs::instance()->mLastSaveFile = fn;
1589 setCaption(mes); 1589 setCaption(mes);
1590 } 1590 }
1591} 1591}
1592void MainWindow::loadCalendar() 1592void MainWindow::loadCalendar()
1593{ 1593{
1594 1594
1595 QString fn = KOPrefs::instance()->mLastLoadFile; 1595 QString fn = KOPrefs::instance()->mLastLoadFile;
1596 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 1596 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
1597 1597
1598 if ( fn == "" ) 1598 if ( fn == "" )
1599 return; 1599 return;
1600 QFileInfo info; 1600 QFileInfo info;
1601 info.setFile( fn ); 1601 info.setFile( fn );
1602 QString mess; 1602 QString mess;
1603 bool loadbup = true; 1603 bool loadbup = true;
1604 if ( info. exists() ) { 1604 if ( info. exists() ) {
1605 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 1605 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
1606 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 1606 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
1607 mess, 1607 mess,
1608 i18n("Load!"), i18n("Cancel"), 0, 1608 i18n("Load!"), i18n("Cancel"), 0,
1609 0, 1 ); 1609 0, 1 );
1610 if ( result != 0 ) { 1610 if ( result != 0 ) {
1611 loadbup = false; 1611 loadbup = false;
1612 } 1612 }
1613 } else { 1613 } else {
1614 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1614 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1615 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 1615 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
1616 0, 1 ); 1616 0, 1 );
1617 1617
1618 return; 1618 return;
1619 } 1619 }
1620 if ( loadbup ) { 1620 if ( loadbup ) {
1621 mView->openCalendar( fn ); 1621 mView->openCalendar( fn );
1622 KOPrefs::instance()->mLastLoadFile = fn; 1622 KOPrefs::instance()->mLastLoadFile = fn;
1623 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 1623 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
1624 setCaption(mess); 1624 setCaption(mess);
1625 } 1625 }
1626 1626
1627} 1627}
1628void MainWindow::quickImportIcal() 1628void MainWindow::quickImportIcal()
1629{ 1629{
1630 importFile( KOPrefs::instance()->mLastImportFile, false ); 1630 importFile( KOPrefs::instance()->mLastImportFile, false );
1631} 1631}
1632void MainWindow::importFile( QString fn, bool quick ) 1632void MainWindow::importFile( QString fn, bool quick )
1633{ 1633{
1634 QFileInfo info; 1634 QFileInfo info;
1635 info.setFile( fn ); 1635 info.setFile( fn );
1636 QString mess; 1636 QString mess;
1637 bool loadbup = true; 1637 bool loadbup = true;
1638 if ( !info. exists() ) { 1638 if ( !info. exists() ) {
1639 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 1639 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
1640 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1640 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1641 mess ); 1641 mess );
1642 return; 1642 return;
1643 } 1643 }
1644 int result = 0; 1644 int result = 0;
1645 if ( !quick ) { 1645 if ( !quick ) {
1646 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 1646 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
1647 result = QMessageBox::warning( this, "KO/Pi: Warning!", 1647 result = QMessageBox::warning( this, "KO/Pi: Warning!",
1648 mess, 1648 mess,
1649 "Import", "Cancel", 0, 1649 "Import", "Cancel", 0,
1650 0, 1 ); 1650 0, 1 );
1651 } 1651 }
1652 if ( result == 0 ) { 1652 if ( result == 0 ) {
1653 if ( mView->openCalendar( fn, true )) { 1653 if ( mView->openCalendar( fn, true )) {
1654 KOPrefs::instance()->mLastImportFile = fn; 1654 KOPrefs::instance()->mLastImportFile = fn;
1655 setCaption(i18n("Imported file successfully")); 1655 setCaption(i18n("Imported file successfully"));
1656 } else { 1656 } else {
1657 setCaption(i18n("Error importing file")); 1657 setCaption(i18n("Error importing file"));
1658 } 1658 }
1659 } 1659 }
1660} 1660}
1661 1661
1662void MainWindow::importIcal() 1662void MainWindow::importIcal()
1663{ 1663{
1664 1664
1665 QString fn =KOPrefs::instance()->mLastImportFile; 1665 QString fn =KOPrefs::instance()->mLastImportFile;
1666 1666
1667 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 1667 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
1668 if ( fn == "" ) 1668 if ( fn == "" )
1669 return; 1669 return;
1670 importFile( fn, true ); 1670 importFile( fn, true );
1671 1671
1672} 1672}
1673 1673
1674void MainWindow::exportVCalendar() 1674void MainWindow::exportVCalendar()
1675{ 1675{
1676 QString fn = KOPrefs::instance()->mLastVcalFile; 1676 QString fn = KOPrefs::instance()->mLastVcalFile;
1677 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 1677 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
1678 if ( fn == "" ) 1678 if ( fn == "" )
1679 return; 1679 return;
1680 QFileInfo info; 1680 QFileInfo info;
1681 info.setFile( fn ); 1681 info.setFile( fn );
1682 QString mes; 1682 QString mes;
1683 bool createbup = true; 1683 bool createbup = true;
1684 if ( info. exists() ) { 1684 if ( info. exists() ) {
1685 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 1685 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
1686 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 1686 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
1687 i18n("Overwrite!"), i18n("Cancel"), 0, 1687 i18n("Overwrite!"), i18n("Cancel"), 0,
1688 0, 1 ); 1688 0, 1 );
1689 if ( result != 0 ) { 1689 if ( result != 0 ) {
1690 createbup = false; 1690 createbup = false;
1691 } 1691 }
1692 } 1692 }
1693 if ( createbup ) { 1693 if ( createbup ) {
1694 if ( mView->exportVCalendar( fn ) ) { 1694 if ( mView->exportVCalendar( fn ) ) {
1695 KOPrefs::instance()->mLastVcalFile = fn; 1695 KOPrefs::instance()->mLastVcalFile = fn;
1696 if ( fn.length() > 20 ) 1696 if ( fn.length() > 20 )
1697 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 1697 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
1698 else 1698 else
1699 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 1699 mes = i18n("KO/Pi:Exported to %1").arg(fn );
1700 setCaption(mes); 1700 setCaption(mes);
1701 } 1701 }
1702 } 1702 }
1703 1703
1704} 1704}
1705#include <qpushbutton.h> 1705#include <qpushbutton.h>
1706QString MainWindow::getPassword( ) 1706QString MainWindow::getPassword( )
1707{ 1707{
1708 QString retfile = ""; 1708 QString retfile = "";
1709 QDialog dia ( this, "input-dialog", true ); 1709 QDialog dia ( this, "input-dialog", true );
1710 QLineEdit lab ( &dia ); 1710 QLineEdit lab ( &dia );
1711 lab.setEchoMode( QLineEdit::Password ); 1711 lab.setEchoMode( QLineEdit::Password );
1712 QVBoxLayout lay( &dia ); 1712 QVBoxLayout lay( &dia );
1713 lay.setMargin(7); 1713 lay.setMargin(7);
1714 lay.setSpacing(7); 1714 lay.setSpacing(7);
1715 lay.addWidget( &lab); 1715 lay.addWidget( &lab);
1716 dia.setFixedSize( 230,50 ); 1716 dia.setFixedSize( 230,50 );
1717 dia.setCaption( i18n("Enter password") ); 1717 dia.setCaption( i18n("Enter password") );
1718 QPushButton pb ( "OK", &dia); 1718 QPushButton pb ( "OK", &dia);
1719 lay.addWidget( &pb ); 1719 lay.addWidget( &pb );
1720 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); 1720 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
1721 dia.show(); 1721 dia.show();
1722 int res = dia.exec(); 1722 int res = dia.exec();
1723 if ( res ) 1723 if ( res )
1724 retfile = lab.text(); 1724 retfile = lab.text();
1725 dia.hide(); 1725 dia.hide();
1726 qApp->processEvents(); 1726 qApp->processEvents();
1727 return retfile; 1727 return retfile;
1728 1728
1729} 1729}
1730 1730
1731void MainWindow::syncLocalFile() 1731void MainWindow::syncLocalFile()
1732{ 1732{
1733 1733
1734 QString fn =KOPrefs::instance()->mLastSyncedLocalFile; 1734 QString fn =KOPrefs::instance()->mLastSyncedLocalFile;
1735 1735
1736 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); 1736 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
1737 if ( fn == "" ) 1737 if ( fn == "" )
1738 return; 1738 return;
1739 //mView->setSyncDevice("local-file" ); 1739 //mView->setSyncDevice("local-file" );
1740 if ( syncWithFile( fn, false ) ) { 1740 if ( syncWithFile( fn, false ) ) {
1741 // Event* e = mView->getLastSyncEvent(); 1741 // Event* e = mView->getLastSyncEvent();
1742// e->setReadOnly( false ); 1742// e->setReadOnly( false );
1743// e->setLocation( i18n("Local file: ")+ KOPrefs::instance()->mLastSyncedLocalFile); 1743// e->setLocation( i18n("Local file: ")+ KOPrefs::instance()->mLastSyncedLocalFile);
1744// e->setReadOnly( true ); 1744// e->setReadOnly( true );
1745 } 1745 }
1746 1746
1747} 1747}
1748 1748
1749bool MainWindow::syncWithFile( QString fn , bool quick ) 1749bool MainWindow::syncWithFile( QString fn , bool quick )
1750{ 1750{
1751 bool ret = false; 1751 bool ret = false;
1752 QFileInfo info; 1752 QFileInfo info;
1753 info.setFile( fn ); 1753 info.setFile( fn );
1754 QString mess; 1754 QString mess;
1755 bool loadbup = true; 1755 bool loadbup = true;
1756 if ( !info. exists() ) { 1756 if ( !info. exists() ) {
1757 mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); 1757 mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) );
1758 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1758 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1759 mess ); 1759 mess );
1760 return ret; 1760 return ret;
1761 } 1761 }
1762 int result = 0; 1762 int result = 0;
1763 if ( !quick ) { 1763 if ( !quick ) {
1764 mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 1764 mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
1765 result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1765 result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1766 mess, 1766 mess,
1767 i18n("Sync"), i18n("Cancel"), 0, 1767 i18n("Sync"), i18n("Cancel"), 0,
1768 0, 1 ); 1768 0, 1 );
1769 if ( result ) 1769 if ( result )
1770 return false; 1770 return false;
1771 } 1771 }
1772 if ( KOPrefs::instance()->mAskForPreferences ) 1772 if ( KOPrefs::instance()->mAskForPreferences )
1773 mView->edit_sync_options(); 1773 mView->edit_sync_options();
1774 if ( result == 0 ) { 1774 if ( result == 0 ) {
1775 //qDebug("Now sycing ... "); 1775 //qDebug("Now sycing ... ");
1776 if ( ret = mView->syncCalendar( fn, KOPrefs::instance()->mSyncAlgoPrefs ) ) 1776 if ( ret = mView->syncCalendar( fn, KOPrefs::instance()->mSyncAlgoPrefs ) )
1777 setCaption( i18n("Synchronization successful") ); 1777 setCaption( i18n("Synchronization successful") );
1778 else 1778 else
1779 setCaption( i18n("Sync cancelled or failed. Nothing synced.") ); 1779 setCaption( i18n("Sync cancelled or failed. Nothing synced.") );
1780 if ( ! quick ) 1780 if ( ! quick )
1781 KOPrefs::instance()->mLastSyncedLocalFile = fn; 1781 KOPrefs::instance()->mLastSyncedLocalFile = fn;
1782 slotModifiedChanged( true ); 1782 slotModifiedChanged( true );
1783 } 1783 }
1784 return ret; 1784 return ret;
1785} 1785}
1786void MainWindow::quickSyncLocalFile() 1786void MainWindow::quickSyncLocalFile()
1787{ 1787{
1788 //mView->setSyncDevice("local-file" ); 1788 //mView->setSyncDevice("local-file" );
1789 //qDebug("quickSyncLocalFile() "); 1789 //qDebug("quickSyncLocalFile() ");
1790 if ( syncWithFile( KOPrefs::instance()->mLastSyncedLocalFile, false ) ) { 1790 if ( syncWithFile( KOPrefs::instance()->mLastSyncedLocalFile, false ) ) {
1791 // Event* e = mView->getLastSyncEvent(); 1791 // Event* e = mView->getLastSyncEvent();
1792// e->setReadOnly( false ); 1792// e->setReadOnly( false );
1793// e->setLocation( i18n("Quick with file: ")+ KOPrefs::instance()->mLastSyncedLocalFile); 1793// e->setLocation( i18n("Quick with file: ")+ KOPrefs::instance()->mLastSyncedLocalFile);
1794// e->setReadOnly( true ); 1794// e->setReadOnly( true );
1795 1795
1796 } 1796 }
1797} 1797}
1798 1798
1799void MainWindow::confSync() 1799void MainWindow::confSync()
1800{ 1800{
1801 mView->confSync(); 1801 mView->confSync();
1802 fillSyncMenu(); 1802 fillSyncMenu();
1803 mView->writeSettings(); 1803 mView->writeSettings();
1804 1804
1805 1805
1806} 1806}
1807void MainWindow::syncRemote( KSyncProfile* prof, bool ask) 1807void MainWindow::syncRemote( KSyncProfile* prof, bool ask)
1808{ 1808{
1809 QString question; 1809 QString question;
1810 if ( ask ) { 1810 if ( ask ) {
1811 question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n"; 1811 question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n";
1812 if ( QMessageBox::information( this, i18n("KO/Pi Sync"), 1812 if ( QMessageBox::information( this, i18n("KO/Pi Sync"),
1813 question, 1813 question,
1814 i18n("Yes"), i18n("No"), 1814 i18n("Yes"), i18n("No"),
1815 0, 0 ) != 0 ) 1815 0, 0 ) != 0 )
1816 return; 1816 return;
1817 } 1817 }
1818 QString command = prof->getPreSyncCommand(); 1818 QString command = prof->getPreSyncCommand();
1819 int fi; 1819 int fi;
1820 if ( (fi = command.find("$PWD$")) > 0 ) { 1820 if ( (fi = command.find("$PWD$")) > 0 ) {
1821 QString pwd = getPassword(); 1821 QString pwd = getPassword();
1822 command = command.left( fi )+ pwd + command.mid( fi+5 ); 1822 command = command.left( fi )+ pwd + command.mid( fi+5 );
1823 1823
1824 } 1824 }
1825 int maxlen = 30; 1825 int maxlen = 30;
1826 if ( QApplication::desktop()->width() > 320 ) 1826 if ( QApplication::desktop()->width() > 320 )
1827 maxlen += 25; 1827 maxlen += 25;
1828 setCaption ( i18n( "Copy remote file to local machine..." ) ); 1828 setCaption ( i18n( "Copy remote file to local machine..." ) );
1829 int fileSize = 0; 1829 int fileSize = 0;
1830 int result = system ( command ); 1830 int result = system ( command );
1831 // 0 : okay 1831 // 0 : okay
1832 // 256: no such file or dir 1832 // 256: no such file or dir
1833 // 1833 //
1834 qDebug("KO: Remote copy result(0 = okay): %d ",result ); 1834 qDebug("KO: Remote copy result(0 = okay): %d ",result );
1835 if ( result != 0 ) { 1835 if ( result != 0 ) {
1836 int len = maxlen; 1836 int len = maxlen;
1837 while ( len < command.length() ) { 1837 while ( len < command.length() ) {
1838 command.insert( len , "\n" ); 1838 command.insert( len , "\n" );
1839 len += maxlen +2; 1839 len += maxlen +2;
1840 } 1840 }
1841 question = i18n("Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ; 1841 question = i18n("Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ;
1842 QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), 1842 QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"),
1843 question, 1843 question,
1844 i18n("Okay!")) ; 1844 i18n("Okay!")) ;
1845 setCaption ("KO/Pi"); 1845 setCaption ("KO/Pi");
1846 return; 1846 return;
1847 } 1847 }
1848 setCaption ( i18n( "Copying succeed." ) ); 1848 setCaption ( i18n( "Copying succeed." ) );
1849 //qDebug(" file **%s** ",prof->getLocalTempFile().latin1() ); 1849 //qDebug(" file **%s** ",prof->getLocalTempFile().latin1() );
1850 if ( syncWithFile( prof->getLocalTempFile(), true ) ) { 1850 if ( syncWithFile( prof->getLocalTempFile(), true ) ) {
1851// Event* e = mView->getLastSyncEvent(); 1851// Event* e = mView->getLastSyncEvent();
1852// e->setReadOnly( false ); 1852// e->setReadOnly( false );
1853// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); 1853// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
1854// e->setReadOnly( true ); 1854// e->setReadOnly( true );
1855 if ( KOPrefs::instance()->mWriteBackFile ) { 1855 if ( KOPrefs::instance()->mWriteBackFile ) {
1856 command = prof->getPostSyncCommand(); 1856 command = prof->getPostSyncCommand();
1857 setCaption ( i18n( "Writing back file ..." ) ); 1857 setCaption ( i18n( "Writing back file ..." ) );
1858 result = system ( command ); 1858 result = system ( command );
1859 qDebug("KO: Writing back file result: %d ", result); 1859 qDebug("KO: Writing back file result: %d ", result);
1860 if ( result != 0 ) { 1860 if ( result != 0 ) {
1861 setCaption ( i18n( "Writing back file result: " )+QString::number( result ) ); 1861 setCaption ( i18n( "Writing back file result: " )+QString::number( result ) );
1862 return; 1862 return;
1863 } else { 1863 } else {
1864 setCaption ( i18n( "Syncronization sucessfully completed" ) ); 1864 setCaption ( i18n( "Syncronization sucessfully completed" ) );
1865 } 1865 }
1866 } 1866 }
1867 } 1867 }
1868 return; 1868 return;
1869} 1869}
1870void MainWindow::syncSSH() 1870void MainWindow::syncSSH()
1871{ 1871{
1872 // not used anymore 1872 // not used anymore
1873 QTime timer; 1873 QTime timer;
1874 timer.start(); 1874 timer.start();
1875 //qDebug("MainWindow::syncssh() "); 1875 //qDebug("MainWindow::syncssh() ");
1876 KOPrefs *p = KOPrefs::instance(); 1876 KOPrefs *p = KOPrefs::instance();
1877 QString localFile = p->mLocalTempFile; 1877 QString localFile = p->mLocalTempFile;
1878 QString remoteIP = p->mRemoteIP; 1878 QString remoteIP = p->mRemoteIP;
1879 QString remoteUser = p->mRemoteUser; 1879 QString remoteUser = p->mRemoteUser;
1880 QString remoteFile = p->mRemoteFile; 1880 QString remoteFile = p->mRemoteFile;
1881 if ( p->mUsePassWd && p->mRemotePassWd.length() > 0 ) 1881 if ( p->mUsePassWd && p->mRemotePassWd.length() > 0 )
1882 remoteUser += ":" + p->mRemotePassWd; 1882 remoteUser += ":" + p->mRemotePassWd;
1883 1883
1884 QString question = i18n("Do you really want\nto remote sync?\n \n") + 1884 QString question = i18n("Do you really want\nto remote sync?\n \n") +
1885 i18n("IP: " ) +remoteIP +"\n" + 1885 i18n("IP: " ) +remoteIP +"\n" +
1886 i18n("User: " ) + remoteUser +"\n" ; 1886 i18n("User: " ) + remoteUser +"\n" ;
1887 int maxlen = 30; 1887 int maxlen = 30;
1888 if ( QApplication::desktop()->width() > 320 ) 1888 if ( QApplication::desktop()->width() > 320 )
1889 maxlen += 25; 1889 maxlen += 25;
1890 if ( remoteFile.length() > maxlen ) 1890 if ( remoteFile.length() > maxlen )
1891 question += i18n("Remote file:\n..." ) + remoteFile.right(maxlen) +"\n"; 1891 question += i18n("Remote file:\n..." ) + remoteFile.right(maxlen) +"\n";
1892 else 1892 else
1893 question += i18n("Remote file:\n " ) + remoteFile +"\n"; 1893 question += i18n("Remote file:\n " ) + remoteFile +"\n";
1894 if ( localFile.length() > maxlen ) 1894 if ( localFile.length() > maxlen )
1895 question += i18n("Local temp file:\n..." ) + localFile.right(maxlen) +"\n"; 1895 question += i18n("Local temp file:\n..." ) + localFile.right(maxlen) +"\n";
1896 else 1896 else
1897 question += i18n("Local temp file:\n " ) + localFile +"\n"; 1897 question += i18n("Local temp file:\n " ) + localFile +"\n";
1898 1898
1899 if ( QMessageBox::information( this, i18n("KO/Pi Sync"), 1899 if ( QMessageBox::information( this, i18n("KO/Pi Sync"),
1900 question, 1900 question,
1901 i18n("Yes"), i18n("No"), 1901 i18n("Yes"), i18n("No"),
1902 0, 0 ) != 0 ) 1902 0, 0 ) != 0 )
1903 return; 1903 return;
1904 // if ( !p->mUsePassWd ) { 1904 // if ( !p->mUsePassWd ) {
1905 // QString pass = getPassword(); 1905 // QString pass = getPassword();
1906 // if ( pass.length() > 0 ) 1906 // if ( pass.length() > 0 )
1907 // remoteUser += ":" + pass; 1907 // remoteUser += ":" + pass;
1908 // } 1908 // }
1909 QString command = "scp " + remoteUser + "@" + remoteIP +":" + remoteFile +" " +localFile; 1909 QString command = "scp " + remoteUser + "@" + remoteIP +":" + remoteFile +" " +localFile;
1910 setCaption ( i18n( "Copy remote file to local machine..." ) ); 1910 setCaption ( i18n( "Copy remote file to local machine..." ) );
1911 int fileSize = 0; 1911 int fileSize = 0;
1912 int result = system ( command ); 1912 int result = system ( command );
1913 // 0 : okay 1913 // 0 : okay
1914 // 256: no such file or dir 1914 // 256: no such file or dir
1915 // 1915 //
1916 qDebug("KO: Remote copy result(0 = okay): %d ",result ); 1916 qDebug("KO: Remote copy result(0 = okay): %d ",result );
1917 if ( result != 0 ) { 1917 if ( result != 0 ) {
1918 int len = maxlen; 1918 int len = maxlen;
1919 while ( len < command.length() ) { 1919 while ( len < command.length() ) {
1920 command.insert( len , "\n" ); 1920 command.insert( len , "\n" );
1921 len += maxlen +2; 1921 len += maxlen +2;
1922 } 1922 }
1923 question = i18n("Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ; 1923 question = i18n("Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ;
1924 QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), 1924 QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"),
1925 question, 1925 question,
1926 i18n("Okay!")) ; 1926 i18n("Okay!")) ;
1927 setCaption ("KO/Pi"); 1927 setCaption ("KO/Pi");
1928 return; 1928 return;
1929 } 1929 }
1930 1930
1931 1931
1932 setCaption ( i18n( "Copying succeed." ) ); 1932 setCaption ( i18n( "Copying succeed." ) );
1933 //mView->setSyncDevice("ssh-scp" ); 1933 //mView->setSyncDevice("ssh-scp" );
1934 if ( syncWithFile(localFile , true ) ) { 1934 if ( syncWithFile(localFile , true ) ) {
1935// Event* e = mView->getLastSyncEvent(); 1935// Event* e = mView->getLastSyncEvent();
1936// e->setReadOnly( false ); 1936// e->setReadOnly( false );
1937// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); 1937// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
1938// e->setReadOnly( true ); 1938// e->setReadOnly( true );
1939 if ( KOPrefs::instance()->mWriteBackFile ) { 1939 if ( KOPrefs::instance()->mWriteBackFile ) {
1940 command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ; 1940 command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ;
1941 setCaption ( i18n( "Writing back file ..." ) ); 1941 setCaption ( i18n( "Writing back file ..." ) );
1942 result = system ( command ); 1942 result = system ( command );
1943 if ( result != 0 ) { 1943 if ( result != 0 ) {
1944 int len = maxlen; 1944 int len = maxlen;
1945 while ( len < command.length() ) { 1945 while ( len < command.length() ) {
1946 command.insert( len , "\n" ); 1946 command.insert( len , "\n" );
1947 len += maxlen +2; 1947 len += maxlen +2;
1948 } 1948 }
1949 question = i18n("Sorry, the copy back command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ; 1949 question = i18n("Sorry, the copy back command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ;
1950 QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), 1950 QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"),
1951 question, 1951 question,
1952 i18n("Okay!")) ; 1952 i18n("Okay!")) ;
1953 setCaption ("KO/Pi"); 1953 setCaption ("KO/Pi");
1954 return; 1954 return;
1955 } else { 1955 } else {
1956 setCaption ( i18n( "Syncronization sucessfully completed" ) ); 1956 setCaption ( i18n( "Syncronization sucessfully completed" ) );
1957 } 1957 }
1958 } 1958 }
1959 } 1959 }
1960 return; 1960 return;
1961#if 0 1961#if 0
1962 system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics"); 1962 system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics");
1963 while ( timer.elapsed() < 5000 ) 1963 while ( timer.elapsed() < 5000 )
1964 qApp->processEvents(); 1964 qApp->processEvents();
1965 1965
1966 qDebug("MainWindow::merging) "); 1966 qDebug("MainWindow::merging) ");
1967 mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); 1967 mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 );
1968 while ( mBlockSaveFlag ) 1968 while ( mBlockSaveFlag )
1969 qApp->processEvents(); 1969 qApp->processEvents();
1970 save(); 1970 save();
1971 system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics"); 1971 system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics");
1972#endif 1972#endif
1973 1973
1974} 1974}
1975 1975
1976 1976
1977void MainWindow::syncSharp() 1977void MainWindow::syncSharp()
1978{ 1978{
1979 if ( mCalendarModifiedFlag ) 1979 if ( mCalendarModifiedFlag )
1980 save(); 1980 save();
1981 mView->syncSharp(); 1981 mView->syncSharp();
1982 slotModifiedChanged( true ); 1982 slotModifiedChanged( true );
1983 1983
1984} 1984}
1985 1985
1986void MainWindow::printSel( ) 1986void MainWindow::printSel( )
1987{ 1987{
1988 mView->viewManager()->agendaView()->agenda()->printSelection(); 1988 mView->viewManager()->agendaView()->agenda()->printSelection();
1989} 1989}
1990 1990
1991void MainWindow::printCal() 1991void MainWindow::printCal()
1992{ 1992{
1993 mView->print();//mCp->showDialog(); 1993 mView->print();//mCp->showDialog();
1994} 1994}