summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp4
-rw-r--r--korganizer/koprefs.h3
-rw-r--r--korganizer/mainwindow.cpp25
3 files changed, 13 insertions, 19 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 716a125..84e3d00 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,213 +1,209 @@
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 <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "koprefs.h" 46#include "koprefs.h"
47#include "mainwindow.h" 47#include "mainwindow.h"
48 48
49const char *germanwords[][2] = { 49const char *germanwords[][2] = {
50#include "wordsgerman.h" 50#include "wordsgerman.h"
51 "", "" 51 "", ""
52}; 52};
53 53
54KOPrefs *KOPrefs::mInstance = 0; 54KOPrefs *KOPrefs::mInstance = 0;
55static KStaticDeleter<KOPrefs> insd; 55static KStaticDeleter<KOPrefs> insd;
56 56
57KOPrefs::KOPrefs() : 57KOPrefs::KOPrefs() :
58 KPimPrefs("korganizerrc") 58 KPimPrefs("korganizerrc")
59{ 59{
60 mCategoryColors.setAutoDelete(true); 60 mCategoryColors.setAutoDelete(true);
61 mLocaleDict = 0; 61 mLocaleDict = 0;
62 fillMailDefaults(); 62 fillMailDefaults();
63 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 63 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
64 QColor defaultHolidayColor = QColor(255,0,0); 64 QColor defaultHolidayColor = QColor(255,0,0);
65 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 65 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
66 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 66 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
67 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 67 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
68 QColor defaultTodoDueTodayColor = QColor(255,220,100); 68 QColor defaultTodoDueTodayColor = QColor(255,220,100);
69 QColor defaultTodoOverdueColor = QColor(255,153,125); 69 QColor defaultTodoOverdueColor = QColor(255,153,125);
70 70
71 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 71 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
72 mDefaultViewFont = QFont("helvetica",10); 72 mDefaultViewFont = QFont("helvetica",10);
73 mDefaultMonthViewFont = QFont("helvetica",8); 73 mDefaultMonthViewFont = QFont("helvetica",8);
74 mMarcusBainsFont= QFont("helvetica",10); 74 mMarcusBainsFont= QFont("helvetica",10);
75 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 75 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
76 mEditBoxFont = QFont("helvetica",12); 76 mEditBoxFont = QFont("helvetica",12);
77 mJornalViewFont = QFont("helvetica",12); 77 mJornalViewFont = QFont("helvetica",12);
78 78
79 KPrefs::setCurrentGroup("General"); 79 KPrefs::setCurrentGroup("General");
80 80
81 81
82 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm");
83 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda");
84 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i");
85
86 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 82 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
87 83
88 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 84 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
89 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 85 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
90 addItemBool("ShowIconSearch",&mShowIconSearch,true); 86 addItemBool("ShowIconSearch",&mShowIconSearch,true);
91 addItemBool("ShowIconList",&mShowIconList,true); 87 addItemBool("ShowIconList",&mShowIconList,true);
92 addItemBool("ShowIconDay1",&mShowIconDay1,true); 88 addItemBool("ShowIconDay1",&mShowIconDay1,true);
93 addItemBool("ShowIconDay5",&mShowIconDay5,true); 89 addItemBool("ShowIconDay5",&mShowIconDay5,true);
94 addItemBool("ShowIconDay7",&mShowIconDay7,true); 90 addItemBool("ShowIconDay7",&mShowIconDay7,true);
95 addItemBool("ShowIconMonth",&mShowIconMonth,true); 91 addItemBool("ShowIconMonth",&mShowIconMonth,true);
96 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 92 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
97 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 93 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
98 addItemBool("ShowIconBack",&mShowIconBack,true); 94 addItemBool("ShowIconBack",&mShowIconBack,true);
99 addItemBool("ShowIconToday",&mShowIconToday,true); 95 addItemBool("ShowIconToday",&mShowIconToday,true);
100 addItemBool("ShowIconForward",&mShowIconForward,true); 96 addItemBool("ShowIconForward",&mShowIconForward,true);
101 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 97 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
102 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); 98 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false);
103 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 99 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
104 addItemBool("ShowIconNext",&mShowIconNext,true); 100 addItemBool("ShowIconNext",&mShowIconNext,true);
105 addItemBool("ShowIconJournal",&mShowIconJournal,true); 101 addItemBool("ShowIconJournal",&mShowIconJournal,true);
106 addItemBool("ShowIconStretch",&mShowIconStretch,true); 102 addItemBool("ShowIconStretch",&mShowIconStretch,true);
107 addItemBool("LanguageChanged",&mLanguageChanged,false); 103 addItemBool("LanguageChanged",&mLanguageChanged,false);
108 104
109 addItemBool("AskForQuit",&mAskForQuit,false); 105 addItemBool("AskForQuit",&mAskForQuit,false);
110 106
111#ifndef DESKTOP_VERSION 107#ifndef DESKTOP_VERSION
112 addItemBool("ShowFullMenu",&mShowFullMenu,false); 108 addItemBool("ShowFullMenu",&mShowFullMenu,false);
113#else 109#else
114 addItemBool("ShowFullMenu",&mShowFullMenu,true); 110 addItemBool("ShowFullMenu",&mShowFullMenu,true);
115#endif 111#endif
116 addItemBool("ToolBarHor",&mToolBarHor, true ); 112 addItemBool("ToolBarHor",&mToolBarHor, true );
117 addItemBool("ToolBarUp",&mToolBarUp, false ); 113 addItemBool("ToolBarUp",&mToolBarUp, false );
118 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 114 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
119 addItemInt("Whats Next Days",&mWhatsNextDays,3); 115 addItemInt("Whats Next Days",&mWhatsNextDays,3);
120 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 116 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
121 117
122 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 118 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
123 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 119 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
124 addItemInt("AllDay Size",&mAllDaySize,28); 120 addItemInt("AllDay Size",&mAllDaySize,28);
125 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 121 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
126 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 122 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
127 123
128 addItemStringList("LocationDefaults",&mLocationDefaults ); 124 addItemStringList("LocationDefaults",&mLocationDefaults );
129 addItemStringList("EventSummary User",&mEventSummaryUser); 125 addItemStringList("EventSummary User",&mEventSummaryUser);
130 addItemStringList("TodoSummary User",&mTodoSummaryUser); 126 addItemStringList("TodoSummary User",&mTodoSummaryUser);
131 127
132 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 128 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
133 addItemBool("Enable Project View",&mEnableProjectView,false); 129 addItemBool("Enable Project View",&mEnableProjectView,false);
134 addItemBool("Auto Save",&mAutoSave,false); 130 addItemBool("Auto Save",&mAutoSave,false);
135 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 131 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
136 addItemBool("Confirm Deletes",&mConfirm,true); 132 addItemBool("Confirm Deletes",&mConfirm,true);
137 addItemString("Archive File",&mArchiveFile); 133 addItemString("Archive File",&mArchiveFile);
138 addItemString("Html Export File",&mHtmlExportFile, 134 addItemString("Html Export File",&mHtmlExportFile,
139 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 135 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
140 addItemBool("Html With Save",&mHtmlWithSave,false); 136 addItemBool("Html With Save",&mHtmlWithSave,false);
141 137
142 KPrefs::setCurrentGroup("Personal Settings"); 138 KPrefs::setCurrentGroup("Personal Settings");
143 139
144 addItemInt("Mail Client",&mMailClient,MailClientKMail); 140 addItemInt("Mail Client",&mMailClient,MailClientKMail);
145 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 141 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
146 addItemBool("Bcc",&mBcc,false); 142 addItemBool("Bcc",&mBcc,false);
147 143
148 KPrefs::setCurrentGroup("Time & Date"); 144 KPrefs::setCurrentGroup("Time & Date");
149 145
150 // addItemString("Time Zone",&mTimeZone,"+0100"); 146 // addItemString("Time Zone",&mTimeZone,"+0100");
151 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); 147 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
152 // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60); 148 // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60);
153 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 149 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
154 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 150 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
155 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 151 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
156 152
157 153
158 addItemInt("Default Start Time",&mStartTime,10); 154 addItemInt("Default Start Time",&mStartTime,10);
159 addItemInt("Default Duration",&mDefaultDuration,2); 155 addItemInt("Default Duration",&mDefaultDuration,2);
160 addItemInt("Default Alarm Time",&mAlarmTime,3); 156 addItemInt("Default Alarm Time",&mAlarmTime,3);
161 addItemInt("Daylight Savings",&mDaylightSavings,0); 157 addItemInt("Daylight Savings",&mDaylightSavings,0);
162 KPrefs::setCurrentGroup("AlarmSettings"); 158 KPrefs::setCurrentGroup("AlarmSettings");
163 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 159 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
164 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 160 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
165 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 161 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
166 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 162 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
167 163
168 164
169 KPrefs::setCurrentGroup("Calendar"); 165 KPrefs::setCurrentGroup("Calendar");
170 166
171 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 167 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
172 168
173 KPrefs::setCurrentGroup("Fonts"); 169 KPrefs::setCurrentGroup("Fonts");
174 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 170 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
175 addItemFont("TimeBar Font",&mTimeBarFont); 171 addItemFont("TimeBar Font",&mTimeBarFont);
176 addItemFont("MonthView Font",&mMonthViewFont); 172 addItemFont("MonthView Font",&mMonthViewFont);
177 addItemFont("AgendaView Font",&mAgendaViewFont); 173 addItemFont("AgendaView Font",&mAgendaViewFont);
178 addItemFont("MarcusBains Font",&mMarcusBainsFont); 174 addItemFont("MarcusBains Font",&mMarcusBainsFont);
179 addItemFont("TimeLabels Font",&mTimeLabelsFont); 175 addItemFont("TimeLabels Font",&mTimeLabelsFont);
180 addItemFont("TodoView Font",&mTodoViewFont); 176 addItemFont("TodoView Font",&mTodoViewFont);
181 addItemFont("ListView Font",&mListViewFont); 177 addItemFont("ListView Font",&mListViewFont);
182 addItemFont("DateNavigator Font",&mDateNavigatorFont); 178 addItemFont("DateNavigator Font",&mDateNavigatorFont);
183 addItemFont("EditBox Font",&mEditBoxFont); 179 addItemFont("EditBox Font",&mEditBoxFont);
184 addItemFont("JournalView Font",&mJornalViewFont); 180 addItemFont("JournalView Font",&mJornalViewFont);
185 addItemFont("WhatsNextView Font",&mWhatsNextFont); 181 addItemFont("WhatsNextView Font",&mWhatsNextFont);
186 addItemFont("EventView Font",&mEventViewFont); 182 addItemFont("EventView Font",&mEventViewFont);
187 183
188// KPrefs::setCurrentGroup("SyncProfiles"); 184// KPrefs::setCurrentGroup("SyncProfiles");
189// addItemString("LocalMachineName",&mLocalMachineName, "undefined"); 185// addItemString("LocalMachineName",&mLocalMachineName, "undefined");
190// addItemStringList("SyncProfileNames",&mSyncProfileNames); 186// addItemStringList("SyncProfileNames",&mSyncProfileNames);
191// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); 187// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames);
192 188
193 KPrefs::setCurrentGroup("RemoteSyncing"); 189 KPrefs::setCurrentGroup("RemoteSyncing");
194// addItemBool("UsePasswd",&mUsePassWd,false); 190// addItemBool("UsePasswd",&mUsePassWd,false);
195// addItemBool("WriteBackFile",&mWriteBackFile,true); 191// addItemBool("WriteBackFile",&mWriteBackFile,true);
196// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); 192// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false);
197// addItemBool("AskForPreferences",&mAskForPreferences,true); 193// addItemBool("AskForPreferences",&mAskForPreferences,true);
198// addItemBool("ShowSyncSummary",&mShowSyncSummary,true); 194// addItemBool("ShowSyncSummary",&mShowSyncSummary,true);
199 addItemString("PassiveSyncPort",&mPassiveSyncPort,"9197" ); 195 addItemString("PassiveSyncPort",&mPassiveSyncPort,"9197" );
200 addItemString("PassiveSyncPw",&mPassiveSyncPw,"abc" ); 196 addItemString("PassiveSyncPw",&mPassiveSyncPw,"abc" );
201 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 197 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
202 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 198 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
203 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 199 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
204 addItemInt("LastSyncTime",&mLastSyncTime,0); 200 addItemInt("LastSyncTime",&mLastSyncTime,0);
205 addItemInt("SyncAlgoPrefs",&mSyncAlgoPrefs,3); 201 addItemInt("SyncAlgoPrefs",&mSyncAlgoPrefs,3);
206 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); 202 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3);
207 203
208#ifdef _WIN32_ 204#ifdef _WIN32_
209 QString hdp= locateLocal("data","korganizer")+"\\\\"; 205 QString hdp= locateLocal("data","korganizer")+"\\\\";
210#else 206#else
211 QString hdp= locateLocal("data","korganizer")+"/"; 207 QString hdp= locateLocal("data","korganizer")+"/";
212#endif 208#endif
213// addItemString("RemoteIP",&mRemoteIP, "192.168.0.65"); 209// addItemString("RemoteIP",&mRemoteIP, "192.168.0.65");
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index a1ba8b3..d9ac851 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -85,232 +85,229 @@ class KOPrefs : public KPimPrefs
85 bool mEmailControlCenter; 85 bool mEmailControlCenter;
86 86
87 bool mBcc; 87 bool mBcc;
88 bool mAutoSave; 88 bool mAutoSave;
89 int mAutoSaveInterval; 89 int mAutoSaveInterval;
90 bool mConfirm; 90 bool mConfirm;
91 91
92 bool mEnableGroupScheduling; 92 bool mEnableGroupScheduling;
93 bool mEnableProjectView; 93 bool mEnableProjectView;
94 94
95 int mDefaultFormat; 95 int mDefaultFormat;
96 int mMailClient; 96 int mMailClient;
97 97
98 QString mTimeZone; 98 QString mTimeZone;
99 //QString mTimeZoneName; // e.g. +00:04:00 Indian/Mauritius 99 //QString mTimeZoneName; // e.g. +00:04:00 Indian/Mauritius
100 //int mTimeZoneOffset; // e.g. -240 min 100 //int mTimeZoneOffset; // e.g. -240 min
101 int mStartTime; 101 int mStartTime;
102 int mDefaultDuration; 102 int mDefaultDuration;
103 int mAlarmTime; 103 int mAlarmTime;
104 int mDaylightSavings; 104 int mDaylightSavings;
105 105
106 int mWorkingHoursStart; 106 int mWorkingHoursStart;
107 int mWorkingHoursEnd; 107 int mWorkingHoursEnd;
108 bool mExcludeHolidays; 108 bool mExcludeHolidays;
109 bool mExcludeSaturdays; 109 bool mExcludeSaturdays;
110 bool mMarcusBainsShowSeconds; 110 bool mMarcusBainsShowSeconds;
111 111
112 QFont mTimeBarFont; 112 QFont mTimeBarFont;
113 QFont mMonthViewFont; 113 QFont mMonthViewFont;
114 QFont mAgendaViewFont; 114 QFont mAgendaViewFont;
115 QFont mMarcusBainsFont; 115 QFont mMarcusBainsFont;
116 QFont mTimeLabelsFont; 116 QFont mTimeLabelsFont;
117 QFont mTodoViewFont; 117 QFont mTodoViewFont;
118 QFont mListViewFont; 118 QFont mListViewFont;
119 QFont mDateNavigatorFont; 119 QFont mDateNavigatorFont;
120 QFont mEditBoxFont; 120 QFont mEditBoxFont;
121 QFont mJornalViewFont; 121 QFont mJornalViewFont;
122 QFont mWhatsNextFont; 122 QFont mWhatsNextFont;
123 QFont mEventViewFont; 123 QFont mEventViewFont;
124 124
125 125
126 126
127 127
128 QColor mHolidayColor; 128 QColor mHolidayColor;
129 QColor mHighlightColor; 129 QColor mHighlightColor;
130 QColor mEventColor; 130 QColor mEventColor;
131 QColor mAgendaBgColor; 131 QColor mAgendaBgColor;
132 QColor mWorkingHoursColor; 132 QColor mWorkingHoursColor;
133 QColor mTodoDueTodayColor; 133 QColor mTodoDueTodayColor;
134 QColor mTodoOverdueColor; 134 QColor mTodoOverdueColor;
135 QColor mMonthViewEvenColor; 135 QColor mMonthViewEvenColor;
136 QColor mMonthViewOddColor; 136 QColor mMonthViewOddColor;
137 QColor mMonthViewHolidayColor; 137 QColor mMonthViewHolidayColor;
138 bool mMonthViewUsesDayColors; 138 bool mMonthViewUsesDayColors;
139 bool mMonthViewSatSunTog; 139 bool mMonthViewSatSunTog;
140 QColor mAppColor1; 140 QColor mAppColor1;
141 QColor mAppColor2; 141 QColor mAppColor2;
142 bool mUseAppColors; 142 bool mUseAppColors;
143 143
144 int mDayBegins; 144 int mDayBegins;
145 int mHourSize; 145 int mHourSize;
146 int mAllDaySize; 146 int mAllDaySize;
147 bool mShowFullMenu; 147 bool mShowFullMenu;
148 bool mDailyRecur; 148 bool mDailyRecur;
149 bool mWeeklyRecur; 149 bool mWeeklyRecur;
150 bool mMonthDailyRecur; 150 bool mMonthDailyRecur;
151 bool mMonthWeeklyRecur; 151 bool mMonthWeeklyRecur;
152 bool mMonthShowIcons; 152 bool mMonthShowIcons;
153 bool mMonthShowShort; 153 bool mMonthShowShort;
154 bool mEnableToolTips; 154 bool mEnableToolTips;
155 bool mEnableMonthScroll; 155 bool mEnableMonthScroll;
156 bool mFullViewMonth; 156 bool mFullViewMonth;
157 bool mMonthViewUsesCategoryColor; 157 bool mMonthViewUsesCategoryColor;
158 bool mFullViewTodo; 158 bool mFullViewTodo;
159 bool mShowCompletedTodo; 159 bool mShowCompletedTodo;
160 bool mMarcusBainsEnabled; 160 bool mMarcusBainsEnabled;
161 int mNextXDays; 161 int mNextXDays;
162 int mWhatsNextDays; 162 int mWhatsNextDays;
163 int mWhatsNextPrios; 163 int mWhatsNextPrios;
164 bool mEnableQuickTodo; 164 bool mEnableQuickTodo;
165 bool mLanguageChanged; 165 bool mLanguageChanged;
166 166
167 bool mCompactDialogs; 167 bool mCompactDialogs;
168 bool mVerticalScreen; 168 bool mVerticalScreen;
169 169
170 bool mShowIconNewTodo; 170 bool mShowIconNewTodo;
171 bool mShowIconNewEvent; 171 bool mShowIconNewEvent;
172 bool mShowIconSearch; 172 bool mShowIconSearch;
173 bool mShowIconList; 173 bool mShowIconList;
174 bool mShowIconDay1; 174 bool mShowIconDay1;
175 bool mShowIconDay5; 175 bool mShowIconDay5;
176 bool mShowIconDay7; 176 bool mShowIconDay7;
177 bool mShowIconMonth; 177 bool mShowIconMonth;
178 bool mShowIconTodoview; 178 bool mShowIconTodoview;
179 bool mShowIconBackFast; 179 bool mShowIconBackFast;
180 bool mShowIconBack; 180 bool mShowIconBack;
181 bool mShowIconToday; 181 bool mShowIconToday;
182 bool mShowIconForward; 182 bool mShowIconForward;
183 bool mShowIconForwardFast; 183 bool mShowIconForwardFast;
184 bool mShowIconWhatsThis; 184 bool mShowIconWhatsThis;
185 bool mShowIconNextDays; 185 bool mShowIconNextDays;
186 bool mShowIconNext; 186 bool mShowIconNext;
187 bool mShowIconJournal; 187 bool mShowIconJournal;
188 188
189 bool mShowIconStretch; 189 bool mShowIconStretch;
190 190
191 bool mToolBarHor; 191 bool mToolBarHor;
192 bool mToolBarUp; 192 bool mToolBarUp;
193 bool mToolBarMiniIcons; 193 bool mToolBarMiniIcons;
194 194
195 bool mAskForQuit; 195 bool mAskForQuit;
196 bool mUsePassWd; 196 bool mUsePassWd;
197 bool mWriteBackFile; 197 bool mWriteBackFile;
198 int mWriteBackInFuture; 198 int mWriteBackInFuture;
199 bool mAskForPreferences; 199 bool mAskForPreferences;
200 bool mShowSyncSummary; 200 bool mShowSyncSummary;
201 bool mShowSyncEvents; 201 bool mShowSyncEvents;
202 bool mShowTodoInAgenda; 202 bool mShowTodoInAgenda;
203 bool mWriteBackExistingOnly; 203 bool mWriteBackExistingOnly;
204 204
205 QString mRemoteIP; 205 QString mRemoteIP;
206 QString mRemoteUser; 206 QString mRemoteUser;
207 QString mRemotePassWd; 207 QString mRemotePassWd;
208 QString mRemoteFile; 208 QString mRemoteFile;
209 QString mLocalTempFile; 209 QString mLocalTempFile;
210 QString mPhoneDevice; 210 QString mPhoneDevice;
211 QString mPhoneConnection; 211 QString mPhoneConnection;
212 QString mPhoneModel; 212 QString mPhoneModel;
213 QString mEx2PhoneDevice;
214 QString mEx2PhoneConnection;
215 QString mEx2PhoneModel;
216 213
217 int mLastSyncTime; 214 int mLastSyncTime;
218 int mSyncAlgoPrefs; 215 int mSyncAlgoPrefs;
219 int mRingSyncAlgoPrefs; 216 int mRingSyncAlgoPrefs;
220 QStringList mSyncProfileNames; 217 QStringList mSyncProfileNames;
221 QStringList mExternSyncProfiles; 218 QStringList mExternSyncProfiles;
222 QString mLocalMachineName; 219 QString mLocalMachineName;
223 void setCategoryColor(QString cat,const QColor & color); 220 void setCategoryColor(QString cat,const QColor & color);
224 QColor *categoryColor(QString cat); 221 QColor *categoryColor(QString cat);
225 222
226 QString mArchiveFile; 223 QString mArchiveFile;
227 QString mHtmlExportFile; 224 QString mHtmlExportFile;
228 bool mHtmlWithSave; 225 bool mHtmlWithSave;
229 226
230 QStringList mSelectedPlugins; 227 QStringList mSelectedPlugins;
231 228
232 QString mLastImportFile; 229 QString mLastImportFile;
233 QString mLastVcalFile; 230 QString mLastVcalFile;
234 QString mLastSaveFile; 231 QString mLastSaveFile;
235 QString mLastLoadFile; 232 QString mLastLoadFile;
236 QString mLastSyncedLocalFile; 233 QString mLastSyncedLocalFile;
237 234
238 235
239 QString mDefaultAlarmFile; 236 QString mDefaultAlarmFile;
240 int mIMIPScheduler; 237 int mIMIPScheduler;
241 int mIMIPSend; 238 int mIMIPSend;
242 QStringList mAdditionalMails; 239 QStringList mAdditionalMails;
243 int mIMIPAutoRefresh; 240 int mIMIPAutoRefresh;
244 int mIMIPAutoInsertReply; 241 int mIMIPAutoInsertReply;
245 int mIMIPAutoInsertRequest; 242 int mIMIPAutoInsertRequest;
246 int mIMIPAutoFreeBusy; 243 int mIMIPAutoFreeBusy;
247 int mIMIPAutoFreeBusyReply; 244 int mIMIPAutoFreeBusyReply;
248 245
249 QStringList mTodoTemplates; 246 QStringList mTodoTemplates;
250 QStringList mEventTemplates; 247 QStringList mEventTemplates;
251 248
252 int mDestination; 249 int mDestination;
253 250
254 251
255 bool mEditOnDoubleClick; 252 bool mEditOnDoubleClick;
256 bool mViewChangeHoldFullscreen; 253 bool mViewChangeHoldFullscreen;
257 bool mViewChangeHoldNonFullscreen; 254 bool mViewChangeHoldNonFullscreen;
258 bool mCenterOnCurrentTime; 255 bool mCenterOnCurrentTime;
259 bool mSetTimeToDayStartAt; 256 bool mSetTimeToDayStartAt;
260 bool mHighlightCurrentDay; 257 bool mHighlightCurrentDay;
261 bool mUseHighlightLightColor; 258 bool mUseHighlightLightColor;
262 bool mListViewMonthTimespan; 259 bool mListViewMonthTimespan;
263 bool mWNViewShowsParents; 260 bool mWNViewShowsParents;
264 bool mWNViewShowLocation; 261 bool mWNViewShowLocation;
265 bool mTodoViewShowsPercentage; 262 bool mTodoViewShowsPercentage;
266 bool mTodoViewUsesCatColors; 263 bool mTodoViewUsesCatColors;
267 bool mTodoViewUsesSmallFont; 264 bool mTodoViewUsesSmallFont;
268 bool mTodoViewUsesForegroundColor; 265 bool mTodoViewUsesForegroundColor;
269 bool mMonthViewUsesForegroundColor; 266 bool mMonthViewUsesForegroundColor;
270 267
271 bool mHightlightDateTimeEdit; 268 bool mHightlightDateTimeEdit;
272 bool mShortDateInViewer; 269 bool mShortDateInViewer;
273 270
274 QStringList mLocationDefaults; 271 QStringList mLocationDefaults;
275 QStringList mEventSummaryUser; 272 QStringList mEventSummaryUser;
276 QStringList mTodoSummaryUser; 273 QStringList mTodoSummaryUser;
277 274
278 bool mUseInternalAlarmNotification; 275 bool mUseInternalAlarmNotification;
279 int mAlarmPlayBeeps; 276 int mAlarmPlayBeeps;
280 int mAlarmSuspendTime; 277 int mAlarmSuspendTime;
281 int mAlarmSuspendCount; 278 int mAlarmSuspendCount;
282 int mAlarmBeepInterval; 279 int mAlarmBeepInterval;
283 280
284 QString mPassiveSyncPort; 281 QString mPassiveSyncPort;
285 QString mPassiveSyncPw; 282 QString mPassiveSyncPw;
286 QString mActiveSyncPort; 283 QString mActiveSyncPort;
287 QString mActiveSyncIP; 284 QString mActiveSyncIP;
288 285
289 286
290 //US I copied the following settings into KPimGlobalPrefs 287 //US I copied the following settings into KPimGlobalPrefs
291 // that allows us later to easily remove the settings from here. 288 // that allows us later to easily remove the settings from here.
292 int mPreferredDate; 289 int mPreferredDate;
293 QString mUserDateFormatLong; 290 QString mUserDateFormatLong;
294 QString mUserDateFormatShort; 291 QString mUserDateFormatShort;
295 int mPreferredLanguage; 292 int mPreferredLanguage;
296 int mPreferredTime; 293 int mPreferredTime;
297 bool mWeekStartsOnSunday; 294 bool mWeekStartsOnSunday;
298 QString mTimeZoneId; 295 QString mTimeZoneId;
299 bool mUseDaylightsaving; 296 bool mUseDaylightsaving;
300 int mDaylightsavingStart; 297 int mDaylightsavingStart;
301 int mDaylightsavingEnd; 298 int mDaylightsavingEnd;
302 299
303 300
304 private: 301 private:
305 QDict<QColor> mCategoryColors; 302 QDict<QColor> mCategoryColors;
306 QColor mDefaultCategoryColor; 303 QColor mDefaultCategoryColor;
307 304
308 QFont mDefaultTimeBarFont; 305 QFont mDefaultTimeBarFont;
309 QFont mDefaultViewFont; 306 QFont mDefaultViewFont;
310 QFont mDefaultMonthViewFont; 307 QFont mDefaultMonthViewFont;
311 308
312 QString mName; 309 QString mName;
313 QString mEmail; 310 QString mEmail;
314}; 311};
315 312
316#endif 313#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index bd14fbf..2f286e0 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,234 +1,234 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlineedit.h> 9#include <qlineedit.h>
10#include <qtextcodec.h> 10#include <qtextcodec.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qdir.h> 12#include <qdir.h>
13#include <qapp.h> 13#include <qapp.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qmap.h> 18#include <qmap.h>
19#include <qwmatrix.h> 19#include <qwmatrix.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qtextstream.h> 21#include <qtextstream.h>
22#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qpemenubar.h> 24#include <qpe/qpemenubar.h>
25#include <qpe/qpetoolbar.h> 25#include <qpe/qpetoolbar.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qtopia/alarmserver.h> 28#include <qtopia/alarmserver.h>
29#include <qtopia/qcopenvelope_qws.h> 29#include <qtopia/qcopenvelope_qws.h>
30#include <unistd.h> // for sleep 30#include <unistd.h> // for sleep
31#else 31#else
32#include <qmenubar.h> 32#include <qmenubar.h>
33#include <qtoolbar.h> 33#include <qtoolbar.h>
34#include <qapplication.h> 34#include <qapplication.h>
35//#include <resource.h> 35//#include <resource.h>
36 36
37#endif 37#endif
38#include <libkcal/calendarlocal.h> 38#include <libkcal/calendarlocal.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40#include <libkcal/phoneformat.h> 40#include <libkcal/phoneformat.h>
41#include <libkdepim/ksyncprofile.h> 41#include <libkdepim/ksyncprofile.h>
42#include <libkcal/kincidenceformatter.h> 42#include <libkcal/kincidenceformatter.h>
43#include <libkdepim/kpimglobalprefs.h> 43#include <libkdepim/kpimglobalprefs.h>
44 44
45#include "calendarview.h" 45#include "calendarview.h"
46#include "koviewmanager.h" 46#include "koviewmanager.h"
47#include "datenavigator.h" 47#include "datenavigator.h"
48#include "koagendaview.h" 48#include "koagendaview.h"
49#include "koagenda.h" 49#include "koagenda.h"
50#include "kodialogmanager.h" 50#include "kodialogmanager.h"
51#include "kdialogbase.h" 51#include "kdialogbase.h"
52#include "kapplication.h" 52#include "kapplication.h"
53#include "kofilterview.h" 53#include "kofilterview.h"
54#include "kstandarddirs.h" 54#include "kstandarddirs.h"
55#include "koprefs.h" 55#include "koprefs.h"
56#include "kfiledialog.h" 56#include "kfiledialog.h"
57#include "koglobals.h" 57#include "koglobals.h"
58#include "kglobal.h" 58#include "kglobal.h"
59#include "klocale.h" 59#include "klocale.h"
60#include "kconfig.h" 60#include "kconfig.h"
61#include "simplealarmclient.h" 61#include "simplealarmclient.h"
62#include "externalapphandler.h" 62#include "externalapphandler.h"
63 63
64using namespace KCal; 64using namespace KCal;
65#ifndef _WIN32_ 65#ifndef _WIN32_
66#include <unistd.h> 66#include <unistd.h>
67#else 67#else
68#include "koimportoldialog.h" 68#include "koimportoldialog.h"
69#endif 69#endif
70#include "mainwindow.h" 70#include "mainwindow.h"
71 71
72class KOex2phonePrefs : public QDialog 72class KOex2phonePrefs : public QDialog
73{ 73{
74 public: 74 public:
75 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 75 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
76 QDialog( parent, name, true ) 76 QDialog( parent, name, true )
77 { 77 {
78 setCaption( i18n("Export to phone options") ); 78 setCaption( i18n("Export to phone options") );
79 QVBoxLayout* lay = new QVBoxLayout( this ); 79 QVBoxLayout* lay = new QVBoxLayout( this );
80 lay->setSpacing( 3 ); 80 lay->setSpacing( 3 );
81 lay->setMargin( 3 ); 81 lay->setMargin( 3 );
82 QLabel *lab; 82 QLabel *lab;
83 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 83 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
84 lab->setAlignment (AlignHCenter ); 84 lab->setAlignment (AlignHCenter );
85 QHBox* temphb; 85 QHBox* temphb;
86 temphb = new QHBox( this ); 86 temphb = new QHBox( this );
87 new QLabel( i18n("I/O device: "), temphb ); 87 new QLabel( i18n("I/O device: "), temphb );
88 mPhoneDevice = new QLineEdit( temphb); 88 mPhoneDevice = new QLineEdit( temphb);
89 lay->addWidget( temphb ); 89 lay->addWidget( temphb );
90 temphb = new QHBox( this ); 90 temphb = new QHBox( this );
91 new QLabel( i18n("Connection: "), temphb ); 91 new QLabel( i18n("Connection: "), temphb );
92 mPhoneConnection = new QLineEdit( temphb); 92 mPhoneConnection = new QLineEdit( temphb);
93 lay->addWidget( temphb ); 93 lay->addWidget( temphb );
94 temphb = new QHBox( this ); 94 temphb = new QHBox( this );
95 new QLabel( i18n("Model(opt.): "), temphb ); 95 new QLabel( i18n("Model(opt.): "), temphb );
96 mPhoneModel = new QLineEdit( temphb); 96 mPhoneModel = new QLineEdit( temphb);
97 lay->addWidget( temphb ); 97 lay->addWidget( temphb );
98 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 98 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
99 mWriteBackFuture->setChecked( true ); 99 mWriteBackFuture->setChecked( true );
100 lay->addWidget( mWriteBackFuture ); 100 lay->addWidget( mWriteBackFuture );
101 temphb = new QHBox( this ); 101 temphb = new QHBox( this );
102 new QLabel( i18n("Max. weeks in future: ") , temphb ); 102 new QLabel( i18n("Max. weeks in future: ") , temphb );
103 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 103 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
104 mWriteBackFutureWeeks->setValue( 8 ); 104 mWriteBackFutureWeeks->setValue( 8 );
105 lay->addWidget( temphb ); 105 lay->addWidget( temphb );
106 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\n todo/calendar data on phone!"), this ) ); 106 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
107 lab->setAlignment (AlignHCenter ); 107 lab->setAlignment (AlignHCenter );
108 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 108 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
109 lay->addWidget( ok ); 109 lay->addWidget( ok );
110 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 110 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
111 lay->addWidget( cancel ); 111 lay->addWidget( cancel );
112 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 112 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
113 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 113 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
114 resize( 220, 240 ); 114 resize( 220, 240 );
115 115
116 } 116 }
117 117
118public: 118public:
119 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 119 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
120 QCheckBox* mWriteBackFuture; 120 QCheckBox* mWriteBackFuture;
121 QSpinBox* mWriteBackFutureWeeks; 121 QSpinBox* mWriteBackFutureWeeks;
122}; 122};
123 123
124int globalFlagBlockStartup; 124int globalFlagBlockStartup;
125MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 125MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
126 QMainWindow( parent, name ) 126 QMainWindow( parent, name )
127{ 127{
128 mPassWordPiSync = "abc"; 128 mPassWordPiSync = "abc";
129#ifdef DESKTOP_VERSION 129#ifdef DESKTOP_VERSION
130 setFont( QFont("Arial"), 14 ); 130 setFont( QFont("Arial"), 14 );
131#endif 131#endif
132 mSyncActionDialog = 0; 132 mSyncActionDialog = 0;
133 mServerSocket = 0; 133 mServerSocket = 0;
134 mClosed = false; 134 mClosed = false;
135 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 135 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
136 QString confFile = locateLocal("config","korganizerrc"); 136 QString confFile = locateLocal("config","korganizerrc");
137 QFileInfo finf ( confFile ); 137 QFileInfo finf ( confFile );
138 bool showWarning = !finf.exists(); 138 bool showWarning = !finf.exists();
139 setIcon(SmallIcon( "ko24" ) ); 139 setIcon(SmallIcon( "ko24" ) );
140 mBlockAtStartup = true; 140 mBlockAtStartup = true;
141 mFlagKeyPressed = false; 141 mFlagKeyPressed = false;
142 setCaption("KOrganizer/Pi"); 142 setCaption("KOrganizer/Pi");
143 KOPrefs *p = KOPrefs::instance(); 143 KOPrefs *p = KOPrefs::instance();
144 KPimGlobalPrefs::instance()->setGlobalConfig(); 144 KPimGlobalPrefs::instance()->setGlobalConfig();
145 // if ( QApplication::desktop()->height() > 480 ) { 145 // if ( QApplication::desktop()->height() > 480 ) {
146// if ( p->mHourSize == 4 ) 146// if ( p->mHourSize == 4 )
147// p->mHourSize = 6; 147// p->mHourSize = 6;
148// } 148// }
149 if ( p->mHourSize > 18 ) 149 if ( p->mHourSize > 18 )
150 p->mHourSize = 18; 150 p->mHourSize = 18;
151 QMainWindow::ToolBarDock tbd; 151 QMainWindow::ToolBarDock tbd;
152 if ( p->mToolBarHor ) { 152 if ( p->mToolBarHor ) {
153 if ( p->mToolBarUp ) 153 if ( p->mToolBarUp )
154 tbd = Bottom; 154 tbd = Bottom;
155 else 155 else
156 tbd = Top; 156 tbd = Top;
157 } 157 }
158 else { 158 else {
159 if ( p->mToolBarUp ) 159 if ( p->mToolBarUp )
160 tbd = Right; 160 tbd = Right;
161 else 161 else
162 tbd = Left; 162 tbd = Left;
163 } 163 }
164 if ( KOPrefs::instance()->mUseAppColors ) 164 if ( KOPrefs::instance()->mUseAppColors )
165 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 165 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
166 globalFlagBlockStartup = 1; 166 globalFlagBlockStartup = 1;
167 iconToolBar = new QPEToolBar( this ); 167 iconToolBar = new QPEToolBar( this );
168 addToolBar (iconToolBar , tbd ); 168 addToolBar (iconToolBar , tbd );
169 mBlockSaveFlag = false; 169 mBlockSaveFlag = false;
170 mCalendarModifiedFlag = false; 170 mCalendarModifiedFlag = false;
171 171
172 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 172 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
173 splash->setAlignment ( AlignCenter ); 173 splash->setAlignment ( AlignCenter );
174 setCentralWidget( splash ); 174 setCentralWidget( splash );
175#ifndef DESKTOP_VERSION 175#ifndef DESKTOP_VERSION
176 showMaximized(); 176 showMaximized();
177#endif 177#endif
178 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 178 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
179 setDefaultPreferences(); 179 setDefaultPreferences();
180 mCalendar = new CalendarLocal(); 180 mCalendar = new CalendarLocal();
181 mView = new CalendarView( mCalendar, this,"mCalendar " ); 181 mView = new CalendarView( mCalendar, this,"mCalendar " );
182 mView->hide(); 182 mView->hide();
183 //mView->resize(splash->size() ); 183 //mView->resize(splash->size() );
184 initActions(); 184 initActions();
185#ifndef DESKTOP_VERSION 185#ifndef DESKTOP_VERSION
186 iconToolBar->show(); 186 iconToolBar->show();
187 qApp->processEvents(); 187 qApp->processEvents();
188#endif 188#endif
189 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 189 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
190 int vh = height() ; 190 int vh = height() ;
191 int vw = width(); 191 int vw = width();
192 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 192 //qDebug("Toolbar hei %d ",iconToolBar->height() );
193 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 193 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
194 vh -= iconToolBar->height(); 194 vh -= iconToolBar->height();
195 } else { 195 } else {
196 vw -= iconToolBar->height(); 196 vw -= iconToolBar->height();
197 } 197 }
198 //mView->setMaximumSize( splash->size() ); 198 //mView->setMaximumSize( splash->size() );
199 //mView->resize( splash->size() ); 199 //mView->resize( splash->size() );
200 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 200 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
201 mView->readSettings(); 201 mView->readSettings();
202 bool newFile = false; 202 bool newFile = false;
203 if( !QFile::exists( defaultFileName() ) ) { 203 if( !QFile::exists( defaultFileName() ) ) {
204 QFileInfo finfo ( defaultFileName() ); 204 QFileInfo finfo ( defaultFileName() );
205 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 205 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
206 qDebug("oldfile %s ", oldFile.latin1()); 206 qDebug("oldfile %s ", oldFile.latin1());
207 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"; 207 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";
208 finfo.setFile( oldFile ); 208 finfo.setFile( oldFile );
209 if (finfo.exists() ) { 209 if (finfo.exists() ) {
210 KMessageBox::information( this, message); 210 KMessageBox::information( this, message);
211 mView->openCalendar( oldFile ); 211 mView->openCalendar( oldFile );
212 qApp->processEvents(); 212 qApp->processEvents();
213 } else { 213 } else {
214 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 214 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
215 finfo.setFile( oldFile ); 215 finfo.setFile( oldFile );
216 if (finfo.exists() ) { 216 if (finfo.exists() ) {
217 KMessageBox::information( this, message); 217 KMessageBox::information( this, message);
218 mView->openCalendar( oldFile ); 218 mView->openCalendar( oldFile );
219 qApp->processEvents(); 219 qApp->processEvents();
220 } 220 }
221 } 221 }
222 mView->saveCalendar( defaultFileName() ); 222 mView->saveCalendar( defaultFileName() );
223 newFile = true; 223 newFile = true;
224 } 224 }
225 225
226 QTime neededSaveTime = QDateTime::currentDateTime().time(); 226 QTime neededSaveTime = QDateTime::currentDateTime().time();
227 mView->openCalendar( defaultFileName() ); 227 mView->openCalendar( defaultFileName() );
228 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 228 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
229 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 229 qDebug("KO: Calendar loading time: %d ms",msNeeded );
230 230
231 if ( KOPrefs::instance()->mLanguageChanged ) { 231 if ( KOPrefs::instance()->mLanguageChanged ) {
232 KOPrefs::instance()->setCategoryDefaults(); 232 KOPrefs::instance()->setCategoryDefaults();
233 int count = mView->addCategories(); 233 int count = mView->addCategories();
234 KOPrefs::instance()->mLanguageChanged = false; 234 KOPrefs::instance()->mLanguageChanged = false;
@@ -1046,320 +1046,321 @@ int MainWindow::ringSync()
1046#ifndef _WIN32_ 1046#ifndef _WIN32_
1047 sleep (1); 1047 sleep (1);
1048#endif 1048#endif
1049 } 1049 }
1050 1050
1051 } 1051 }
1052 1052
1053 } 1053 }
1054 delete temp; 1054 delete temp;
1055 return syncedProfiles; 1055 return syncedProfiles;
1056} 1056}
1057 1057
1058void MainWindow::multiSync( bool askforPrefs ) 1058void MainWindow::multiSync( bool askforPrefs )
1059{ 1059{
1060 if (mBlockSaveFlag) 1060 if (mBlockSaveFlag)
1061 return; 1061 return;
1062 mBlockSaveFlag = true; 1062 mBlockSaveFlag = true;
1063 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 1063 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
1064 if ( QMessageBox::information( this, i18n("KO/Pi Sync"), 1064 if ( QMessageBox::information( this, i18n("KO/Pi Sync"),
1065 question, 1065 question,
1066 i18n("Yes"), i18n("No"), 1066 i18n("Yes"), i18n("No"),
1067 0, 0 ) != 0 ) { 1067 0, 0 ) != 0 ) {
1068 mBlockSaveFlag = false; 1068 mBlockSaveFlag = false;
1069 setCaption(i18n("Aborted! Nothing synced!")); 1069 setCaption(i18n("Aborted! Nothing synced!"));
1070 return; 1070 return;
1071 } 1071 }
1072 mView->setSyncDevice(i18n("Multiple profiles") ); 1072 mView->setSyncDevice(i18n("Multiple profiles") );
1073 KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; 1073 KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs;
1074 if ( askforPrefs ) { 1074 if ( askforPrefs ) {
1075 mView->edit_sync_options(); 1075 mView->edit_sync_options();
1076 KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; 1076 KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs;
1077 } 1077 }
1078 setCaption(i18n("Multiple sync started.") ); 1078 setCaption(i18n("Multiple sync started.") );
1079 qApp->processEvents(); 1079 qApp->processEvents();
1080 int num = ringSync() ; 1080 int num = ringSync() ;
1081 if ( num > 1 ) 1081 if ( num > 1 )
1082 ringSync(); 1082 ringSync();
1083 mBlockSaveFlag = false; 1083 mBlockSaveFlag = false;
1084 if ( num ) 1084 if ( num )
1085 save(); 1085 save();
1086 if ( num ) 1086 if ( num )
1087 setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); 1087 setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) );
1088 else 1088 else
1089 setCaption(i18n("Nothing synced! No profiles defined for multisync!")); 1089 setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
1090 return; 1090 return;
1091} 1091}
1092void MainWindow::slotSyncMenu( int action ) 1092void MainWindow::slotSyncMenu( int action )
1093{ 1093{
1094 qDebug("syncaction %d ", action); 1094 qDebug("syncaction %d ", action);
1095 if ( action == 0 ) { 1095 if ( action == 0 ) {
1096 1096
1097 // seems to be a Qt2 event handling bug 1097 // seems to be a Qt2 event handling bug
1098 // syncmenu.clear causes a segfault at first time 1098 // syncmenu.clear causes a segfault at first time
1099 // when we call it after the main event loop, it is ok 1099 // when we call it after the main event loop, it is ok
1100 // same behaviour when calling OM/Pi via QCOP for the first time 1100 // same behaviour when calling OM/Pi via QCOP for the first time
1101 QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); 1101 QTimer::singleShot ( 1, this, SLOT ( confSync() ) );
1102 //confSync(); 1102 //confSync();
1103 1103
1104 return; 1104 return;
1105 } 1105 }
1106 if ( action == 1 ) { 1106 if ( action == 1 ) {
1107 multiSync( true ); 1107 multiSync( true );
1108 return; 1108 return;
1109 } 1109 }
1110 if ( action == 2 ) { 1110 if ( action == 2 ) {
1111 enableQuick(); 1111 enableQuick();
1112 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); 1112 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
1113 return; 1113 return;
1114 } 1114 }
1115 if ( action == 3 ) { 1115 if ( action == 3 ) {
1116 delete mServerSocket; 1116 delete mServerSocket;
1117 mServerSocket = 0; 1117 mServerSocket = 0;
1118 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); 1118 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
1119 return; 1119 return;
1120 } 1120 }
1121 1121
1122 if (mBlockSaveFlag) 1122 if (mBlockSaveFlag)
1123 return; 1123 return;
1124 mBlockSaveFlag = true; 1124 mBlockSaveFlag = true;
1125 mCurrentSyncProfile = action - 1000 ; 1125 mCurrentSyncProfile = action - 1000 ;
1126 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); 1126 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] );
1127 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 1127 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
1128 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 1128 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
1129 KSyncProfile* temp = new KSyncProfile (); 1129 KSyncProfile* temp = new KSyncProfile ();
1130 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); 1130 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
1131 temp->readConfig(&config); 1131 temp->readConfig(&config);
1132 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 1132 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
1133 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); 1133 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs();
1134 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 1134 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
1135 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 1135 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
1136 KOPrefs::instance()->mWriteBackInFuture = 0; 1136 KOPrefs::instance()->mWriteBackInFuture = 0;
1137 if ( temp->getWriteBackFuture() ) 1137 if ( temp->getWriteBackFuture() )
1138 KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); 1138 KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
1139 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); 1139 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync();
1140 if ( action == 1000 ) { 1140 if ( action == 1000 ) {
1141 syncSharp(); 1141 syncSharp();
1142 1142
1143 } else if ( action == 1001 ) { 1143 } else if ( action == 1001 ) {
1144 syncLocalFile(); 1144 syncLocalFile();
1145 1145
1146 } else if ( action == 1002 ) { 1146 } else if ( action == 1002 ) {
1147 quickSyncLocalFile(); 1147 quickSyncLocalFile();
1148 1148
1149 } else if ( action >= 1003 ) { 1149 } else if ( action >= 1003 ) {
1150 if ( temp->getIsLocalFileSync() ) { 1150 if ( temp->getIsLocalFileSync() ) {
1151 if ( syncWithFile( temp->getRemoteFileName( ), false ) ) 1151 if ( syncWithFile( temp->getRemoteFileName( ), false ) )
1152 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 1152 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
1153 } else { 1153 } else {
1154 if ( temp->getIsPhoneSync() ) { 1154 if ( temp->getIsPhoneSync() ) {
1155 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; 1155 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
1156 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); 1156 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
1157 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); 1157 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
1158 syncPhone(); 1158 syncPhone();
1159 } else if ( temp->getIsPiSync() ) { 1159 } else if ( temp->getIsPiSync() ) {
1160 mPassWordPiSync = temp->getRemotePw(); 1160 mPassWordPiSync = temp->getRemotePw();
1161 KOPrefs::instance()->mActiveSyncPort = temp->getRemotePort(); 1161 KOPrefs::instance()->mActiveSyncPort = temp->getRemotePort();
1162 KOPrefs::instance()->mActiveSyncIP = temp->getRemoteIP(); 1162 KOPrefs::instance()->mActiveSyncIP = temp->getRemoteIP();
1163 syncPi(); 1163 syncPi();
1164 } else 1164 } else
1165 syncRemote( temp ); 1165 syncRemote( temp );
1166 1166
1167 } 1167 }
1168 } 1168 }
1169 delete temp; 1169 delete temp;
1170 mBlockSaveFlag = false; 1170 mBlockSaveFlag = false;
1171} 1171}
1172void MainWindow::exportToPhone( int mode ) 1172void MainWindow::exportToPhone( int mode )
1173{ 1173{
1174 1174
1175 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1175 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1176 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1176 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1177 KOex2phonePrefs ex2phone; 1177 KOex2phonePrefs ex2phone;
1178 ex2phone.mPhoneConnection->setText( KOPrefs::instance()->mEx2PhoneConnection ); 1178
1179 ex2phone.mPhoneDevice->setText( KOPrefs::instance()->mEx2PhoneDevice ); 1179 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1180 ex2phone.mPhoneModel->setText( KOPrefs::instance()->mEx2PhoneModel ); 1180 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1181 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1181 if ( mode == 1 ) 1182 if ( mode == 1 )
1182 ex2phone.setCaption(i18n("Export complete calendar")); 1183 ex2phone.setCaption(i18n("Export complete calendar"));
1183 if ( mode == 2 ) 1184 if ( mode == 2 )
1184 ex2phone.setCaption(i18n("Export filtered calendar")); 1185 ex2phone.setCaption(i18n("Export filtered calendar"));
1185 1186
1186 if ( !ex2phone.exec() ) { 1187 if ( !ex2phone.exec() ) {
1187 return; 1188 return;
1188 } 1189 }
1189 KOPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1190 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1190 KOPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1191 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1191 KOPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1192 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1192 1193
1193 int inFuture = 0; 1194 int inFuture = 0;
1194 if ( ex2phone.mWriteBackFuture->isChecked() ) 1195 if ( ex2phone.mWriteBackFuture->isChecked() )
1195 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1196 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1196 QPtrList<Incidence> delSel; 1197 QPtrList<Incidence> delSel;
1197 if ( mode == 1 ) 1198 if ( mode == 1 )
1198 delSel = mCalendar->rawIncidences(); 1199 delSel = mCalendar->rawIncidences();
1199 if ( mode == 2 ) 1200 if ( mode == 2 )
1200 delSel = mCalendar->incidences(); 1201 delSel = mCalendar->incidences();
1201 CalendarLocal* cal = new CalendarLocal(); 1202 CalendarLocal* cal = new CalendarLocal();
1202 cal->setLocalTime(); 1203 cal->setLocalTime();
1203 Incidence *incidence = delSel.first(); 1204 Incidence *incidence = delSel.first();
1204 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1205 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1205 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1206 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1206 while ( incidence ) { 1207 while ( incidence ) {
1207 if ( incidence->type() != "Journal" ) { 1208 if ( incidence->type() != "Journal" ) {
1208 bool add = true; 1209 bool add = true;
1209 if ( inFuture ) { 1210 if ( inFuture ) {
1210 QDateTime dt; 1211 QDateTime dt;
1211 if ( incidence->type() == "Todo" ) { 1212 if ( incidence->type() == "Todo" ) {
1212 Todo * t = (Todo*)incidence; 1213 Todo * t = (Todo*)incidence;
1213 if ( t->hasDueDate() ) 1214 if ( t->hasDueDate() )
1214 dt = t->dtDue(); 1215 dt = t->dtDue();
1215 else 1216 else
1216 dt = cur.addSecs( 62 ); 1217 dt = cur.addSecs( 62 );
1217 } 1218 }
1218 else { 1219 else {
1219 bool ok; 1220 bool ok;
1220 dt = incidence->getNextOccurence( cur, &ok ); 1221 dt = incidence->getNextOccurence( cur, &ok );
1221 if ( !ok ) 1222 if ( !ok )
1222 dt = cur.addSecs( -62 ); 1223 dt = cur.addSecs( -62 );
1223 } 1224 }
1224 if ( dt < cur || dt > end ) { 1225 if ( dt < cur || dt > end ) {
1225 add = false; 1226 add = false;
1226 } 1227 }
1227 } 1228 }
1228 if ( add ) { 1229 if ( add ) {
1229 Incidence *in = incidence->clone(); 1230 Incidence *in = incidence->clone();
1230 cal->addIncidence( in ); 1231 cal->addIncidence( in );
1231 } 1232 }
1232 } 1233 }
1233 incidence = delSel.next(); 1234 incidence = delSel.next();
1234 } 1235 }
1235 PhoneFormat::writeConfig( KOPrefs::instance()->mEx2PhoneDevice, 1236 PhoneFormat::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1236 KOPrefs::instance()->mEx2PhoneConnection, 1237 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1237 KOPrefs::instance()->mEx2PhoneModel ); 1238 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1238 1239
1239 setCaption( i18n("Writing to phone...")); 1240 setCaption( i18n("Writing to phone..."));
1240 if ( PhoneFormat::writeToPhone( cal ) ) 1241 if ( PhoneFormat::writeToPhone( cal ) )
1241 setCaption( i18n("Export to phone successful!")); 1242 setCaption( i18n("Export to phone successful!"));
1242 else 1243 else
1243 setCaption( i18n("Error exporting to phone!")); 1244 setCaption( i18n("Error exporting to phone!"));
1244 delete cal; 1245 delete cal;
1245} 1246}
1246 1247
1247 1248
1248void MainWindow::setDefaultPreferences() 1249void MainWindow::setDefaultPreferences()
1249{ 1250{
1250 KOPrefs *p = KOPrefs::instance(); 1251 KOPrefs *p = KOPrefs::instance();
1251 1252
1252 p->mCompactDialogs = true; 1253 p->mCompactDialogs = true;
1253 p->mConfirm = true; 1254 p->mConfirm = true;
1254 // p->mEnableQuickTodo = false; 1255 // p->mEnableQuickTodo = false;
1255 1256
1256} 1257}
1257 1258
1258QString MainWindow::resourcePath() 1259QString MainWindow::resourcePath()
1259{ 1260{
1260 return KGlobal::iconLoader()->iconPath(); 1261 return KGlobal::iconLoader()->iconPath();
1261} 1262}
1262 1263
1263void MainWindow::displayText( QString text ,QString cap ) 1264void MainWindow::displayText( QString text ,QString cap )
1264{ 1265{
1265 QDialog dia( this, "name", true ); ; 1266 QDialog dia( this, "name", true ); ;
1266 dia.setCaption( cap ); 1267 dia.setCaption( cap );
1267 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1268 QVBoxLayout* lay = new QVBoxLayout( &dia );
1268 lay->setSpacing( 3 ); 1269 lay->setSpacing( 3 );
1269 lay->setMargin( 3 ); 1270 lay->setMargin( 3 );
1270 QTextBrowser tb ( &dia ); 1271 QTextBrowser tb ( &dia );
1271 lay->addWidget( &tb ); 1272 lay->addWidget( &tb );
1272 tb.setText( text ); 1273 tb.setText( text );
1273#ifdef DESKTOP_VERSION 1274#ifdef DESKTOP_VERSION
1274 dia.resize( 640, 480); 1275 dia.resize( 640, 480);
1275#else 1276#else
1276 dia.showMaximized(); 1277 dia.showMaximized();
1277#endif 1278#endif
1278 dia.exec(); 1279 dia.exec();
1279} 1280}
1280void MainWindow::displayFile( QString fn, QString cap ) 1281void MainWindow::displayFile( QString fn, QString cap )
1281{ 1282{
1282 QString fileName = resourcePath() + fn; 1283 QString fileName = resourcePath() + fn;
1283 QString text; 1284 QString text;
1284 QFile file( fileName ); 1285 QFile file( fileName );
1285 if (!file.open( IO_ReadOnly ) ) { 1286 if (!file.open( IO_ReadOnly ) ) {
1286 return ; 1287 return ;
1287 1288
1288 } 1289 }
1289 QTextStream ts( &file ); 1290 QTextStream ts( &file );
1290 text = ts.read(); 1291 text = ts.read();
1291 file.close(); 1292 file.close();
1292 displayText( text, cap); 1293 displayText( text, cap);
1293} 1294}
1294void MainWindow::features() 1295void MainWindow::features()
1295{ 1296{
1296 1297
1297 displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); 1298 displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") );
1298} 1299}
1299 1300
1300void MainWindow::usertrans() 1301void MainWindow::usertrans()
1301{ 1302{
1302 1303
1303 displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); 1304 displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") );
1304} 1305}
1305 1306
1306void MainWindow::synchowto() 1307void MainWindow::synchowto()
1307{ 1308{
1308#if 0 1309#if 0
1309 QPtrList<Incidence> er = mCalendar->rawIncidences(); 1310 QPtrList<Incidence> er = mCalendar->rawIncidences();
1310 Incidence* inR = er.first(); 1311 Incidence* inR = er.first();
1311 VCalFormat vf; 1312 VCalFormat vf;
1312 QString strout; 1313 QString strout;
1313 while ( inR ) { 1314 while ( inR ) {
1314 if ( inR->type() == "Todo" ) 1315 if ( inR->type() == "Todo" )
1315 strout = vf.todoToString( (Todo *) inR ); 1316 strout = vf.todoToString( (Todo *) inR );
1316 if ( inR->type() == "Event" ) 1317 if ( inR->type() == "Event" )
1317 strout = vf.eventToString( (Event *) inR ); 1318 strout = vf.eventToString( (Event *) inR );
1318 qDebug("incidence: \n%s\n ente\n\n",strout.latin1() ); 1319 qDebug("incidence: \n%s\n ente\n\n",strout.latin1() );
1319 inR = er.next(); 1320 inR = er.next();
1320 } 1321 }
1321#endif 1322#endif
1322 displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); 1323 displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") );
1323} 1324}
1324void MainWindow::faq() 1325void MainWindow::faq()
1325{ 1326{
1326 displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); 1327 displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") );
1327 1328
1328} 1329}
1329void MainWindow::whatsNew() 1330void MainWindow::whatsNew()
1330{ 1331{
1331 displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); 1332 displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") );
1332 1333
1333} 1334}
1334void MainWindow::licence() 1335void MainWindow::licence()
1335{ 1336{
1336 KApplication::showLicence(); 1337 KApplication::showLicence();
1337 1338
1338} 1339}
1339void MainWindow::about() 1340void MainWindow::about()
1340{ 1341{
1341 QString version; 1342 QString version;
1342#include <../version> 1343#include <../version>
1343 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1344 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1344 i18n("KOrganizer/Platform-independent\n") + 1345 i18n("KOrganizer/Platform-independent\n") +
1345 "(KO/Pi) " + version + " - " + 1346 "(KO/Pi) " + version + " - " +
1346 1347
1347#ifdef DESKTOP_VERSION 1348#ifdef DESKTOP_VERSION
1348 i18n("Desktop Edition\n") + 1349 i18n("Desktop Edition\n") +
1349#else 1350#else
1350 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + 1351 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") +
1351#endif 1352#endif
1352 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") ); 1353 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") );
1353} 1354}
1354void MainWindow::keyBindings() 1355void MainWindow::keyBindings()
1355{ 1356{
1356 QString cap = i18n("Key bindings KOrganizer/Pi"); 1357 QString cap = i18n("Key bindings KOrganizer/Pi");
1357 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1358 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1358 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1359 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1359 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1360 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1360 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1361 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1361 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1362 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1362 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1363 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1363 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1364 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1364 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1365 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+
1365 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1366 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+