-rw-r--r-- | korganizer/koprefs.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 26 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
3 files changed, 24 insertions, 5 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 9e7f18c..6560877 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -1,625 +1,625 @@ | |||
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 <kglobalsettings.h> | 39 | #include <kglobalsettings.h> |
40 | #include <kconfig.h> | 40 | #include <kconfig.h> |
41 | #include <klocale.h> | 41 | #include <klocale.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kemailsettings.h> | 43 | #include <kemailsettings.h> |
44 | #include <kstaticdeleter.h> | 44 | #include <kstaticdeleter.h> |
45 | #include <libkdepim/kpimglobalprefs.h> | 45 | #include <libkdepim/kpimglobalprefs.h> |
46 | 46 | ||
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | #include "mainwindow.h" | 48 | #include "mainwindow.h" |
49 | 49 | ||
50 | KOPrefs *KOPrefs::mInstance = 0; | 50 | KOPrefs *KOPrefs::mInstance = 0; |
51 | static KStaticDeleter<KOPrefs> insd; | 51 | static KStaticDeleter<KOPrefs> insd; |
52 | 52 | ||
53 | KOPrefs::KOPrefs() : | 53 | KOPrefs::KOPrefs() : |
54 | KPimPrefs("korganizerrc") | 54 | KPimPrefs("korganizerrc") |
55 | { | 55 | { |
56 | mGlobalUpdateDisabled = false; | 56 | mGlobalUpdateDisabled = false; |
57 | mCategoryColors.setAutoDelete(true); | 57 | mCategoryColors.setAutoDelete(true); |
58 | fillMailDefaults(); | 58 | fillMailDefaults(); |
59 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 59 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
60 | QColor defaultHolidayColor = QColor(255,0,0); | 60 | QColor defaultHolidayColor = QColor(255,0,0); |
61 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 61 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
62 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 62 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
63 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 63 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
64 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 64 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
65 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 65 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
66 | QColor defaultTodoRunColor = QColor(99,194,30); | 66 | QColor defaultTodoRunColor = QColor(99,194,30); |
67 | KPrefs::setCurrentGroup("General"); | 67 | KPrefs::setCurrentGroup("General"); |
68 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 68 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
69 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 69 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
70 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 70 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
71 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 71 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
72 | addItemBool("ShowIconList",&mShowIconList,true); | 72 | addItemBool("ShowIconList",&mShowIconList,true); |
73 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 73 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
74 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 74 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
75 | addItemBool("ShowIconDay6",&mShowIconDay6,true); | 75 | addItemBool("ShowIconDay6",&mShowIconDay6,true); |
76 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 76 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
77 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 77 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
78 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 78 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
79 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 79 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
80 | addItemBool("ShowIconBack",&mShowIconBack,true); | 80 | addItemBool("ShowIconBack",&mShowIconBack,true); |
81 | addItemBool("ShowIconToday",&mShowIconToday,true); | 81 | addItemBool("ShowIconToday",&mShowIconToday,true); |
82 | addItemBool("ShowIconForward",&mShowIconForward,true); | 82 | addItemBool("ShowIconForward",&mShowIconForward,true); |
83 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 83 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
84 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); | 84 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); |
85 | addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); | 85 | addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); |
86 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 86 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
87 | addItemBool("ShowIconNext",&mShowIconNext,true); | 87 | addItemBool("ShowIconNext",&mShowIconNext,true); |
88 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 88 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
89 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 89 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
90 | addItemBool("ShowIconFilter",&mShowIconFilter,false); | 90 | addItemBool("ShowIconFilter",&mShowIconFilter,false); |
91 | addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); | 91 | addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); |
92 | 92 | ||
93 | bool addIcons = false; | 93 | bool addIcons = false; |
94 | #ifdef DESKTOP_VERSION | 94 | #ifdef DESKTOP_VERSION |
95 | addIcons = true; | 95 | addIcons = true; |
96 | #endif | 96 | #endif |
97 | addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); | 97 | addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); |
98 | addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); | 98 | addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); |
99 | addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); | 99 | addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); |
100 | addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); | 100 | addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); |
101 | 101 | ||
102 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); | 102 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); |
103 | 103 | ||
104 | addItemBool("AskForQuit",&mAskForQuit,false); | 104 | addItemBool("AskForQuit",&mAskForQuit,false); |
105 | 105 | ||
106 | #ifndef DESKTOP_VERSION | 106 | #ifndef DESKTOP_VERSION |
107 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 107 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
108 | #else | 108 | #else |
109 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 109 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
110 | #endif | 110 | #endif |
111 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 111 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
112 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 112 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
113 | addItemBool("ToolBarHorV",&mToolBarHorV, true ); | 113 | addItemBool("ToolBarHorV",&mToolBarHorV, true ); |
114 | addItemBool("ToolBarUpV",&mToolBarUpV, false ); | 114 | addItemBool("ToolBarUpV",&mToolBarUpV, false ); |
115 | addItemBool("ToolBarHorN",&mToolBarHorN, true ); | 115 | addItemBool("ToolBarHorN",&mToolBarHorN, true ); |
116 | addItemBool("ToolBarUpN",&mToolBarUpN, false ); | 116 | addItemBool("ToolBarUpN",&mToolBarUpN, false ); |
117 | addItemBool("ToolBarHorF",&mToolBarHorF, true ); | 117 | addItemBool("ToolBarHorF",&mToolBarHorF, true ); |
118 | addItemBool("ToolBarUpF",&mToolBarUpF, false ); | 118 | addItemBool("ToolBarUpF",&mToolBarUpF, false ); |
119 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 119 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
120 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 120 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
121 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 121 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
122 | 122 | ||
123 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 123 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
124 | addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); | 124 | addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); |
125 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); | 125 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); |
126 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); | 126 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); |
127 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 127 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
128 | addItemInt("AllDay Size",&mAllDaySize,28); | 128 | addItemInt("AllDay Size",&mAllDaySize,28); |
129 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 129 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
130 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 130 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
131 | 131 | ||
132 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 132 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
133 | addItemStringList("EventSummary User",&mEventSummaryUser); | 133 | addItemStringList("EventSummary User",&mEventSummaryUser); |
134 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 134 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
135 | addItemStringList("JournalSummary User",&mJournalSummaryUser); | 135 | addItemStringList("JournalSummary User",&mJournalSummaryUser); |
136 | 136 | ||
137 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 137 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
138 | addItemBool("Enable Project View",&mEnableProjectView,false); | 138 | addItemBool("Enable Project View",&mEnableProjectView,false); |
139 | addItemBool("Auto Save",&mAutoSave,false); | 139 | addItemBool("Auto Save",&mAutoSave,false); |
140 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 140 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
141 | addItemBool("Confirm Deletes",&mConfirm,true); | 141 | addItemBool("Confirm Deletes",&mConfirm,true); |
142 | addItemString("Archive File",&mArchiveFile); | 142 | addItemString("Archive File",&mArchiveFile); |
143 | addItemString("Html Export File",&mHtmlExportFile, | 143 | addItemString("Html Export File",&mHtmlExportFile, |
144 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 144 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
145 | addItemBool("Html With Save",&mHtmlWithSave,false); | 145 | addItemBool("Html With Save",&mHtmlWithSave,false); |
146 | 146 | ||
147 | KPrefs::setCurrentGroup("Personal Settings"); | 147 | KPrefs::setCurrentGroup("Personal Settings"); |
148 | 148 | ||
149 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 149 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
150 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 150 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
151 | addItemBool("Bcc",&mBcc,false); | 151 | addItemBool("Bcc",&mBcc,false); |
152 | 152 | ||
153 | KPrefs::setCurrentGroup("Time & Date"); | 153 | KPrefs::setCurrentGroup("Time & Date"); |
154 | 154 | ||
155 | 155 | ||
156 | addItemInt("Default Start Time",&mStartTime,10); | 156 | addItemInt("Default Start Time",&mStartTime,10); |
157 | addItemInt("Default Duration",&mDefaultDuration,2); | 157 | addItemInt("Default Duration",&mDefaultDuration,2); |
158 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 158 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
159 | KPrefs::setCurrentGroup("AlarmSettings"); | 159 | KPrefs::setCurrentGroup("AlarmSettings"); |
160 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 160 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
161 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 161 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
162 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 162 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
163 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 163 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
164 | 164 | ||
165 | 165 | ||
166 | KPrefs::setCurrentGroup("Calendar"); | 166 | KPrefs::setCurrentGroup("Calendar"); |
167 | 167 | ||
168 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 168 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
169 | 169 | ||
170 | KPrefs::setCurrentGroup("Fonts"); | 170 | KPrefs::setCurrentGroup("Fonts"); |
171 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 171 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
172 | QFont fon = KGlobalSettings::generalFont(); | 172 | QFont fon = KGlobalSettings::generalFont(); |
173 | addItemFont("TimeBar Font",&mTimeBarFont,fon ); | 173 | addItemFont("TimeBar Font",&mTimeBarFont,fon ); |
174 | addItemFont("MonthView Font",&mMonthViewFont,fon); | 174 | addItemFont("MonthView Font",&mMonthViewFont,fon); |
175 | addItemFont("AgendaView Font",&mAgendaViewFont,fon); | 175 | addItemFont("AgendaView Font",&mAgendaViewFont,fon); |
176 | addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); | 176 | addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); |
177 | addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); | 177 | addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); |
178 | addItemFont("TodoView Font",&mTodoViewFont,fon); | 178 | addItemFont("TodoView Font",&mTodoViewFont,fon); |
179 | addItemFont("ListView Font",&mListViewFont,fon); | 179 | addItemFont("ListView Font",&mListViewFont,fon); |
180 | addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); | 180 | addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); |
181 | addItemFont("EditBox Font",&mEditBoxFont,fon); | 181 | addItemFont("EditBox Font",&mEditBoxFont,fon); |
182 | addItemFont("JournalView Font",&mJornalViewFont,fon); | 182 | addItemFont("JournalView Font",&mJornalViewFont,fon); |
183 | addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); | 183 | addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); |
184 | addItemFont("EventView Font",&mEventViewFont,fon); | 184 | addItemFont("EventView Font",&mEventViewFont,fon); |
185 | 185 | ||
186 | KPrefs::setCurrentGroup("RemoteSyncing"); | 186 | KPrefs::setCurrentGroup("RemoteSyncing"); |
187 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 187 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
188 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 188 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
189 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 189 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
190 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 190 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
191 | 191 | ||
192 | #ifdef _WIN32_ | 192 | #ifdef _WIN32_ |
193 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 193 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
194 | #else | 194 | #else |
195 | QString hdp= locateLocal("data","korganizer")+"/"; | 195 | QString hdp= locateLocal("data","korganizer")+"/"; |
196 | #endif | 196 | #endif |
197 | 197 | ||
198 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 198 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
199 | 199 | ||
200 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 200 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
201 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 201 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
202 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 202 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
203 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 203 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
204 | 204 | ||
205 | 205 | ||
206 | KPrefs::setCurrentGroup("Locale"); | 206 | KPrefs::setCurrentGroup("Locale"); |
207 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 207 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
208 | 208 | ||
209 | 209 | ||
210 | KPrefs::setCurrentGroup("Colors"); | 210 | KPrefs::setCurrentGroup("Colors"); |
211 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 211 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
212 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 212 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
213 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 213 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
214 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); | 214 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); |
215 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 215 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
216 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 216 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
217 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 217 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
218 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 218 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
219 | addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); | 219 | addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); |
220 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 220 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
221 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 221 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
222 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 222 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
223 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 223 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
224 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 224 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
225 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); | 225 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); |
226 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 226 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
227 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 227 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
228 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 228 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
229 | addItemBool("UseAppColors",&mUseAppColors,false); | 229 | addItemBool("UseAppColors",&mUseAppColors,false); |
230 | 230 | ||
231 | 231 | ||
232 | 232 | ||
233 | KPrefs::setCurrentGroup("Views"); | 233 | KPrefs::setCurrentGroup("Views"); |
234 | addItemBool("Block Popup Menu",&mBlockPopupMenu,false); | 234 | addItemBool("Block Popup Menu",&mBlockPopupMenu,false); |
235 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 235 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
236 | addItemInt("Hour Size",&mHourSize,8); | 236 | addItemInt("Hour Size",&mHourSize,8); |
237 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 237 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
238 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 238 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
239 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 239 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
240 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 240 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
241 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 241 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
242 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 242 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
243 | addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); | 243 | addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); |
244 | #ifdef DESKTOP_VERION | 244 | #ifdef DESKTOP_VERION |
245 | addItemBool("Enable ToolTips",&mEnableToolTips,true); | 245 | addItemBool("Enable ToolTips",&mEnableToolTips,true); |
246 | #else | 246 | #else |
247 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 247 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
248 | #endif | 248 | #endif |
249 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 249 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
250 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 250 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
251 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 251 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
252 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 252 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
253 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 253 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
254 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 254 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
255 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 255 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
256 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 256 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
257 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 257 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
258 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 258 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
259 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 259 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
260 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 260 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
261 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 261 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
262 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 262 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
263 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 263 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
264 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 264 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
265 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); | 265 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
266 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | 266 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); |
267 | addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,true); | 267 | addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false); |
268 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 268 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
269 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 269 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
270 | #ifdef DESKTOP_VERSION | 270 | #ifdef DESKTOP_VERSION |
271 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 271 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
272 | #else | 272 | #else |
273 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 273 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
274 | #endif | 274 | #endif |
275 | addItemInt("Day Begins",&mDayBegins,7); | 275 | addItemInt("Day Begins",&mDayBegins,7); |
276 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 276 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
277 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 277 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
278 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 278 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
279 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 279 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
280 | 280 | ||
281 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 281 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
282 | addItemBool("Full View Month",&mFullViewMonth,true); | 282 | addItemBool("Full View Month",&mFullViewMonth,true); |
283 | addItemBool("Full View Todo",&mFullViewTodo,true); | 283 | addItemBool("Full View Todo",&mFullViewTodo,true); |
284 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 284 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
285 | 285 | ||
286 | addItemInt("Next X Days",&mNextXDays,3); | 286 | addItemInt("Next X Days",&mNextXDays,3); |
287 | 287 | ||
288 | KPrefs::setCurrentGroup("Printer"); | 288 | KPrefs::setCurrentGroup("Printer"); |
289 | 289 | ||
290 | KPrefs::setCurrentGroup("Layout"); | 290 | KPrefs::setCurrentGroup("Layout"); |
291 | 291 | ||
292 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 292 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
293 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 293 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
294 | 294 | ||
295 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 295 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
296 | 296 | ||
297 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 297 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
298 | 298 | ||
299 | KPrefs::setCurrentGroup("Group Scheduling"); | 299 | KPrefs::setCurrentGroup("Group Scheduling"); |
300 | 300 | ||
301 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 301 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
302 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 302 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
303 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 303 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
304 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 304 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
305 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 305 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
306 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 306 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
307 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 307 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
308 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 308 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
309 | 309 | ||
310 | KPrefs::setCurrentGroup( "Editors" ); | 310 | KPrefs::setCurrentGroup( "Editors" ); |
311 | 311 | ||
312 | addItemStringList( "EventTemplates", &mEventTemplates ); | 312 | addItemStringList( "EventTemplates", &mEventTemplates ); |
313 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 313 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
314 | 314 | ||
315 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 315 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
316 | 316 | ||
317 | KPrefs::setCurrentGroup( "ViewOptions" ); | 317 | KPrefs::setCurrentGroup( "ViewOptions" ); |
318 | addItemBool("EVshowDetails",&mEVshowDetails,true); | 318 | addItemBool("EVshowDetails",&mEVshowDetails,true); |
319 | addItemBool("EVshowCreated",&mEVshowCreated,true); | 319 | addItemBool("EVshowCreated",&mEVshowCreated,true); |
320 | addItemBool("EVshowChanged",&mEVshowChanged,true); | 320 | addItemBool("EVshowChanged",&mEVshowChanged,true); |
321 | addItemBool("WTshowDetails",&mWTshowDetails,false); | 321 | addItemBool("WTshowDetails",&mWTshowDetails,false); |
322 | addItemBool("WTshowCreated",&mWTshowCreated,false); | 322 | addItemBool("WTshowCreated",&mWTshowCreated,false); |
323 | addItemBool("WTshowChanged",&mWTshowChanged,false); | 323 | addItemBool("WTshowChanged",&mWTshowChanged,false); |
324 | mCalendars.setAutoDelete( true ); | 324 | mCalendars.setAutoDelete( true ); |
325 | } | 325 | } |
326 | 326 | ||
327 | 327 | ||
328 | KOPrefs::~KOPrefs() | 328 | KOPrefs::~KOPrefs() |
329 | { | 329 | { |
330 | if (mInstance == this) | 330 | if (mInstance == this) |
331 | mInstance = insd.setObject(0); | 331 | mInstance = insd.setObject(0); |
332 | mCalendars.setAutoDelete( true ); | 332 | mCalendars.setAutoDelete( true ); |
333 | mCalendars.clear(); | 333 | mCalendars.clear(); |
334 | //qDebug("KOPrefs::~KOPrefs() "); | 334 | //qDebug("KOPrefs::~KOPrefs() "); |
335 | } | 335 | } |
336 | 336 | ||
337 | 337 | ||
338 | KOPrefs *KOPrefs::instance() | 338 | KOPrefs *KOPrefs::instance() |
339 | { | 339 | { |
340 | if (!mInstance) { | 340 | if (!mInstance) { |
341 | mInstance = insd.setObject(new KOPrefs()); | 341 | mInstance = insd.setObject(new KOPrefs()); |
342 | mInstance->readConfig(); | 342 | mInstance->readConfig(); |
343 | } | 343 | } |
344 | 344 | ||
345 | return mInstance; | 345 | return mInstance; |
346 | } | 346 | } |
347 | 347 | ||
348 | void KOPrefs::usrSetDefaults() | 348 | void KOPrefs::usrSetDefaults() |
349 | { | 349 | { |
350 | 350 | ||
351 | } | 351 | } |
352 | 352 | ||
353 | void KOPrefs::fillMailDefaults() | 353 | void KOPrefs::fillMailDefaults() |
354 | { | 354 | { |
355 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 355 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
356 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 356 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
357 | } | 357 | } |
358 | 358 | ||
359 | void KOPrefs::setTimeZoneIdDefault() | 359 | void KOPrefs::setTimeZoneIdDefault() |
360 | { | 360 | { |
361 | ; | 361 | ; |
362 | } | 362 | } |
363 | 363 | ||
364 | void KOPrefs::setAllDefaults() | 364 | void KOPrefs::setAllDefaults() |
365 | { | 365 | { |
366 | setCategoryDefaults(); | 366 | setCategoryDefaults(); |
367 | mEventSummaryUser = getDefaultList() ; | 367 | mEventSummaryUser = getDefaultList() ; |
368 | mTodoSummaryUser = getDefaultList() ; | 368 | mTodoSummaryUser = getDefaultList() ; |
369 | mJournalSummaryUser = getDefaultList() ; | 369 | mJournalSummaryUser = getDefaultList() ; |
370 | mLocationDefaults = getLocationDefaultList(); | 370 | mLocationDefaults = getLocationDefaultList(); |
371 | } | 371 | } |
372 | 372 | ||
373 | void KOPrefs::setCategoryDefaults() | 373 | void KOPrefs::setCategoryDefaults() |
374 | { | 374 | { |
375 | mCustomCategories.clear(); | 375 | mCustomCategories.clear(); |
376 | mCustomCategories = getDefaultList(); | 376 | mCustomCategories = getDefaultList(); |
377 | 377 | ||
378 | QStringList::Iterator it; | 378 | QStringList::Iterator it; |
379 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 379 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
380 | setCategoryColor(*it,mDefaultCategoryColor); | 380 | setCategoryColor(*it,mDefaultCategoryColor); |
381 | } | 381 | } |
382 | } | 382 | } |
383 | QStringList KOPrefs::getLocationDefaultList() | 383 | QStringList KOPrefs::getLocationDefaultList() |
384 | { | 384 | { |
385 | QStringList retval ; | 385 | QStringList retval ; |
386 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 386 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
387 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 387 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
388 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 388 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
389 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 389 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
390 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 390 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
391 | 391 | ||
392 | retval.sort(); | 392 | retval.sort(); |
393 | return retval; | 393 | return retval; |
394 | } | 394 | } |
395 | QStringList KOPrefs::getDefaultList() | 395 | QStringList KOPrefs::getDefaultList() |
396 | { | 396 | { |
397 | QStringList retval ; | 397 | QStringList retval ; |
398 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") | 398 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") |
399 | << i18n("Break") | 399 | << i18n("Break") |
400 | << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") | 400 | << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") |
401 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") | 401 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") |
402 | << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") | 402 | << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") |
403 | << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") | 403 | << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") |
404 | << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") | 404 | << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") |
405 | << i18n("Vacation") ; | 405 | << i18n("Vacation") ; |
406 | retval.sort(); | 406 | retval.sort(); |
407 | //qDebug("cat %s ", retval.join("-").latin1()); | 407 | //qDebug("cat %s ", retval.join("-").latin1()); |
408 | return retval; | 408 | return retval; |
409 | } | 409 | } |
410 | // << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema") | 410 | // << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema") |
411 | void KOPrefs::usrReadConfig() | 411 | void KOPrefs::usrReadConfig() |
412 | { | 412 | { |
413 | config()->setGroup("General"); | 413 | config()->setGroup("General"); |
414 | 414 | ||
415 | //qDebug("KOPrefs::usrReadConfig() "); | 415 | //qDebug("KOPrefs::usrReadConfig() "); |
416 | mCustomCategories = config()->readListEntry("Custom Categories"); | 416 | mCustomCategories = config()->readListEntry("Custom Categories"); |
417 | mOldLoadedLanguage = mOldLanguage ; | 417 | mOldLoadedLanguage = mOldLanguage ; |
418 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 418 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
419 | if (mLocationDefaults.isEmpty()) { | 419 | if (mLocationDefaults.isEmpty()) { |
420 | mLocationDefaults = getLocationDefaultList(); | 420 | mLocationDefaults = getLocationDefaultList(); |
421 | } | 421 | } |
422 | 422 | ||
423 | if (mEventSummaryUser.isEmpty()) { | 423 | if (mEventSummaryUser.isEmpty()) { |
424 | mEventSummaryUser = getDefaultList() ; | 424 | mEventSummaryUser = getDefaultList() ; |
425 | } | 425 | } |
426 | if (mTodoSummaryUser.isEmpty()) { | 426 | if (mTodoSummaryUser.isEmpty()) { |
427 | mTodoSummaryUser = getDefaultList() ; | 427 | mTodoSummaryUser = getDefaultList() ; |
428 | } | 428 | } |
429 | 429 | ||
430 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 430 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
431 | 431 | ||
432 | config()->setGroup("Personal Settings"); | 432 | config()->setGroup("Personal Settings"); |
433 | mName = config()->readEntry("user_name",""); | 433 | mName = config()->readEntry("user_name",""); |
434 | mEmail = config()->readEntry("user_email",""); | 434 | mEmail = config()->readEntry("user_email",""); |
435 | fillMailDefaults(); | 435 | fillMailDefaults(); |
436 | 436 | ||
437 | config()->setGroup("Category Colors"); | 437 | config()->setGroup("Category Colors"); |
438 | QStringList::Iterator it; | 438 | QStringList::Iterator it; |
439 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 439 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
440 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 440 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
441 | 441 | ||
442 | } | 442 | } |
443 | KConfig fc (locateLocal("config","kopicalendarrc")); | 443 | KConfig fc (locateLocal("config","kopicalendarrc")); |
444 | fc.setGroup("CC"); | 444 | fc.setGroup("CC"); |
445 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | 445 | int numCals = fc.readNumEntry("NumberCalendars",0 ); |
446 | mNextAvailableCalendar = 1; | 446 | mNextAvailableCalendar = 1; |
447 | if ( numCals == 0 ) { | 447 | if ( numCals == 0 ) { |
448 | KopiCalendarFile *kkf = getNewCalendar(); | 448 | KopiCalendarFile *kkf = getNewCalendar(); |
449 | kkf->isStandard = true; | 449 | kkf->isStandard = true; |
450 | kkf->mName = i18n("Standard"); | 450 | kkf->mName = i18n("Standard"); |
451 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 451 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
452 | } | 452 | } |
453 | while ( mNextAvailableCalendar <= numCals ) { | 453 | while ( mNextAvailableCalendar <= numCals ) { |
454 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); | 454 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); |
455 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); | 455 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); |
456 | KopiCalendarFile *kkf = getNewCalendar(); | 456 | KopiCalendarFile *kkf = getNewCalendar(); |
457 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); | 457 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); |
458 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); | 458 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); |
459 | kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); | 459 | kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); |
460 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); | 460 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); |
461 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); | 461 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); |
462 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); | 462 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); |
463 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); | 463 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); |
464 | kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); | 464 | kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); |
465 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); | 465 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); |
466 | if ( kkf->mCalNumber == 1 ) { | 466 | if ( kkf->mCalNumber == 1 ) { |
467 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 467 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
468 | } | 468 | } |
469 | //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); | 469 | //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); |
470 | if ( kkf->mName == i18n("Birthdays") ) { | 470 | if ( kkf->mName == i18n("Birthdays") ) { |
471 | kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); | 471 | kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); |
472 | } | 472 | } |
473 | if ( kkf->isRelative ) | 473 | if ( kkf->isRelative ) |
474 | kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; | 474 | kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; |
475 | } | 475 | } |
476 | 476 | ||
477 | KPimPrefs::usrReadConfig(); | 477 | KPimPrefs::usrReadConfig(); |
478 | } | 478 | } |
479 | 479 | ||
480 | KopiCalendarFile * KOPrefs::getCalendar( int num ) | 480 | KopiCalendarFile * KOPrefs::getCalendar( int num ) |
481 | { | 481 | { |
482 | return mDefCalColors[num-1]; | 482 | return mDefCalColors[num-1]; |
483 | } | 483 | } |
484 | 484 | ||
485 | KopiCalendarFile * KOPrefs::getNewCalendar() | 485 | KopiCalendarFile * KOPrefs::getNewCalendar() |
486 | { | 486 | { |
487 | KopiCalendarFile * kkf = new KopiCalendarFile(); | 487 | KopiCalendarFile * kkf = new KopiCalendarFile(); |
488 | kkf->mCalNumber = mNextAvailableCalendar; | 488 | kkf->mCalNumber = mNextAvailableCalendar; |
489 | mDefCalColors.resize( mNextAvailableCalendar ); | 489 | mDefCalColors.resize( mNextAvailableCalendar ); |
490 | mDefCalColors[mNextAvailableCalendar-1] = kkf; | 490 | mDefCalColors[mNextAvailableCalendar-1] = kkf; |
491 | ++mNextAvailableCalendar; | 491 | ++mNextAvailableCalendar; |
492 | kkf->mDefaultColor = mEventColor; | 492 | kkf->mDefaultColor = mEventColor; |
493 | kkf->mName = i18n("New Calendar"); | 493 | kkf->mName = i18n("New Calendar"); |
494 | mCalendars.append( kkf ); | 494 | mCalendars.append( kkf ); |
495 | return kkf; | 495 | return kkf; |
496 | } | 496 | } |
497 | void KOPrefs::deleteCalendar( int num ) | 497 | void KOPrefs::deleteCalendar( int num ) |
498 | { | 498 | { |
499 | KopiCalendarFile * kkf = mCalendars.first(); | 499 | KopiCalendarFile * kkf = mCalendars.first(); |
500 | while ( kkf ) { | 500 | while ( kkf ) { |
501 | if ( kkf->mCalNumber == num ) { | 501 | if ( kkf->mCalNumber == num ) { |
502 | qDebug("KOPrefs::deleteCalendar %d ", num ); | 502 | qDebug("KOPrefs::deleteCalendar %d ", num ); |
503 | mCalendars.remove( kkf ); | 503 | mCalendars.remove( kkf ); |
504 | delete kkf; | 504 | delete kkf; |
505 | return; | 505 | return; |
506 | } | 506 | } |
507 | kkf = mCalendars.next(); | 507 | kkf = mCalendars.next(); |
508 | } | 508 | } |
509 | } | 509 | } |
510 | int KOPrefs::getCalendarID( const QString & name ) | 510 | int KOPrefs::getCalendarID( const QString & name ) |
511 | { | 511 | { |
512 | KopiCalendarFile * kkf = mCalendars.first(); | 512 | KopiCalendarFile * kkf = mCalendars.first(); |
513 | while ( kkf ) { | 513 | while ( kkf ) { |
514 | if ( name == kkf->mName) | 514 | if ( name == kkf->mName) |
515 | return kkf->mCalNumber; | 515 | return kkf->mCalNumber; |
516 | kkf = mCalendars.next(); | 516 | kkf = mCalendars.next(); |
517 | } | 517 | } |
518 | return 1; | 518 | return 1; |
519 | } | 519 | } |
520 | QString KOPrefs::calName( int calNum) const | 520 | QString KOPrefs::calName( int calNum) const |
521 | { | 521 | { |
522 | return (mDefCalColors[calNum-1])->mName; | 522 | return (mDefCalColors[calNum-1])->mName; |
523 | } | 523 | } |
524 | QColor KOPrefs::defaultColor( int calNum ) const | 524 | QColor KOPrefs::defaultColor( int calNum ) const |
525 | { | 525 | { |
526 | if ( calNum == 1 ) return mEventColor; | 526 | if ( calNum == 1 ) return mEventColor; |
527 | return (mDefCalColors[calNum-1])->mDefaultColor; | 527 | return (mDefCalColors[calNum-1])->mDefaultColor; |
528 | } | 528 | } |
529 | void KOPrefs::usrWriteConfig() | 529 | void KOPrefs::usrWriteConfig() |
530 | { | 530 | { |
531 | config()->setGroup("General"); | 531 | config()->setGroup("General"); |
532 | config()->writeEntry("Custom Categories",mCustomCategories); | 532 | config()->writeEntry("Custom Categories",mCustomCategories); |
533 | 533 | ||
534 | config()->setGroup("Personal Settings"); | 534 | config()->setGroup("Personal Settings"); |
535 | config()->writeEntry("user_name",mName); | 535 | config()->writeEntry("user_name",mName); |
536 | config()->writeEntry("user_email",mEmail); | 536 | config()->writeEntry("user_email",mEmail); |
537 | 537 | ||
538 | config()->setGroup("Category Colors"); | 538 | config()->setGroup("Category Colors"); |
539 | QDictIterator<QColor> it(mCategoryColors); | 539 | QDictIterator<QColor> it(mCategoryColors); |
540 | while (it.current()) { | 540 | while (it.current()) { |
541 | config()->writeEntry(it.currentKey(),*(it.current())); | 541 | config()->writeEntry(it.currentKey(),*(it.current())); |
542 | ++it; | 542 | ++it; |
543 | } | 543 | } |
544 | KConfig fc (locateLocal("config","kopicalendarrc")); | 544 | KConfig fc (locateLocal("config","kopicalendarrc")); |
545 | fc.setGroup("CC"); | 545 | fc.setGroup("CC"); |
546 | fc.deleteGroup( "CC"); | 546 | fc.deleteGroup( "CC"); |
547 | fc.setGroup("CC"); | 547 | fc.setGroup("CC"); |
548 | fc.writeEntry("NumberCalendars",mCalendars.count()); | 548 | fc.writeEntry("NumberCalendars",mCalendars.count()); |
549 | int numCal = 1; | 549 | int numCal = 1; |
550 | int writeCal = 0; | 550 | int writeCal = 0; |
551 | while ( numCal < mNextAvailableCalendar ) { | 551 | while ( numCal < mNextAvailableCalendar ) { |
552 | KopiCalendarFile * kkf = mCalendars.first(); | 552 | KopiCalendarFile * kkf = mCalendars.first(); |
553 | while ( kkf ) { | 553 | while ( kkf ) { |
554 | //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); | 554 | //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); |
555 | if ( kkf->mCalNumber == numCal ) { | 555 | if ( kkf->mCalNumber == numCal ) { |
556 | ++writeCal; | 556 | ++writeCal; |
557 | //qDebug("Write calendar %d %d ", numCal , writeCal); | 557 | //qDebug("Write calendar %d %d ", numCal , writeCal); |
558 | QString prefix = "Cal_" + QString::number( writeCal ); | 558 | QString prefix = "Cal_" + QString::number( writeCal ); |
559 | fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); | 559 | fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); |
560 | fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); | 560 | fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); |
561 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); | 561 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); |
562 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); | 562 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); |
563 | fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); | 563 | fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); |
564 | fc.writeEntry( prefix+"_Name", kkf->mName); | 564 | fc.writeEntry( prefix+"_Name", kkf->mName); |
565 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); | 565 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); |
566 | fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); | 566 | fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); |
567 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); | 567 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); |
568 | } | 568 | } |
569 | kkf = mCalendars.next(); | 569 | kkf = mCalendars.next(); |
570 | } | 570 | } |
571 | ++numCal; | 571 | ++numCal; |
572 | } | 572 | } |
573 | fc.sync(); | 573 | fc.sync(); |
574 | KPimPrefs::usrWriteConfig(); | 574 | KPimPrefs::usrWriteConfig(); |
575 | } | 575 | } |
576 | 576 | ||
577 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 577 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
578 | { | 578 | { |
579 | mCategoryColors.replace(cat,new QColor(color)); | 579 | mCategoryColors.replace(cat,new QColor(color)); |
580 | } | 580 | } |
581 | 581 | ||
582 | QColor *KOPrefs::categoryColor(QString cat) | 582 | QColor *KOPrefs::categoryColor(QString cat) |
583 | { | 583 | { |
584 | QColor *color = 0; | 584 | QColor *color = 0; |
585 | 585 | ||
586 | if (!cat.isEmpty()) color = mCategoryColors[cat]; | 586 | if (!cat.isEmpty()) color = mCategoryColors[cat]; |
587 | 587 | ||
588 | if (color) return color; | 588 | if (color) return color; |
589 | else return &mDefaultCategoryColor; | 589 | else return &mDefaultCategoryColor; |
590 | } | 590 | } |
591 | 591 | ||
592 | void KOPrefs::setFullName(const QString &name) | 592 | void KOPrefs::setFullName(const QString &name) |
593 | { | 593 | { |
594 | mName = name; | 594 | mName = name; |
595 | } | 595 | } |
596 | 596 | ||
597 | void KOPrefs::setEmail(const QString &email) | 597 | void KOPrefs::setEmail(const QString &email) |
598 | { | 598 | { |
599 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); | 599 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); |
600 | mEmail = email; | 600 | mEmail = email; |
601 | } | 601 | } |
602 | 602 | ||
603 | QString KOPrefs::fullName() | 603 | QString KOPrefs::fullName() |
604 | { | 604 | { |
605 | if (mEmailControlCenter) { | 605 | if (mEmailControlCenter) { |
606 | KEMailSettings settings; | 606 | KEMailSettings settings; |
607 | return settings.getSetting(KEMailSettings::RealName); | 607 | return settings.getSetting(KEMailSettings::RealName); |
608 | } else { | 608 | } else { |
609 | return mName; | 609 | return mName; |
610 | } | 610 | } |
611 | } | 611 | } |
612 | 612 | ||
613 | QString KOPrefs::email() | 613 | QString KOPrefs::email() |
614 | { | 614 | { |
615 | if (mEmailControlCenter) { | 615 | if (mEmailControlCenter) { |
616 | KEMailSettings settings; | 616 | KEMailSettings settings; |
617 | return settings.getSetting(KEMailSettings::EmailAddress); | 617 | return settings.getSetting(KEMailSettings::EmailAddress); |
618 | } else { | 618 | } else { |
619 | return mEmail; | 619 | return mEmail; |
620 | } | 620 | } |
621 | } | 621 | } |
622 | KConfig* KOPrefs::getConfig() | 622 | KConfig* KOPrefs::getConfig() |
623 | { | 623 | { |
624 | return config(); | 624 | return config(); |
625 | } | 625 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index bfae1b5..5249300 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -353,2171 +353,2189 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
353 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 353 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
354 | KOPrefs::instance()->setAllDefaults(); | 354 | KOPrefs::instance()->setAllDefaults(); |
355 | } | 355 | } |
356 | processIncidenceSelection( 0 ); | 356 | processIncidenceSelection( 0 ); |
357 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 357 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
358 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 358 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
359 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 359 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
360 | SLOT( slotModifiedChanged( bool ) ) ); | 360 | SLOT( slotModifiedChanged( bool ) ) ); |
361 | 361 | ||
362 | 362 | ||
363 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 363 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
364 | SLOT( disableBR(bool) ) ); | 364 | SLOT( disableBR(bool) ) ); |
365 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 365 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
366 | mView->setModified( false ); | 366 | mView->setModified( false ); |
367 | mBlockAtStartup = false; | 367 | mBlockAtStartup = false; |
368 | mView->setModified( false ); | 368 | mView->setModified( false ); |
369 | setCentralWidget( mView ); | 369 | setCentralWidget( mView ); |
370 | globalFlagBlockStartup = 0; | 370 | globalFlagBlockStartup = 0; |
371 | mView->show(); | 371 | mView->show(); |
372 | delete splash; | 372 | delete splash; |
373 | if ( newFile ) | 373 | if ( newFile ) |
374 | mView->updateConfig(); | 374 | mView->updateConfig(); |
375 | // qApp->processEvents(); | 375 | // qApp->processEvents(); |
376 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 376 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
377 | //fillSyncMenu(); | 377 | //fillSyncMenu(); |
378 | 378 | ||
379 | 379 | ||
380 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 380 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
381 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 381 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
382 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 382 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
383 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 383 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
384 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 384 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
385 | mSyncManager->setDefaultFileName( sentSyncFile()); | 385 | mSyncManager->setDefaultFileName( sentSyncFile()); |
386 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 386 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
387 | mSyncManager->fillSyncMenu(); | 387 | mSyncManager->fillSyncMenu(); |
388 | 388 | ||
389 | 389 | ||
390 | 390 | ||
391 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 391 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
392 | if ( showWarning ) { | 392 | if ( showWarning ) { |
393 | KMessageBox::information( this, | 393 | KMessageBox::information( this, |
394 | "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"); | 394 | "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"); |
395 | qApp->processEvents(); | 395 | qApp->processEvents(); |
396 | mView->dialogManager()->showSyncOptions(); | 396 | mView->dialogManager()->showSyncOptions(); |
397 | } | 397 | } |
398 | 398 | ||
399 | //US listen for result adressed from Ka/Pi | 399 | //US listen for result adressed from Ka/Pi |
400 | #ifndef DESKTOP_VERSION | 400 | #ifndef DESKTOP_VERSION |
401 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 401 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
402 | #endif | 402 | #endif |
403 | #ifndef DESKTOP_VERSION | 403 | #ifndef DESKTOP_VERSION |
404 | infrared = 0; | 404 | infrared = 0; |
405 | #endif | 405 | #endif |
406 | updateFilterToolbar(); | 406 | updateFilterToolbar(); |
407 | updateWeek( mView->startDate() ); | 407 | updateWeek( mView->startDate() ); |
408 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 408 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
409 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 409 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
410 | mBRdisabled = false; | 410 | mBRdisabled = false; |
411 | //toggleBeamReceive(); | 411 | //toggleBeamReceive(); |
412 | 412 | ||
413 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | 413 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); |
414 | } | 414 | } |
415 | MainWindow::~MainWindow() | 415 | MainWindow::~MainWindow() |
416 | { | 416 | { |
417 | //qDebug("MainWindow::~MainWindow() "); | 417 | //qDebug("MainWindow::~MainWindow() "); |
418 | //save toolbar location | 418 | //save toolbar location |
419 | delete mCalendar; | 419 | delete mCalendar; |
420 | delete mSyncManager; | 420 | delete mSyncManager; |
421 | #ifndef DESKTOP_VERSION | 421 | #ifndef DESKTOP_VERSION |
422 | if ( infrared ) | 422 | if ( infrared ) |
423 | delete infrared; | 423 | delete infrared; |
424 | #endif | 424 | #endif |
425 | 425 | ||
426 | 426 | ||
427 | } | 427 | } |
428 | 428 | ||
429 | void MainWindow::disableBR(bool b) | 429 | void MainWindow::disableBR(bool b) |
430 | { | 430 | { |
431 | #ifndef DESKTOP_VERSION | 431 | #ifndef DESKTOP_VERSION |
432 | if ( b ) { | 432 | if ( b ) { |
433 | if ( infrared ) { | 433 | if ( infrared ) { |
434 | toggleBeamReceive(); | 434 | toggleBeamReceive(); |
435 | mBRdisabled = true; | 435 | mBRdisabled = true; |
436 | } | 436 | } |
437 | mBRdisabled = true; | 437 | mBRdisabled = true; |
438 | } else { | 438 | } else { |
439 | if ( mBRdisabled ) { | 439 | if ( mBRdisabled ) { |
440 | mBRdisabled = false; | 440 | mBRdisabled = false; |
441 | //makes no sense,because other cal ap is probably running | 441 | //makes no sense,because other cal ap is probably running |
442 | // toggleBeamReceive(); | 442 | // toggleBeamReceive(); |
443 | } | 443 | } |
444 | } | 444 | } |
445 | #endif | 445 | #endif |
446 | 446 | ||
447 | } | 447 | } |
448 | bool MainWindow::beamReceiveEnabled() | 448 | bool MainWindow::beamReceiveEnabled() |
449 | { | 449 | { |
450 | #ifndef DESKTOP_VERSION | 450 | #ifndef DESKTOP_VERSION |
451 | return ( infrared != 0 ); | 451 | return ( infrared != 0 ); |
452 | #endif | 452 | #endif |
453 | return false; | 453 | return false; |
454 | } | 454 | } |
455 | 455 | ||
456 | void MainWindow::toggleBeamReceive() | 456 | void MainWindow::toggleBeamReceive() |
457 | { | 457 | { |
458 | if ( mBRdisabled ) | 458 | if ( mBRdisabled ) |
459 | return; | 459 | return; |
460 | #ifndef DESKTOP_VERSION | 460 | #ifndef DESKTOP_VERSION |
461 | if ( infrared ) { | 461 | if ( infrared ) { |
462 | qDebug("KO: Disable BeamReceive "); | 462 | qDebug("KO: Disable BeamReceive "); |
463 | delete infrared; | 463 | delete infrared; |
464 | infrared = 0; | 464 | infrared = 0; |
465 | brAction->setOn(false); | 465 | brAction->setOn(false); |
466 | return; | 466 | return; |
467 | } | 467 | } |
468 | qDebug("KO: Enable BeamReceive "); | 468 | qDebug("KO: Enable BeamReceive "); |
469 | brAction->setOn(true); | 469 | brAction->setOn(true); |
470 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 470 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
471 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 471 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
472 | #endif | 472 | #endif |
473 | } | 473 | } |
474 | void MainWindow::showMaximized () | 474 | void MainWindow::showMaximized () |
475 | { | 475 | { |
476 | #ifndef DESKTOP_VERSION | 476 | #ifndef DESKTOP_VERSION |
477 | if ( ! globalFlagBlockStartup ) | 477 | if ( ! globalFlagBlockStartup ) |
478 | if ( mClosed ) | 478 | if ( mClosed ) |
479 | mView->goToday(); | 479 | mView->goToday(); |
480 | #endif | 480 | #endif |
481 | QWidget::showMaximized () ; | 481 | QWidget::showMaximized () ; |
482 | mClosed = false; | 482 | mClosed = false; |
483 | } | 483 | } |
484 | void MainWindow::closeEvent( QCloseEvent* ce ) | 484 | void MainWindow::closeEvent( QCloseEvent* ce ) |
485 | { | 485 | { |
486 | 486 | ||
487 | 487 | ||
488 | 488 | ||
489 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 489 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
490 | saveOnClose(); | 490 | saveOnClose(); |
491 | mClosed = true; | 491 | mClosed = true; |
492 | ce->accept(); | 492 | ce->accept(); |
493 | return; | 493 | return; |
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | switch( QMessageBox::information( this, "KO/Pi", | 497 | switch( QMessageBox::information( this, "KO/Pi", |
498 | i18n("Do you really want\nto close KO/Pi?"), | 498 | i18n("Do you really want\nto close KO/Pi?"), |
499 | i18n("Close"), i18n("No"), | 499 | i18n("Close"), i18n("No"), |
500 | 0, 0 ) ) { | 500 | 0, 0 ) ) { |
501 | case 0: | 501 | case 0: |
502 | saveOnClose(); | 502 | saveOnClose(); |
503 | mClosed = true; | 503 | mClosed = true; |
504 | ce->accept(); | 504 | ce->accept(); |
505 | break; | 505 | break; |
506 | case 1: | 506 | case 1: |
507 | ce->ignore(); | 507 | ce->ignore(); |
508 | break; | 508 | break; |
509 | case 2: | 509 | case 2: |
510 | 510 | ||
511 | default: | 511 | default: |
512 | break; | 512 | break; |
513 | } | 513 | } |
514 | 514 | ||
515 | 515 | ||
516 | } | 516 | } |
517 | 517 | ||
518 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 518 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
519 | { | 519 | { |
520 | QDataStream stream( data, IO_ReadOnly ); | 520 | QDataStream stream( data, IO_ReadOnly ); |
521 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 521 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
522 | //QString datamess; | 522 | //QString datamess; |
523 | //qDebug("message "); | 523 | //qDebug("message "); |
524 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 524 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
525 | 525 | ||
526 | if ( cmsg == "setDocument(QString)" ) { | 526 | if ( cmsg == "setDocument(QString)" ) { |
527 | QDataStream stream( data, IO_ReadOnly ); | 527 | QDataStream stream( data, IO_ReadOnly ); |
528 | QString fileName; | 528 | QString fileName; |
529 | stream >> fileName; | 529 | stream >> fileName; |
530 | //qDebug("filename %s ", fileName.latin1()); | 530 | //qDebug("filename %s ", fileName.latin1()); |
531 | showMaximized(); | 531 | showMaximized(); |
532 | raise(); | 532 | raise(); |
533 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 533 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
534 | mSyncManager->slotSyncMenu( 1002 ); | 534 | mSyncManager->slotSyncMenu( 1002 ); |
535 | return; | 535 | return; |
536 | } | 536 | } |
537 | 537 | ||
538 | if ( cmsg == "-writeFile" ) { | 538 | if ( cmsg == "-writeFile" ) { |
539 | // I made from the "-writeFile" an "-writeAlarm" | 539 | // I made from the "-writeFile" an "-writeAlarm" |
540 | mView->viewManager()->showWhatsNextView(); | 540 | mView->viewManager()->showWhatsNextView(); |
541 | mCalendar->checkAlarmForIncidence( 0, true); | 541 | mCalendar->checkAlarmForIncidence( 0, true); |
542 | showMaximized(); | 542 | showMaximized(); |
543 | raise(); | 543 | raise(); |
544 | return; | 544 | return; |
545 | 545 | ||
546 | } | 546 | } |
547 | if ( cmsg == "-writeFileSilent" ) { | 547 | if ( cmsg == "-writeFileSilent" ) { |
548 | // I made from the "-writeFile" an "-writeAlarm" | 548 | // I made from the "-writeFile" an "-writeAlarm" |
549 | // mView->viewManager()->showWhatsNextView(); | 549 | // mView->viewManager()->showWhatsNextView(); |
550 | mCalendar->checkAlarmForIncidence( 0, true); | 550 | mCalendar->checkAlarmForIncidence( 0, true); |
551 | //showMaximized(); | 551 | //showMaximized(); |
552 | //raise(); | 552 | //raise(); |
553 | hide(); | 553 | hide(); |
554 | return; | 554 | return; |
555 | } | 555 | } |
556 | if ( cmsg == "-newCountdown" ) { | 556 | if ( cmsg == "-newCountdown" ) { |
557 | qDebug("newCountdown "); | 557 | qDebug("newCountdown "); |
558 | 558 | ||
559 | } | 559 | } |
560 | QString msg ; | 560 | QString msg ; |
561 | QString allmsg = cmsg; | 561 | QString allmsg = cmsg; |
562 | while ( allmsg.length() > 0 ) { | 562 | while ( allmsg.length() > 0 ) { |
563 | int nextC = allmsg.find( "-", 1 ); | 563 | int nextC = allmsg.find( "-", 1 ); |
564 | if ( nextC == -1 ) { | 564 | if ( nextC == -1 ) { |
565 | msg = allmsg; | 565 | msg = allmsg; |
566 | allmsg = ""; | 566 | allmsg = ""; |
567 | } else{ | 567 | } else{ |
568 | msg = allmsg.left( nextC ); | 568 | msg = allmsg.left( nextC ); |
569 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 569 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
570 | } | 570 | } |
571 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 571 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
572 | if ( msg == "-newEvent" ) { | 572 | if ( msg == "-newEvent" ) { |
573 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); | 573 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); |
574 | } | 574 | } |
575 | if ( msg == "-newTodo" ) { | 575 | if ( msg == "-newTodo" ) { |
576 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); | 576 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); |
577 | } | 577 | } |
578 | if ( msg == "-showWN" ) { | 578 | if ( msg == "-showWN" ) { |
579 | mView->viewManager()->showWhatsNextView(); | 579 | mView->viewManager()->showWhatsNextView(); |
580 | } | 580 | } |
581 | if ( msg == "-showTodo" ) { | 581 | if ( msg == "-showTodo" ) { |
582 | mView->viewManager()->showTodoView(); | 582 | mView->viewManager()->showTodoView(); |
583 | } | 583 | } |
584 | if ( msg == "-showList" ) { | 584 | if ( msg == "-showList" ) { |
585 | mView->viewManager()->showListView(); | 585 | mView->viewManager()->showListView(); |
586 | } | 586 | } |
587 | else if ( msg == "-showDay" ) { | 587 | else if ( msg == "-showDay" ) { |
588 | mView->viewManager()->showDayView(); | 588 | mView->viewManager()->showDayView(); |
589 | } | 589 | } |
590 | else if ( msg == "-showWWeek" ) { | 590 | else if ( msg == "-showWWeek" ) { |
591 | mView->viewManager()->showWorkWeekView(); | 591 | mView->viewManager()->showWorkWeekView(); |
592 | } | 592 | } |
593 | else if ( msg == "-ringSync" ) { | 593 | else if ( msg == "-ringSync" ) { |
594 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); | 594 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
595 | } | 595 | } |
596 | else if ( msg == "-showWeek" ) { | 596 | else if ( msg == "-showWeek" ) { |
597 | mView->viewManager()->showWeekView(); | 597 | mView->viewManager()->showWeekView(); |
598 | } | 598 | } |
599 | else if ( msg == "-showTodo" ) { | 599 | else if ( msg == "-showTodo" ) { |
600 | mView->viewManager()->showTodoView(); | 600 | mView->viewManager()->showTodoView(); |
601 | } | 601 | } |
602 | else if ( msg == "-showJournal" ) { | 602 | else if ( msg == "-showJournal" ) { |
603 | mView->dateNavigator()->selectDates( 1 ); | 603 | mView->dateNavigator()->selectDates( 1 ); |
604 | mView->dateNavigator()->selectToday(); | 604 | mView->dateNavigator()->selectToday(); |
605 | mView->viewManager()->showJournalView(); | 605 | mView->viewManager()->showJournalView(); |
606 | } | 606 | } |
607 | else if ( msg == "-showKO" ) { | 607 | else if ( msg == "-showKO" ) { |
608 | mView->viewManager()->showNextXView(); | 608 | mView->viewManager()->showNextXView(); |
609 | } | 609 | } |
610 | else if ( msg == "-showWNext" ) { | 610 | else if ( msg == "-showWNext" ) { |
611 | mView->viewManager()->showWhatsNextView(); | 611 | mView->viewManager()->showWhatsNextView(); |
612 | } | 612 | } |
613 | else if ( msg == "nextView()" ) { | 613 | else if ( msg == "nextView()" ) { |
614 | mView->viewManager()->showNextView(); | 614 | mView->viewManager()->showNextView(); |
615 | } | 615 | } |
616 | else if ( msg == "-showNextXView" ) { | 616 | else if ( msg == "-showNextXView" ) { |
617 | mView->viewManager()->showNextXView(); | 617 | mView->viewManager()->showNextXView(); |
618 | } | 618 | } |
619 | 619 | ||
620 | 620 | ||
621 | } | 621 | } |
622 | 622 | ||
623 | showMaximized(); | 623 | showMaximized(); |
624 | raise(); | 624 | raise(); |
625 | } | 625 | } |
626 | void MainWindow::startMultiSync() | 626 | void MainWindow::startMultiSync() |
627 | { | 627 | { |
628 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 628 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
629 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | 629 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
630 | question, | 630 | question, |
631 | i18n("Yes"), i18n("No"), | 631 | i18n("Yes"), i18n("No"), |
632 | 0, 0 ) != 0 ) { | 632 | 0, 0 ) != 0 ) { |
633 | setCaption(i18n("Aborted! Nothing synced!")); | 633 | setCaption(i18n("Aborted! Nothing synced!")); |
634 | return; | 634 | return; |
635 | } | 635 | } |
636 | mSyncManager->multiSync( false ); | 636 | mSyncManager->multiSync( false ); |
637 | #ifndef DESKTOP_VERSION | 637 | #ifndef DESKTOP_VERSION |
638 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 638 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
639 | #endif | 639 | #endif |
640 | } | 640 | } |
641 | QPixmap MainWindow::loadPixmap( QString name ) | 641 | QPixmap MainWindow::loadPixmap( QString name ) |
642 | { | 642 | { |
643 | return SmallIcon( name ); | 643 | return SmallIcon( name ); |
644 | 644 | ||
645 | } | 645 | } |
646 | void MainWindow::setUsesBigPixmaps ( bool b ) | 646 | void MainWindow::setUsesBigPixmaps ( bool b ) |
647 | { | 647 | { |
648 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 648 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
649 | if ( b ) | 649 | if ( b ) |
650 | qDebug("KO: BigPixmaps are not supported "); | 650 | qDebug("KO: BigPixmaps are not supported "); |
651 | } | 651 | } |
652 | void MainWindow::initActions() | 652 | void MainWindow::initActions() |
653 | { | 653 | { |
654 | //KOPrefs::instance()->mShowFullMenu | 654 | //KOPrefs::instance()->mShowFullMenu |
655 | iconToolBar->clear(); | 655 | iconToolBar->clear(); |
656 | KOPrefs *p = KOPrefs::instance(); | 656 | KOPrefs *p = KOPrefs::instance(); |
657 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 657 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
658 | 658 | ||
659 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 659 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
660 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 660 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
661 | mCurrentItemMenu = new QPopupMenu ( this ); | 661 | mCurrentItemMenu = new QPopupMenu ( this ); |
662 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); | 662 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); |
663 | QPopupMenu *importMenu = new QPopupMenu( this ); | 663 | QPopupMenu *importMenu = new QPopupMenu( this ); |
664 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 664 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
665 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 665 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
666 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 666 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
667 | selectFilterMenu = new QPopupMenu( this ); | 667 | selectFilterMenu = new QPopupMenu( this ); |
668 | selectFilterMenu->setCheckable( true ); | 668 | selectFilterMenu->setCheckable( true ); |
669 | syncMenu = new QPopupMenu( this ); | 669 | syncMenu = new QPopupMenu( this ); |
670 | configureAgendaMenu = new QPopupMenu( this ); | 670 | configureAgendaMenu = new QPopupMenu( this ); |
671 | configureToolBarMenu = new QPopupMenu( this ); | 671 | configureToolBarMenu = new QPopupMenu( this ); |
672 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 672 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
673 | QIconSet icon; | 673 | QIconSet icon; |
674 | int pixWid = 22, pixHei = 22; | 674 | int pixWid = 22, pixHei = 22; |
675 | QString pathString = ""; | 675 | QString pathString = ""; |
676 | if ( !p->mToolBarMiniIcons ) { | 676 | if ( !p->mToolBarMiniIcons ) { |
677 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 677 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
678 | pathString += "icons16/"; | 678 | pathString += "icons16/"; |
679 | pixWid = 18; pixHei = 16; | 679 | pixWid = 18; pixHei = 16; |
680 | } | 680 | } |
681 | } else { | 681 | } else { |
682 | pathString += "iconsmini/"; | 682 | pathString += "iconsmini/"; |
683 | pixWid = 18; pixHei = 16; | 683 | pixWid = 18; pixHei = 16; |
684 | } | 684 | } |
685 | if ( KOPrefs::instance()->mShowFullMenu ) { | 685 | if ( KOPrefs::instance()->mShowFullMenu ) { |
686 | QMenuBar *menuBar1; | 686 | QMenuBar *menuBar1; |
687 | menuBar1 = menuBar(); | 687 | menuBar1 = menuBar(); |
688 | menuBar1->insertItem( i18n("File"), importMenu ); | 688 | menuBar1->insertItem( i18n("File"), importMenu ); |
689 | menuBar1->insertItem( i18n("View"), viewMenu ); | 689 | menuBar1->insertItem( i18n("View"), viewMenu ); |
690 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); | 690 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); |
691 | menuBar1->insertItem( i18n("Action"), actionMenu ); | 691 | menuBar1->insertItem( i18n("Action"), actionMenu ); |
692 | #ifdef DESKTOP_VERSION | 692 | #ifdef DESKTOP_VERSION |
693 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 693 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
694 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 694 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
695 | #else | 695 | #else |
696 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 696 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
697 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 697 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
698 | #endif | 698 | #endif |
699 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 699 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
700 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 700 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
701 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 701 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
702 | } else { | 702 | } else { |
703 | QPEMenuBar *menuBar1; | 703 | QPEMenuBar *menuBar1; |
704 | menuBar1 = new QPEMenuBar( iconToolBar ); | 704 | menuBar1 = new QPEMenuBar( iconToolBar ); |
705 | QPopupMenu *menuBar = new QPopupMenu( this ); | 705 | QPopupMenu *menuBar = new QPopupMenu( this ); |
706 | icon = loadPixmap( pathString + "z_menu" ); | 706 | icon = loadPixmap( pathString + "z_menu" ); |
707 | menuBar1->insertItem( icon.pixmap(), menuBar); | 707 | menuBar1->insertItem( icon.pixmap(), menuBar); |
708 | //menuBar1->insertItem( i18n("ME"), menuBar); | 708 | //menuBar1->insertItem( i18n("ME"), menuBar); |
709 | menuBar->insertItem( i18n("File"), importMenu ); | 709 | menuBar->insertItem( i18n("File"), importMenu ); |
710 | menuBar->insertItem( i18n("View"), viewMenu ); | 710 | menuBar->insertItem( i18n("View"), viewMenu ); |
711 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); | 711 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); |
712 | menuBar->insertItem( i18n("Action"), actionMenu ); | 712 | menuBar->insertItem( i18n("Action"), actionMenu ); |
713 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 713 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
714 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 714 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
715 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 715 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
716 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 716 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
717 | menuBar->insertItem( i18n("Help"), helpMenu ); | 717 | menuBar->insertItem( i18n("Help"), helpMenu ); |
718 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 718 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
719 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 719 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
720 | } | 720 | } |
721 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 721 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
722 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 722 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
723 | 723 | ||
724 | 724 | ||
725 | mWeekBgColor = iconToolBar->backgroundColor(); | 725 | mWeekBgColor = iconToolBar->backgroundColor(); |
726 | mWeekPixmap.resize( pixWid , pixHei ); | 726 | mWeekPixmap.resize( pixWid , pixHei ); |
727 | mWeekPixmap.fill( mWeekBgColor ); | 727 | mWeekPixmap.fill( mWeekBgColor ); |
728 | icon = mWeekPixmap; | 728 | icon = mWeekPixmap; |
729 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 729 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
730 | if ( p-> mShowIconWeekNum ) | 730 | if ( p-> mShowIconWeekNum ) |
731 | mWeekAction->addTo( iconToolBar ); | 731 | mWeekAction->addTo( iconToolBar ); |
732 | mWeekFont = font(); | 732 | mWeekFont = font(); |
733 | 733 | ||
734 | int fontPoint = mWeekFont.pointSize(); | 734 | int fontPoint = mWeekFont.pointSize(); |
735 | QFontMetrics f( mWeekFont ); | 735 | QFontMetrics f( mWeekFont ); |
736 | int fontWid = f.width( "30" ); | 736 | int fontWid = f.width( "30" ); |
737 | while ( fontWid > pixWid ) { | 737 | while ( fontWid > pixWid ) { |
738 | --fontPoint; | 738 | --fontPoint; |
739 | mWeekFont.setPointSize( fontPoint ); | 739 | mWeekFont.setPointSize( fontPoint ); |
740 | QFontMetrics f( mWeekFont ); | 740 | QFontMetrics f( mWeekFont ); |
741 | fontWid = f.width( "30" ); | 741 | fontWid = f.width( "30" ); |
742 | //qDebug("dec-- "); | 742 | //qDebug("dec-- "); |
743 | } | 743 | } |
744 | 744 | ||
745 | connect( mWeekAction, SIGNAL( activated() ), | 745 | connect( mWeekAction, SIGNAL( activated() ), |
746 | this, SLOT( weekAction() ) ); | 746 | this, SLOT( weekAction() ) ); |
747 | 747 | ||
748 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 748 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
749 | if ( p->mShowIconFilterview ) { | 749 | if ( p->mShowIconFilterview ) { |
750 | icon = loadPixmap( pathString + "filter" ); | 750 | icon = loadPixmap( pathString + "filter" ); |
751 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 751 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
752 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 752 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
753 | this, SLOT( fillFilterMenuTB() ) ); | 753 | this, SLOT( fillFilterMenuTB() ) ); |
754 | actionFilterMenuTB->addTo( iconToolBar ); | 754 | actionFilterMenuTB->addTo( iconToolBar ); |
755 | selectFilterMenuTB = new QPopupMenu( this ); | 755 | selectFilterMenuTB = new QPopupMenu( this ); |
756 | selectFilterMenuTB->setCheckable( true ); | 756 | selectFilterMenuTB->setCheckable( true ); |
757 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 757 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
758 | } | 758 | } |
759 | 759 | ||
760 | //#endif | 760 | //#endif |
761 | // ****************** | 761 | // ****************** |
762 | QAction *action; | 762 | QAction *action; |
763 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 763 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
764 | configureToolBarMenu->setCheckable( true ); | 764 | configureToolBarMenu->setCheckable( true ); |
765 | 765 | ||
766 | 766 | ||
767 | configureAgendaMenu->setCheckable( true ); | 767 | configureAgendaMenu->setCheckable( true ); |
768 | int iii ; | 768 | int iii ; |
769 | for ( iii = 1;iii<= 10 ;++iii ){ | 769 | for ( iii = 1;iii<= 10 ;++iii ){ |
770 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 770 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
771 | } | 771 | } |
772 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 772 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
773 | 773 | ||
774 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 774 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
775 | this, SLOT( showConfigureAgenda( ) ) ); | 775 | this, SLOT( showConfigureAgenda( ) ) ); |
776 | icon = loadPixmap( pathString + "today" ); | 776 | icon = loadPixmap( pathString + "today" ); |
777 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 777 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
778 | today_action->addTo( actionMenu ); | 778 | today_action->addTo( actionMenu ); |
779 | connect( today_action, SIGNAL( activated() ), | 779 | connect( today_action, SIGNAL( activated() ), |
780 | mView, SLOT( goToday() ) ); | 780 | mView, SLOT( goToday() ) ); |
781 | 781 | ||
782 | icon = loadPixmap( pathString + "picker" ); | 782 | icon = loadPixmap( pathString + "picker" ); |
783 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | 783 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); |
784 | dPickerAction->addTo( actionMenu ); | 784 | dPickerAction->addTo( actionMenu ); |
785 | connect( dPickerAction, SIGNAL( activated() ), | 785 | connect( dPickerAction, SIGNAL( activated() ), |
786 | mView, SLOT( showDatePicker() ) ); | 786 | mView, SLOT( showDatePicker() ) ); |
787 | 787 | ||
788 | icon = loadPixmap( pathString + "search" ); | 788 | icon = loadPixmap( pathString + "search" ); |
789 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 789 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
790 | search_action->addTo( actionMenu ); | 790 | search_action->addTo( actionMenu ); |
791 | connect( search_action, SIGNAL( activated() ), | 791 | connect( search_action, SIGNAL( activated() ), |
792 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 792 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
793 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); | 793 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); |
794 | 794 | ||
795 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); | 795 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); |
796 | action->addTo( nextConflictMenu ); | 796 | action->addTo( nextConflictMenu ); |
797 | connect( action, SIGNAL( activated() ), | 797 | connect( action, SIGNAL( activated() ), |
798 | mView, SLOT( conflictAll() ) ); | 798 | mView, SLOT( conflictAll() ) ); |
799 | 799 | ||
800 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); | 800 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); |
801 | action->addTo( nextConflictMenu ); | 801 | action->addTo( nextConflictMenu ); |
802 | connect( action, SIGNAL( activated() ), | 802 | connect( action, SIGNAL( activated() ), |
803 | mView, SLOT( conflictAllday() ) ); | 803 | mView, SLOT( conflictAllday() ) ); |
804 | 804 | ||
805 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); | 805 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); |
806 | action->addTo( nextConflictMenu ); | 806 | action->addTo( nextConflictMenu ); |
807 | connect( action, SIGNAL( activated() ), | 807 | connect( action, SIGNAL( activated() ), |
808 | mView, SLOT( conflictNotAll() ) ); | 808 | mView, SLOT( conflictNotAll() ) ); |
809 | 809 | ||
810 | actionMenu->insertSeparator(); | 810 | actionMenu->insertSeparator(); |
811 | 811 | ||
812 | icon = loadPixmap( pathString + "newevent" ); | 812 | icon = loadPixmap( pathString + "newevent" ); |
813 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 813 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
814 | ne_action->addTo( mCurrentItemMenu ); | 814 | ne_action->addTo( mCurrentItemMenu ); |
815 | connect( ne_action, SIGNAL( activated() ), | 815 | connect( ne_action, SIGNAL( activated() ), |
816 | mView, SLOT( newEvent() ) ); | 816 | mView, SLOT( newEvent() ) ); |
817 | icon = loadPixmap( pathString + "newtodo" ); | 817 | icon = loadPixmap( pathString + "newtodo" ); |
818 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 818 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
819 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 819 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
820 | nt_action->addTo( mCurrentItemMenu ); | 820 | nt_action->addTo( mCurrentItemMenu ); |
821 | connect( nt_action, SIGNAL( activated() ), | 821 | connect( nt_action, SIGNAL( activated() ), |
822 | mView, SLOT( newTodo() ) ); | 822 | mView, SLOT( newTodo() ) ); |
823 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 823 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
824 | this ); | 824 | this ); |
825 | mNewSubTodoAction->addTo( mCurrentItemMenu ); | 825 | mNewSubTodoAction->addTo( mCurrentItemMenu ); |
826 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 826 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
827 | mView, SLOT( newSubTodo() ) ); | 827 | mView, SLOT( newSubTodo() ) ); |
828 | 828 | ||
829 | mCurrentItemMenu->insertSeparator(); | 829 | mCurrentItemMenu->insertSeparator(); |
830 | icon = loadPixmap( pathString + "newevent" ); | 830 | icon = loadPixmap( pathString + "newevent" ); |
831 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 831 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
832 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 832 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
833 | configureToolBarMenu->insertSeparator(); | 833 | configureToolBarMenu->insertSeparator(); |
834 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 834 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
835 | configureToolBarMenu->insertSeparator(); | 835 | configureToolBarMenu->insertSeparator(); |
836 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 836 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
837 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 837 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
838 | 838 | ||
839 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 839 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
840 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); | 840 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); |
841 | mShowAction->addTo( mCurrentItemMenu ); | 841 | mShowAction->addTo( mCurrentItemMenu ); |
842 | connect( mShowAction, SIGNAL( activated() ), | 842 | connect( mShowAction, SIGNAL( activated() ), |
843 | mView, SLOT( showIncidence() ) ); | 843 | mView, SLOT( showIncidence() ) ); |
844 | 844 | ||
845 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 845 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
846 | mEditAction->addTo( mCurrentItemMenu ); | 846 | mEditAction->addTo( mCurrentItemMenu ); |
847 | connect( mEditAction, SIGNAL( activated() ), | 847 | connect( mEditAction, SIGNAL( activated() ), |
848 | mView, SLOT( editIncidence() ) ); | 848 | mView, SLOT( editIncidence() ) ); |
849 | 849 | ||
850 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 850 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
851 | mDeleteAction->addTo( mCurrentItemMenu ); | 851 | mDeleteAction->addTo( mCurrentItemMenu ); |
852 | connect( mDeleteAction, SIGNAL( activated() ), | 852 | connect( mDeleteAction, SIGNAL( activated() ), |
853 | mView, SLOT( deleteIncidence() ) ); | 853 | mView, SLOT( deleteIncidence() ) ); |
854 | 854 | ||
855 | 855 | ||
856 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 856 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
857 | mCloneAction->addTo( mCurrentItemMenu ); | 857 | mCloneAction->addTo( mCurrentItemMenu ); |
858 | connect( mCloneAction, SIGNAL( activated() ), | 858 | connect( mCloneAction, SIGNAL( activated() ), |
859 | mView, SLOT( cloneIncidence() ) ); | 859 | mView, SLOT( cloneIncidence() ) ); |
860 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 860 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
861 | mMoveAction->addTo( mCurrentItemMenu ); | 861 | mMoveAction->addTo( mCurrentItemMenu ); |
862 | connect( mMoveAction, SIGNAL( activated() ), | 862 | connect( mMoveAction, SIGNAL( activated() ), |
863 | mView, SLOT( moveIncidence() ) ); | 863 | mView, SLOT( moveIncidence() ) ); |
864 | #ifndef DESKTOP_VERSION | 864 | #ifndef DESKTOP_VERSION |
865 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 865 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
866 | mBeamAction->addTo(mCurrentItemMenu ); | 866 | mBeamAction->addTo(mCurrentItemMenu ); |
867 | connect( mBeamAction, SIGNAL( activated() ), | 867 | connect( mBeamAction, SIGNAL( activated() ), |
868 | mView, SLOT( beamIncidence() ) ); | 868 | mView, SLOT( beamIncidence() ) ); |
869 | #endif | 869 | #endif |
870 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 870 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
871 | mCancelAction->addTo( mCurrentItemMenu ); | 871 | mCancelAction->addTo( mCurrentItemMenu ); |
872 | connect( mCancelAction, SIGNAL( activated() ), | 872 | connect( mCancelAction, SIGNAL( activated() ), |
873 | mView, SLOT( toggleCancelIncidence() ) ); | 873 | mView, SLOT( toggleCancelIncidence() ) ); |
874 | 874 | ||
875 | 875 | ||
876 | mCurrentItemMenu->insertSeparator(); | 876 | mCurrentItemMenu->insertSeparator(); |
877 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 877 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
878 | action->addTo( mCurrentItemMenu ); | 878 | action->addTo( mCurrentItemMenu ); |
879 | connect( action, SIGNAL( activated() ), | 879 | connect( action, SIGNAL( activated() ), |
880 | mView, SLOT( undo_delete() ) ); | 880 | mView, SLOT( undo_delete() ) ); |
881 | 881 | ||
882 | // *********************** | 882 | // *********************** |
883 | if ( KOPrefs::instance()->mVerticalScreen ) { | 883 | if ( KOPrefs::instance()->mVerticalScreen ) { |
884 | icon = SmallIcon( "1updownarrow" ); | 884 | icon = SmallIcon( "1updownarrow" ); |
885 | } else { | 885 | } else { |
886 | icon = SmallIcon("1leftrightarrow" ); | 886 | icon = SmallIcon("1leftrightarrow" ); |
887 | } | 887 | } |
888 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 888 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
889 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 889 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
890 | FSaction->addTo( viewMenu ); | 890 | FSaction->addTo( viewMenu ); |
891 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 891 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
892 | 892 | ||
893 | 893 | ||
894 | icon = loadPixmap( pathString + "filter" ); | 894 | icon = loadPixmap( pathString + "filter" ); |
895 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 895 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
896 | icon = loadPixmap( pathString + "configure" ); | 896 | icon = loadPixmap( pathString + "configure" ); |
897 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 897 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
898 | action->addTo( viewMenu ); | 898 | action->addTo( viewMenu ); |
899 | connect( action, SIGNAL( activated() ), | 899 | connect( action, SIGNAL( activated() ), |
900 | mView, SLOT( toggleFilter() ) ); | 900 | mView, SLOT( toggleFilter() ) ); |
901 | mToggleFilter = action; | 901 | mToggleFilter = action; |
902 | icon = loadPixmap( pathString + "navi" ); | 902 | icon = loadPixmap( pathString + "navi" ); |
903 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 903 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
904 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 904 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
905 | action->addTo( viewMenu ); | 905 | action->addTo( viewMenu ); |
906 | connect( action, SIGNAL( activated() ), | 906 | connect( action, SIGNAL( activated() ), |
907 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 907 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
908 | mToggleNav = action ; | 908 | mToggleNav = action ; |
909 | icon = loadPixmap( pathString + "allday" ); | 909 | icon = loadPixmap( pathString + "allday" ); |
910 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 910 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
911 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 911 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
912 | action->addTo( viewMenu ); | 912 | action->addTo( viewMenu ); |
913 | connect( action, SIGNAL( activated() ), | 913 | connect( action, SIGNAL( activated() ), |
914 | mView, SLOT( toggleAllDaySize() ) ); | 914 | mView, SLOT( toggleAllDaySize() ) ); |
915 | mToggleAllday = action; | 915 | mToggleAllday = action; |
916 | 916 | ||
917 | 917 | ||
918 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 918 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
919 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 919 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
920 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 920 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
921 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 921 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
922 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 922 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
923 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 923 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
924 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 924 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
925 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 925 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
926 | 926 | ||
927 | 927 | ||
928 | dPickerAction->addTo( iconToolBar ); | 928 | dPickerAction->addTo( iconToolBar ); |
929 | viewMenu->insertSeparator(); | 929 | viewMenu->insertSeparator(); |
930 | 930 | ||
931 | if ( p-> mShowIconToggleFull ) | 931 | if ( p-> mShowIconToggleFull ) |
932 | FSaction->addTo( iconToolBar ); | 932 | FSaction->addTo( iconToolBar ); |
933 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 933 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
934 | 934 | ||
935 | //******************** | 935 | //******************** |
936 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 936 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
937 | 937 | ||
938 | 938 | ||
939 | icon = loadPixmap( pathString + "whatsnext" ); | 939 | icon = loadPixmap( pathString + "whatsnext" ); |
940 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 940 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
941 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 941 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
942 | whatsnext_action->addTo( viewMenu ); | 942 | whatsnext_action->addTo( viewMenu ); |
943 | connect( whatsnext_action, SIGNAL( activated() ), | 943 | connect( whatsnext_action, SIGNAL( activated() ), |
944 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 944 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
945 | 945 | ||
946 | icon = loadPixmap( pathString + "xdays" ); | 946 | icon = loadPixmap( pathString + "xdays" ); |
947 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 947 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
948 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 948 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
949 | xdays_action->addTo( viewMenu ); | 949 | xdays_action->addTo( viewMenu ); |
950 | connect( xdays_action, SIGNAL( activated() ), | 950 | connect( xdays_action, SIGNAL( activated() ), |
951 | mView->viewManager(), SLOT( showNextXView() ) ); | 951 | mView->viewManager(), SLOT( showNextXView() ) ); |
952 | 952 | ||
953 | 953 | ||
954 | icon = loadPixmap( pathString + "journal" ); | 954 | icon = loadPixmap( pathString + "journal" ); |
955 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 955 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
956 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 956 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
957 | viewjournal_action->addTo( viewMenu ); | 957 | viewjournal_action->addTo( viewMenu ); |
958 | connect( viewjournal_action, SIGNAL( activated() ), | 958 | connect( viewjournal_action, SIGNAL( activated() ), |
959 | mView->viewManager(), SLOT( showJournalView() ) ); | 959 | mView->viewManager(), SLOT( showJournalView() ) ); |
960 | 960 | ||
961 | 961 | ||
962 | icon = loadPixmap( pathString + "day" ); | 962 | icon = loadPixmap( pathString + "day" ); |
963 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 963 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
964 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 964 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
965 | day1_action->addTo( viewMenu ); | 965 | day1_action->addTo( viewMenu ); |
966 | // action->addTo( toolBar ); | 966 | // action->addTo( toolBar ); |
967 | connect( day1_action, SIGNAL( activated() ), | 967 | connect( day1_action, SIGNAL( activated() ), |
968 | mView->viewManager(), SLOT( showDayView() ) ); | 968 | mView->viewManager(), SLOT( showDayView() ) ); |
969 | 969 | ||
970 | icon = loadPixmap( pathString + "workweek" ); | 970 | icon = loadPixmap( pathString + "workweek" ); |
971 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 971 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
972 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 972 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
973 | day5_action->addTo( viewMenu ); | 973 | day5_action->addTo( viewMenu ); |
974 | connect( day5_action, SIGNAL( activated() ), | 974 | connect( day5_action, SIGNAL( activated() ), |
975 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 975 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
976 | 976 | ||
977 | icon = loadPixmap( pathString + "week" ); | 977 | icon = loadPixmap( pathString + "week" ); |
978 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 978 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
979 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 979 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
980 | day7_action->addTo( viewMenu ); | 980 | day7_action->addTo( viewMenu ); |
981 | connect( day7_action, SIGNAL( activated() ), | 981 | connect( day7_action, SIGNAL( activated() ), |
982 | mView->viewManager(), SLOT( showWeekView() ) ); | 982 | mView->viewManager(), SLOT( showWeekView() ) ); |
983 | 983 | ||
984 | icon = loadPixmap( pathString + "workweek2" ); | 984 | icon = loadPixmap( pathString + "workweek2" ); |
985 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 985 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
986 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 986 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
987 | day6_action->addTo( viewMenu ); | 987 | day6_action->addTo( viewMenu ); |
988 | connect( day6_action, SIGNAL( activated() ), | 988 | connect( day6_action, SIGNAL( activated() ), |
989 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 989 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
990 | 990 | ||
991 | icon = loadPixmap( pathString + "month" ); | 991 | icon = loadPixmap( pathString + "month" ); |
992 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 992 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
993 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 993 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
994 | month_action->addTo( viewMenu ); | 994 | month_action->addTo( viewMenu ); |
995 | connect( month_action, SIGNAL( activated() ), | 995 | connect( month_action, SIGNAL( activated() ), |
996 | mView->viewManager(), SLOT( showMonthView() ) ); | 996 | mView->viewManager(), SLOT( showMonthView() ) ); |
997 | 997 | ||
998 | icon = loadPixmap( pathString + "list" ); | 998 | icon = loadPixmap( pathString + "list" ); |
999 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 999 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
1000 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 1000 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
1001 | showlist_action->addTo( viewMenu ); | 1001 | showlist_action->addTo( viewMenu ); |
1002 | connect( showlist_action, SIGNAL( activated() ), | 1002 | connect( showlist_action, SIGNAL( activated() ), |
1003 | mView->viewManager(), SLOT( showListView() ) ); | 1003 | mView->viewManager(), SLOT( showListView() ) ); |
1004 | 1004 | ||
1005 | icon = loadPixmap( pathString + "todo" ); | 1005 | icon = loadPixmap( pathString + "todo" ); |
1006 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 1006 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
1007 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 1007 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
1008 | todoview_action->addTo( viewMenu ); | 1008 | todoview_action->addTo( viewMenu ); |
1009 | connect( todoview_action, SIGNAL( activated() ), | 1009 | connect( todoview_action, SIGNAL( activated() ), |
1010 | mView->viewManager(), SLOT( showTodoView() ) ); | 1010 | mView->viewManager(), SLOT( showTodoView() ) ); |
1011 | 1011 | ||
1012 | 1012 | ||
1013 | 1013 | ||
1014 | #if 0 | 1014 | #if 0 |
1015 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 1015 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
1016 | action->addTo( viewMenu ); | 1016 | action->addTo( viewMenu ); |
1017 | connect( action, SIGNAL( activated() ), | 1017 | connect( action, SIGNAL( activated() ), |
1018 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 1018 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
1019 | #endif | 1019 | #endif |
1020 | 1020 | ||
1021 | 1021 | ||
1022 | 1022 | ||
1023 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, | 1023 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, |
1024 | this ); | 1024 | this ); |
1025 | action->addTo( actionMenu ); | 1025 | action->addTo( actionMenu ); |
1026 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1026 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
1027 | 1027 | ||
1028 | 1028 | ||
1029 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1029 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
1030 | 1030 | ||
1031 | 1031 | ||
1032 | 1032 | ||
1033 | actionMenu->insertSeparator(); | 1033 | actionMenu->insertSeparator(); |
1034 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | 1034 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, |
1035 | this ); | 1035 | this ); |
1036 | action->addTo( actionMenu ); | 1036 | action->addTo( actionMenu ); |
1037 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); | 1037 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1038 | 1038 | ||
1039 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1039 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1040 | this ); | 1040 | this ); |
1041 | action->addTo( actionMenu ); | 1041 | action->addTo( actionMenu ); |
1042 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1042 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1043 | 1043 | ||
1044 | 1044 | ||
1045 | actionMenu->insertSeparator(); | 1045 | actionMenu->insertSeparator(); |
1046 | icon = loadPixmap( pathString + "configure" ); | 1046 | icon = loadPixmap( pathString + "configure" ); |
1047 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 1047 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
1048 | action->addTo( actionMenu ); | 1048 | action->addTo( actionMenu ); |
1049 | connect( action, SIGNAL( activated() ), | 1049 | connect( action, SIGNAL( activated() ), |
1050 | mView, SLOT( edit_options() ) ); | 1050 | mView, SLOT( edit_options() ) ); |
1051 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); | 1051 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); |
1052 | action->addTo( actionMenu ); | 1052 | action->addTo( actionMenu ); |
1053 | connect( action, SIGNAL( activated() ), | 1053 | connect( action, SIGNAL( activated() ), |
1054 | this, SLOT( calHint() ) ); | 1054 | this, SLOT( calHint() ) ); |
1055 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 1055 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
1056 | action->addTo( actionMenu ); | 1056 | action->addTo( actionMenu ); |
1057 | connect( action, SIGNAL( activated() ), | 1057 | connect( action, SIGNAL( activated() ), |
1058 | mView, SLOT( edit_global_options() ) ); | 1058 | mView, SLOT( edit_global_options() ) ); |
1059 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1059 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1060 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1060 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
1061 | 1061 | ||
1062 | } | 1062 | } |
1063 | // actionMenu->insertSeparator(); | 1063 | // actionMenu->insertSeparator(); |
1064 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 1064 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
1065 | this ); | 1065 | this ); |
1066 | action->addTo( importMenu_X ); | 1066 | action->addTo( importMenu_X ); |
1067 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 1067 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
1068 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 1068 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
1069 | this ); | 1069 | this ); |
1070 | action->addTo( importMenu_X ); | 1070 | action->addTo( importMenu_X ); |
1071 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 1071 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
1072 | importMenu_X->insertSeparator(); | 1072 | importMenu_X->insertSeparator(); |
1073 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 1073 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
1074 | this ); | 1074 | this ); |
1075 | action->addTo( importMenu_X ); | 1075 | action->addTo( importMenu_X ); |
1076 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 1076 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
1077 | //#ifndef DESKTOP_VERSION | 1077 | //#ifndef DESKTOP_VERSION |
1078 | importMenu_X->insertSeparator(); | 1078 | importMenu_X->insertSeparator(); |
1079 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 1079 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
1080 | this ); | 1080 | this ); |
1081 | action->addTo( importMenu_X ); | 1081 | action->addTo( importMenu_X ); |
1082 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 1082 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
1083 | //#else | 1083 | //#else |
1084 | #ifdef _OL_IMPORT_ | 1084 | #ifdef _OL_IMPORT_ |
1085 | importMenu_X->insertSeparator(); | 1085 | importMenu_X->insertSeparator(); |
1086 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 1086 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
1087 | this ); | 1087 | this ); |
1088 | action->addTo( importMenu_X ); | 1088 | action->addTo( importMenu_X ); |
1089 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 1089 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
1090 | #endif | 1090 | #endif |
1091 | //#endif | 1091 | //#endif |
1092 | 1092 | ||
1093 | //importMenu->insertSeparator(); | 1093 | //importMenu->insertSeparator(); |
1094 | #if 0 | 1094 | #if 0 |
1095 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 1095 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
1096 | this ); | 1096 | this ); |
1097 | action->addTo( importMenu ); | 1097 | action->addTo( importMenu ); |
1098 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 1098 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
1099 | #endif | 1099 | #endif |
1100 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, | 1100 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, |
1101 | this ); | 1101 | this ); |
1102 | action->addTo( importMenu ); | 1102 | action->addTo( importMenu ); |
1103 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 1103 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
1104 | importMenu->insertSeparator(); | 1104 | importMenu->insertSeparator(); |
1105 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 1105 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
1106 | //importMenu->insertSeparator(); | 1106 | //importMenu->insertSeparator(); |
1107 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 1107 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
1108 | this ); | 1108 | this ); |
1109 | action->addTo( exportMenu_X ); | 1109 | action->addTo( exportMenu_X ); |
1110 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 1110 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
1111 | 1111 | ||
1112 | 1112 | ||
1113 | //LR | 1113 | //LR |
1114 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 1114 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
1115 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1115 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1116 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1116 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1117 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 1117 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
1118 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 1118 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
1119 | 1119 | ||
1120 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 1120 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
1121 | mPrintSelAction = 0; | ||
1121 | #ifndef DESKTOP_VERSION | 1122 | #ifndef DESKTOP_VERSION |
1122 | //importMenu->insertSeparator(); | 1123 | //importMenu->insertSeparator(); |
1123 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 1124 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
1124 | this ); | 1125 | this ); |
1125 | brAction->addTo( beamMenu_X ); | 1126 | brAction->addTo( beamMenu_X ); |
1126 | brAction->setToggleAction (true ) ; | 1127 | brAction->setToggleAction (true ) ; |
1127 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 1128 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
1128 | 1129 | ||
1129 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 1130 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
1130 | this ); | 1131 | this ); |
1131 | action->addTo( beamMenu_X ); | 1132 | action->addTo( beamMenu_X ); |
1132 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 1133 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
1133 | 1134 | ||
1134 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 1135 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
1135 | this ); | 1136 | this ); |
1136 | action->addTo( beamMenu_X ); | 1137 | action->addTo( beamMenu_X ); |
1137 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 1138 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
1138 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 1139 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
1139 | #else | 1140 | #else |
1140 | //importMenu->insertSeparator(); | 1141 | //importMenu->insertSeparator(); |
1141 | icon = loadPixmap( pathString + "print" ); | 1142 | icon = loadPixmap( pathString + "print" ); |
1142 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 1143 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
1143 | action->addTo( beamMenu_X ); | 1144 | action->addTo( beamMenu_X ); |
1144 | connect( action, SIGNAL( activated() ), | 1145 | connect( action, SIGNAL( activated() ), |
1145 | this, SLOT( printCal() ) ); | 1146 | this, SLOT( printCal() ) ); |
1146 | 1147 | ||
1147 | icon = loadPixmap( pathString + "print" ); | 1148 | icon = loadPixmap( pathString + "week" ); |
1148 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 1149 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
1149 | action->addTo( beamMenu_X ); | 1150 | action->addTo( beamMenu_X ); |
1150 | connect( action, SIGNAL( activated() ), | 1151 | connect( action, SIGNAL( activated() ), |
1151 | this, SLOT( printSel() ) ); | 1152 | this, SLOT( printSel() ) ); |
1153 | icon = loadPixmap( pathString + "whatsnext" ); | ||
1152 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 1154 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
1153 | action->addTo( beamMenu_X ); | 1155 | action->addTo( beamMenu_X ); |
1154 | connect( action, SIGNAL( activated() ), | 1156 | connect( action, SIGNAL( activated() ), |
1155 | mView->viewManager(), SLOT( slotprintWNV() ) ); | 1157 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1156 | 1158 | ||
1157 | 1159 | ||
1158 | icon = loadPixmap( pathString + "print" ); | 1160 | icon = loadPixmap( pathString + "list" ); |
1159 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); | 1161 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); |
1160 | action->addTo( beamMenu_X ); | 1162 | action->addTo( beamMenu_X ); |
1161 | connect( action, SIGNAL( activated() ), | 1163 | connect( action, SIGNAL( activated() ), |
1162 | this, SLOT( printListView() ) ); | 1164 | this, SLOT( printListView() ) ); |
1163 | 1165 | ||
1166 | icon = loadPixmap( pathString + "newevent" ); | ||
1164 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | 1167 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); |
1165 | action->addTo( beamMenu_X ); | 1168 | action->addTo( beamMenu_X ); |
1166 | connect( action, SIGNAL( activated() ), | 1169 | connect( action, SIGNAL( activated() ), |
1167 | mView, SLOT( slotprintSelInc() ) ); | 1170 | mView, SLOT( slotprintSelInc() ) ); |
1168 | 1171 | mPrintSelAction = action; | |
1169 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1172 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
1170 | #endif | 1173 | #endif |
1171 | 1174 | ||
1172 | importMenu->insertSeparator(); | 1175 | importMenu->insertSeparator(); |
1173 | action = new QAction( "beam all", i18n("Save"), 0, | 1176 | action = new QAction( "beam all", i18n("Save"), 0, |
1174 | this ); | 1177 | this ); |
1175 | action->addTo( importMenu ); | 1178 | action->addTo( importMenu ); |
1176 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1179 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1177 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1180 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
1178 | this ); | 1181 | this ); |
1179 | action->addTo( importMenu ); | 1182 | action->addTo( importMenu ); |
1180 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1183 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1181 | 1184 | ||
1182 | //menuBar->insertItem( "Configure",configureMenu ); | 1185 | //menuBar->insertItem( "Configure",configureMenu ); |
1183 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1186 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1184 | icon = loadPixmap( "korganizer/korganizer" ); | 1187 | icon = loadPixmap( "korganizer/korganizer" ); |
1185 | 1188 | ||
1186 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1189 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
1187 | action->addTo( helpMenu ); | 1190 | action->addTo( helpMenu ); |
1188 | connect( action, SIGNAL( activated() ), | 1191 | connect( action, SIGNAL( activated() ), |
1189 | SLOT( whatsNew() ) ); | 1192 | SLOT( whatsNew() ) ); |
1190 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1193 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
1191 | action->addTo( helpMenu ); | 1194 | action->addTo( helpMenu ); |
1192 | connect( action, SIGNAL( activated() ), | 1195 | connect( action, SIGNAL( activated() ), |
1193 | SLOT( features() ) ); | 1196 | SLOT( features() ) ); |
1194 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1197 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1195 | action->addTo( helpMenu ); | 1198 | action->addTo( helpMenu ); |
1196 | connect( action, SIGNAL( activated() ), | 1199 | connect( action, SIGNAL( activated() ), |
1197 | SLOT( keyBindings() ) ); | 1200 | SLOT( keyBindings() ) ); |
1198 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); | 1201 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); |
1199 | action->addTo( helpMenu ); | 1202 | action->addTo( helpMenu ); |
1200 | connect( action, SIGNAL( activated() ), | 1203 | connect( action, SIGNAL( activated() ), |
1201 | SLOT( storagehowto() ) ); | 1204 | SLOT( storagehowto() ) ); |
1202 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); | 1205 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); |
1203 | action->addTo( helpMenu ); | 1206 | action->addTo( helpMenu ); |
1204 | connect( action, SIGNAL( activated() ), | 1207 | connect( action, SIGNAL( activated() ), |
1205 | SLOT( timetrackinghowto() ) ); | 1208 | SLOT( timetrackinghowto() ) ); |
1206 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1209 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1207 | action->addTo( helpMenu ); | 1210 | action->addTo( helpMenu ); |
1208 | connect( action, SIGNAL( activated() ), | 1211 | connect( action, SIGNAL( activated() ), |
1209 | SLOT( synchowto() ) ); | 1212 | SLOT( synchowto() ) ); |
1210 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1213 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1211 | action->addTo( helpMenu ); | 1214 | action->addTo( helpMenu ); |
1212 | connect( action, SIGNAL( activated() ), | 1215 | connect( action, SIGNAL( activated() ), |
1213 | SLOT( kdesynchowto() ) ); | 1216 | SLOT( kdesynchowto() ) ); |
1214 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1217 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1215 | action->addTo( helpMenu ); | 1218 | action->addTo( helpMenu ); |
1216 | connect( action, SIGNAL( activated() ), | 1219 | connect( action, SIGNAL( activated() ), |
1217 | SLOT( multisynchowto() ) ); | 1220 | SLOT( multisynchowto() ) ); |
1218 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1221 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
1219 | action->addTo( helpMenu ); | 1222 | action->addTo( helpMenu ); |
1220 | connect( action, SIGNAL( activated() ), | 1223 | connect( action, SIGNAL( activated() ), |
1221 | SLOT( aboutAutoSaving() ) ); | 1224 | SLOT( aboutAutoSaving() ) ); |
1222 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 1225 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
1223 | action->addTo( helpMenu ); | 1226 | action->addTo( helpMenu ); |
1224 | connect( action, SIGNAL( activated() ), | 1227 | connect( action, SIGNAL( activated() ), |
1225 | SLOT( aboutKnownBugs() ) ); | 1228 | SLOT( aboutKnownBugs() ) ); |
1226 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1229 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
1227 | action->addTo( helpMenu ); | 1230 | action->addTo( helpMenu ); |
1228 | connect( action, SIGNAL( activated() ), | 1231 | connect( action, SIGNAL( activated() ), |
1229 | SLOT( usertrans() ) ); | 1232 | SLOT( usertrans() ) ); |
1230 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1233 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1231 | action->addTo( helpMenu ); | 1234 | action->addTo( helpMenu ); |
1232 | connect( action, SIGNAL( activated() ), | 1235 | connect( action, SIGNAL( activated() ), |
1233 | SLOT( faq() ) ); | 1236 | SLOT( faq() ) ); |
1234 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1237 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
1235 | action->addTo( helpMenu ); | 1238 | action->addTo( helpMenu ); |
1236 | connect( action, SIGNAL( activated() ), | 1239 | connect( action, SIGNAL( activated() ), |
1237 | SLOT( licence() ) ); | 1240 | SLOT( licence() ) ); |
1238 | action = new QAction( "about", i18n("About..."), 0, this ); | 1241 | action = new QAction( "about", i18n("About..."), 0, this ); |
1239 | action->addTo( helpMenu ); | 1242 | action->addTo( helpMenu ); |
1240 | connect( action, SIGNAL( activated() ), | 1243 | connect( action, SIGNAL( activated() ), |
1241 | SLOT( about() ) ); | 1244 | SLOT( about() ) ); |
1242 | //menuBar->insertSeparator(); | 1245 | //menuBar->insertSeparator(); |
1243 | 1246 | ||
1244 | // ****************************************************** | 1247 | // ****************************************************** |
1245 | // menubar icons | 1248 | // menubar icons |
1246 | 1249 | ||
1247 | 1250 | ||
1248 | 1251 | ||
1249 | //menuBar->insertItem( iconToolBar ); | 1252 | //menuBar->insertItem( iconToolBar ); |
1250 | //xdays_action | 1253 | //xdays_action |
1251 | if (p-> mShowIconNewEvent) | 1254 | if (p-> mShowIconNewEvent) |
1252 | ne_action->addTo( iconToolBar ); | 1255 | ne_action->addTo( iconToolBar ); |
1253 | if (p->mShowIconNewTodo ) | 1256 | if (p->mShowIconNewTodo ) |
1254 | nt_action->addTo( iconToolBar ); | 1257 | nt_action->addTo( iconToolBar ); |
1255 | if (p-> mShowIconSearch) | 1258 | if (p-> mShowIconSearch) |
1256 | search_action->addTo( iconToolBar ); | 1259 | search_action->addTo( iconToolBar ); |
1257 | if (p-> mShowIconWhatsThis) | 1260 | if (p-> mShowIconWhatsThis) |
1258 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1261 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1259 | if (p-> mShowIconNext) | 1262 | if (p-> mShowIconNext) |
1260 | whatsnext_action->addTo( viewToolBar ); | 1263 | whatsnext_action->addTo( viewToolBar ); |
1261 | if (p-> mShowIconNextDays) | 1264 | if (p-> mShowIconNextDays) |
1262 | xdays_action->addTo( viewToolBar ); | 1265 | xdays_action->addTo( viewToolBar ); |
1263 | if (p-> mShowIconJournal) | 1266 | if (p-> mShowIconJournal) |
1264 | viewjournal_action->addTo( viewToolBar ); | 1267 | viewjournal_action->addTo( viewToolBar ); |
1265 | if (p-> mShowIconDay1) | 1268 | if (p-> mShowIconDay1) |
1266 | day1_action->addTo( viewToolBar ); | 1269 | day1_action->addTo( viewToolBar ); |
1267 | if (p-> mShowIconDay5) | 1270 | if (p-> mShowIconDay5) |
1268 | day5_action->addTo( viewToolBar ); | 1271 | day5_action->addTo( viewToolBar ); |
1269 | if (p-> mShowIconDay7) | 1272 | if (p-> mShowIconDay7) |
1270 | day7_action->addTo( viewToolBar ); | 1273 | day7_action->addTo( viewToolBar ); |
1271 | if (p-> mShowIconDay6) | 1274 | if (p-> mShowIconDay6) |
1272 | day6_action->addTo( viewToolBar ); | 1275 | day6_action->addTo( viewToolBar ); |
1273 | if (p-> mShowIconMonth) | 1276 | if (p-> mShowIconMonth) |
1274 | month_action->addTo( viewToolBar ); | 1277 | month_action->addTo( viewToolBar ); |
1275 | if (p-> mShowIconList) | 1278 | if (p-> mShowIconList) |
1276 | showlist_action->addTo( viewToolBar ); | 1279 | showlist_action->addTo( viewToolBar ); |
1277 | if (p-> mShowIconTodoview) | 1280 | if (p-> mShowIconTodoview) |
1278 | todoview_action->addTo( viewToolBar ); | 1281 | todoview_action->addTo( viewToolBar ); |
1279 | 1282 | ||
1280 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1283 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1281 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1284 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1282 | if (p-> mShowIconBackFast) { | 1285 | if (p-> mShowIconBackFast) { |
1283 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1286 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1284 | connect( action, SIGNAL( activated() ), | 1287 | connect( action, SIGNAL( activated() ), |
1285 | mView, SLOT( goPreviousMonth() ) ); | 1288 | mView, SLOT( goPreviousMonth() ) ); |
1286 | action->addTo( navigatorToolBar ); | 1289 | action->addTo( navigatorToolBar ); |
1287 | } | 1290 | } |
1288 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1291 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1289 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1292 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1290 | if (p-> mShowIconBack) { | 1293 | if (p-> mShowIconBack) { |
1291 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1294 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1292 | connect( action, SIGNAL( activated() ), | 1295 | connect( action, SIGNAL( activated() ), |
1293 | mView, SLOT( goPrevious() ) ); | 1296 | mView, SLOT( goPrevious() ) ); |
1294 | action->addTo( navigatorToolBar ); | 1297 | action->addTo( navigatorToolBar ); |
1295 | } | 1298 | } |
1296 | icon = loadPixmap( pathString + "today" ); | 1299 | icon = loadPixmap( pathString + "today" ); |
1297 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1300 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1298 | if (p-> mShowIconToday) | 1301 | if (p-> mShowIconToday) |
1299 | today_action->addTo( navigatorToolBar ); | 1302 | today_action->addTo( navigatorToolBar ); |
1300 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1303 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1301 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1304 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1302 | if (p-> mShowIconForward) { | 1305 | if (p-> mShowIconForward) { |
1303 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1306 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1304 | connect( action, SIGNAL( activated() ), | 1307 | connect( action, SIGNAL( activated() ), |
1305 | mView, SLOT( goNext() ) ); | 1308 | mView, SLOT( goNext() ) ); |
1306 | action->addTo( navigatorToolBar ); | 1309 | action->addTo( navigatorToolBar ); |
1307 | } | 1310 | } |
1308 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1311 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1309 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1312 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1310 | if (p-> mShowIconForwardFast) { | 1313 | if (p-> mShowIconForwardFast) { |
1311 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1314 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1312 | connect( action, SIGNAL( activated() ), | 1315 | connect( action, SIGNAL( activated() ), |
1313 | mView, SLOT( goNextMonth() ) ); | 1316 | mView, SLOT( goNextMonth() ) ); |
1314 | action->addTo( navigatorToolBar ); | 1317 | action->addTo( navigatorToolBar ); |
1315 | } | 1318 | } |
1316 | 1319 | ||
1317 | 1320 | ||
1318 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1321 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1319 | 1322 | ||
1320 | 1323 | ||
1321 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); | 1324 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); |
1322 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); | 1325 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); |
1323 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); | 1326 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); |
1324 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); | 1327 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); |
1325 | 1328 | ||
1326 | if (p-> mShowIconNewEvent) | 1329 | if (p-> mShowIconNewEvent) |
1327 | configureToolBarMenu->setItemChecked( 10, true ); | 1330 | configureToolBarMenu->setItemChecked( 10, true ); |
1328 | if (p->mShowIconNewTodo ) | 1331 | if (p->mShowIconNewTodo ) |
1329 | configureToolBarMenu->setItemChecked( 20, true ); | 1332 | configureToolBarMenu->setItemChecked( 20, true ); |
1330 | if (p-> mShowIconSearch) | 1333 | if (p-> mShowIconSearch) |
1331 | configureToolBarMenu->setItemChecked( 120, true ); | 1334 | configureToolBarMenu->setItemChecked( 120, true ); |
1332 | if (p-> mShowIconList) | 1335 | if (p-> mShowIconList) |
1333 | configureToolBarMenu->setItemChecked( 30, true ); | 1336 | configureToolBarMenu->setItemChecked( 30, true ); |
1334 | if (p-> mShowIconDay1) | 1337 | if (p-> mShowIconDay1) |
1335 | configureToolBarMenu->setItemChecked( 40, true ); | 1338 | configureToolBarMenu->setItemChecked( 40, true ); |
1336 | if (p-> mShowIconDay5) | 1339 | if (p-> mShowIconDay5) |
1337 | configureToolBarMenu->setItemChecked( 50, true ); | 1340 | configureToolBarMenu->setItemChecked( 50, true ); |
1338 | if (p-> mShowIconDay6) | 1341 | if (p-> mShowIconDay6) |
1339 | configureToolBarMenu->setItemChecked( 75, true ); | 1342 | configureToolBarMenu->setItemChecked( 75, true ); |
1340 | if (p-> mShowIconDay7) | 1343 | if (p-> mShowIconDay7) |
1341 | configureToolBarMenu->setItemChecked( 60, true ); | 1344 | configureToolBarMenu->setItemChecked( 60, true ); |
1342 | if (p-> mShowIconMonth) | 1345 | if (p-> mShowIconMonth) |
1343 | configureToolBarMenu->setItemChecked( 70, true ); | 1346 | configureToolBarMenu->setItemChecked( 70, true ); |
1344 | if (p-> mShowIconTodoview) | 1347 | if (p-> mShowIconTodoview) |
1345 | configureToolBarMenu->setItemChecked( 80, true ); | 1348 | configureToolBarMenu->setItemChecked( 80, true ); |
1346 | if (p-> mShowIconBackFast) | 1349 | if (p-> mShowIconBackFast) |
1347 | configureToolBarMenu->setItemChecked( 200, true ); | 1350 | configureToolBarMenu->setItemChecked( 200, true ); |
1348 | if (p-> mShowIconBack) | 1351 | if (p-> mShowIconBack) |
1349 | configureToolBarMenu->setItemChecked( 210, true ); | 1352 | configureToolBarMenu->setItemChecked( 210, true ); |
1350 | if (p-> mShowIconToday) | 1353 | if (p-> mShowIconToday) |
1351 | configureToolBarMenu->setItemChecked( 130, true ); | 1354 | configureToolBarMenu->setItemChecked( 130, true ); |
1352 | if (p-> mShowIconForward) | 1355 | if (p-> mShowIconForward) |
1353 | configureToolBarMenu->setItemChecked( 220, true ); | 1356 | configureToolBarMenu->setItemChecked( 220, true ); |
1354 | if (p-> mShowIconForwardFast) | 1357 | if (p-> mShowIconForwardFast) |
1355 | configureToolBarMenu->setItemChecked( 230, true ); | 1358 | configureToolBarMenu->setItemChecked( 230, true ); |
1356 | if (p-> mShowIconNextDays) | 1359 | if (p-> mShowIconNextDays) |
1357 | configureToolBarMenu->setItemChecked( 100, true ); | 1360 | configureToolBarMenu->setItemChecked( 100, true ); |
1358 | if (p-> mShowIconNext) | 1361 | if (p-> mShowIconNext) |
1359 | configureToolBarMenu->setItemChecked( 110, true ); | 1362 | configureToolBarMenu->setItemChecked( 110, true ); |
1360 | if (p-> mShowIconJournal) | 1363 | if (p-> mShowIconJournal) |
1361 | configureToolBarMenu->setItemChecked( 90, true ); | 1364 | configureToolBarMenu->setItemChecked( 90, true ); |
1362 | if (p-> mShowIconWhatsThis) | 1365 | if (p-> mShowIconWhatsThis) |
1363 | configureToolBarMenu->setItemChecked( 300, true ); | 1366 | configureToolBarMenu->setItemChecked( 300, true ); |
1364 | if (p-> mShowIconWeekNum) | 1367 | if (p-> mShowIconWeekNum) |
1365 | configureToolBarMenu->setItemChecked( 400, true ); | 1368 | configureToolBarMenu->setItemChecked( 400, true ); |
1366 | if (!p-> mShowIconStretch) { | 1369 | if (!p-> mShowIconStretch) { |
1367 | QLabel* dummy = new QLabel( iconToolBar ); | 1370 | QLabel* dummy = new QLabel( iconToolBar ); |
1368 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1371 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1369 | dummy->setMinimumWidth( 0 ); | 1372 | dummy->setMinimumWidth( 0 ); |
1370 | iconToolBar->setStretchableWidget ( dummy ) ; | 1373 | iconToolBar->setStretchableWidget ( dummy ) ; |
1371 | } | 1374 | } |
1372 | else { | 1375 | else { |
1373 | iconToolBar->setHorizontalStretchable (true ); | 1376 | iconToolBar->setHorizontalStretchable (true ); |
1374 | viewToolBar->setHorizontalStretchable (true ); | 1377 | viewToolBar->setHorizontalStretchable (true ); |
1375 | navigatorToolBar->setHorizontalStretchable (true ); | 1378 | navigatorToolBar->setHorizontalStretchable (true ); |
1376 | iconToolBar->setVerticalStretchable (true ); | 1379 | iconToolBar->setVerticalStretchable (true ); |
1377 | viewToolBar->setVerticalStretchable (true ); | 1380 | viewToolBar->setVerticalStretchable (true ); |
1378 | navigatorToolBar->setVerticalStretchable (true ); | 1381 | navigatorToolBar->setVerticalStretchable (true ); |
1379 | configureToolBarMenu->setItemChecked( 5, true ); | 1382 | configureToolBarMenu->setItemChecked( 5, true ); |
1380 | } | 1383 | } |
1381 | if (p-> mShowIconFilter) | 1384 | if (p-> mShowIconFilter) |
1382 | configureToolBarMenu->setItemChecked( 7, true ); | 1385 | configureToolBarMenu->setItemChecked( 7, true ); |
1383 | if (p-> mShowIconOnetoolbar) | 1386 | if (p-> mShowIconOnetoolbar) |
1384 | configureToolBarMenu->setItemChecked( 6, true ); | 1387 | configureToolBarMenu->setItemChecked( 6, true ); |
1385 | 1388 | ||
1386 | 1389 | ||
1387 | if ( filterMenubar ) { | 1390 | if ( filterMenubar ) { |
1388 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); | 1391 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); |
1389 | connect( mView, SIGNAL( filtersUpdated() ), SLOT( updateFilterToolbar() ) ); | 1392 | connect( mView, SIGNAL( filtersUpdated() ), SLOT( updateFilterToolbar() ) ); |
1390 | } | 1393 | } |
1391 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1394 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1392 | configureAgenda( p->mHourSize ); | 1395 | configureAgenda( p->mHourSize ); |
1393 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1396 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1394 | } | 1397 | } |
1395 | void MainWindow::calHint() | 1398 | void MainWindow::calHint() |
1396 | { | 1399 | { |
1397 | QString message = i18n("You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>."); | 1400 | QString message = i18n("You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>."); |
1398 | 1401 | ||
1399 | KMessageBox::information( this, message); | 1402 | KMessageBox::information( this, message); |
1400 | } | 1403 | } |
1401 | void MainWindow::exportToPhone( int mode ) | 1404 | void MainWindow::exportToPhone( int mode ) |
1402 | { | 1405 | { |
1403 | 1406 | ||
1404 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1407 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1405 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1408 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1406 | KOex2phonePrefs ex2phone; | 1409 | KOex2phonePrefs ex2phone; |
1407 | 1410 | ||
1408 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1411 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1409 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1412 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1410 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1413 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1411 | if ( mode == 1 ) | 1414 | if ( mode == 1 ) |
1412 | ex2phone.setCaption(i18n("Export complete calendar")); | 1415 | ex2phone.setCaption(i18n("Export complete calendar")); |
1413 | if ( mode == 2 ) | 1416 | if ( mode == 2 ) |
1414 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1417 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1415 | 1418 | ||
1416 | if ( !ex2phone.exec() ) { | 1419 | if ( !ex2phone.exec() ) { |
1417 | return; | 1420 | return; |
1418 | } | 1421 | } |
1419 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1422 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1420 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1423 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1421 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1424 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1422 | 1425 | ||
1423 | int inFuture = 0; | 1426 | int inFuture = 0; |
1424 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1427 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1425 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1428 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1426 | QPtrList<Incidence> delSel; | 1429 | QPtrList<Incidence> delSel; |
1427 | if ( mode == 1 ) | 1430 | if ( mode == 1 ) |
1428 | delSel = mCalendar->rawIncidences(); | 1431 | delSel = mCalendar->rawIncidences(); |
1429 | if ( mode == 2 ) | 1432 | if ( mode == 2 ) |
1430 | delSel = mCalendar->incidences(); | 1433 | delSel = mCalendar->incidences(); |
1431 | CalendarLocal* cal = new CalendarLocal(); | 1434 | CalendarLocal* cal = new CalendarLocal(); |
1432 | cal->setLocalTime(); | 1435 | cal->setLocalTime(); |
1433 | Incidence *incidence = delSel.first(); | 1436 | Incidence *incidence = delSel.first(); |
1434 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1437 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1435 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1438 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1436 | while ( incidence ) { | 1439 | while ( incidence ) { |
1437 | if ( incidence->typeID() != journalID ) { | 1440 | if ( incidence->typeID() != journalID ) { |
1438 | bool add = true; | 1441 | bool add = true; |
1439 | if ( inFuture ) { | 1442 | if ( inFuture ) { |
1440 | QDateTime dt; | 1443 | QDateTime dt; |
1441 | if ( incidence->typeID() == todoID ) { | 1444 | if ( incidence->typeID() == todoID ) { |
1442 | Todo * t = (Todo*)incidence; | 1445 | Todo * t = (Todo*)incidence; |
1443 | if ( t->hasDueDate() ) | 1446 | if ( t->hasDueDate() ) |
1444 | dt = t->dtDue(); | 1447 | dt = t->dtDue(); |
1445 | else | 1448 | else |
1446 | dt = cur.addSecs( 62 ); | 1449 | dt = cur.addSecs( 62 ); |
1447 | } | 1450 | } |
1448 | else { | 1451 | else { |
1449 | bool ok; | 1452 | bool ok; |
1450 | dt = incidence->getNextOccurence( cur, &ok ); | 1453 | dt = incidence->getNextOccurence( cur, &ok ); |
1451 | if ( !ok ) | 1454 | if ( !ok ) |
1452 | dt = cur.addSecs( -62 ); | 1455 | dt = cur.addSecs( -62 ); |
1453 | } | 1456 | } |
1454 | if ( dt < cur || dt > end ) { | 1457 | if ( dt < cur || dt > end ) { |
1455 | add = false; | 1458 | add = false; |
1456 | } | 1459 | } |
1457 | } | 1460 | } |
1458 | if ( add ) { | 1461 | if ( add ) { |
1459 | Incidence *in = incidence->clone(); | 1462 | Incidence *in = incidence->clone(); |
1460 | cal->addIncidence( in ); | 1463 | cal->addIncidence( in ); |
1461 | } | 1464 | } |
1462 | } | 1465 | } |
1463 | incidence = delSel.next(); | 1466 | incidence = delSel.next(); |
1464 | } | 1467 | } |
1465 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1468 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1466 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1469 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1467 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1470 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1468 | 1471 | ||
1469 | setCaption( i18n("Writing to phone...")); | 1472 | setCaption( i18n("Writing to phone...")); |
1470 | if ( PhoneFormat::writeToPhone( cal ) ) | 1473 | if ( PhoneFormat::writeToPhone( cal ) ) |
1471 | setCaption( i18n("Export to phone successful!")); | 1474 | setCaption( i18n("Export to phone successful!")); |
1472 | else | 1475 | else |
1473 | setCaption( i18n("Error exporting to phone!")); | 1476 | setCaption( i18n("Error exporting to phone!")); |
1474 | delete cal; | 1477 | delete cal; |
1475 | } | 1478 | } |
1476 | 1479 | ||
1477 | 1480 | ||
1478 | void MainWindow::setDefaultPreferences() | 1481 | void MainWindow::setDefaultPreferences() |
1479 | { | 1482 | { |
1480 | KOPrefs *p = KOPrefs::instance(); | 1483 | KOPrefs *p = KOPrefs::instance(); |
1481 | 1484 | ||
1482 | p->mCompactDialogs = true; | 1485 | p->mCompactDialogs = true; |
1483 | p->mConfirm = true; | 1486 | p->mConfirm = true; |
1484 | // p->mEnableQuickTodo = false; | 1487 | // p->mEnableQuickTodo = false; |
1485 | 1488 | ||
1486 | } | 1489 | } |
1487 | 1490 | ||
1488 | QString MainWindow::resourcePath() | 1491 | QString MainWindow::resourcePath() |
1489 | { | 1492 | { |
1490 | return KGlobal::iconLoader()->iconPath(); | 1493 | return KGlobal::iconLoader()->iconPath(); |
1491 | } | 1494 | } |
1492 | 1495 | ||
1493 | void MainWindow::displayText( QString text ,QString cap ) | 1496 | void MainWindow::displayText( QString text ,QString cap ) |
1494 | { | 1497 | { |
1495 | QDialog dia( this, "name", true ); ; | 1498 | QDialog dia( this, "name", true ); ; |
1496 | dia.setCaption( cap ); | 1499 | dia.setCaption( cap ); |
1497 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1500 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1498 | lay->setSpacing( 3 ); | 1501 | lay->setSpacing( 3 ); |
1499 | lay->setMargin( 3 ); | 1502 | lay->setMargin( 3 ); |
1500 | QTextBrowser tb ( &dia ); | 1503 | QTextBrowser tb ( &dia ); |
1501 | lay->addWidget( &tb ); | 1504 | lay->addWidget( &tb ); |
1502 | tb.setText( text ); | 1505 | tb.setText( text ); |
1503 | #ifdef DESKTOP_VERSION | 1506 | #ifdef DESKTOP_VERSION |
1504 | dia.resize( 640, 480); | 1507 | dia.resize( 640, 480); |
1505 | #else | 1508 | #else |
1506 | dia.showMaximized(); | 1509 | dia.showMaximized(); |
1507 | #endif | 1510 | #endif |
1508 | dia.exec(); | 1511 | dia.exec(); |
1509 | } | 1512 | } |
1510 | 1513 | ||
1511 | void MainWindow::features() | 1514 | void MainWindow::features() |
1512 | { | 1515 | { |
1513 | 1516 | ||
1514 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1517 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1515 | } | 1518 | } |
1516 | 1519 | ||
1517 | void MainWindow::usertrans() | 1520 | void MainWindow::usertrans() |
1518 | { | 1521 | { |
1519 | 1522 | ||
1520 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1523 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1521 | } | 1524 | } |
1522 | 1525 | ||
1523 | void MainWindow::storagehowto() | 1526 | void MainWindow::storagehowto() |
1524 | { | 1527 | { |
1525 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 1528 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
1526 | } | 1529 | } |
1527 | void MainWindow::timetrackinghowto() | 1530 | void MainWindow::timetrackinghowto() |
1528 | { | 1531 | { |
1529 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); | 1532 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); |
1530 | } | 1533 | } |
1531 | void MainWindow::kdesynchowto() | 1534 | void MainWindow::kdesynchowto() |
1532 | { | 1535 | { |
1533 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1536 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1534 | } | 1537 | } |
1535 | void MainWindow::multisynchowto() | 1538 | void MainWindow::multisynchowto() |
1536 | { | 1539 | { |
1537 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1540 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1538 | } | 1541 | } |
1539 | void MainWindow::synchowto() | 1542 | void MainWindow::synchowto() |
1540 | { | 1543 | { |
1541 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1544 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1542 | } | 1545 | } |
1543 | void MainWindow::faq() | 1546 | void MainWindow::faq() |
1544 | { | 1547 | { |
1545 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1548 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1546 | 1549 | ||
1547 | } | 1550 | } |
1548 | void MainWindow::whatsNew() | 1551 | void MainWindow::whatsNew() |
1549 | { | 1552 | { |
1550 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1553 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1551 | 1554 | ||
1552 | } | 1555 | } |
1553 | void MainWindow::licence() | 1556 | void MainWindow::licence() |
1554 | { | 1557 | { |
1555 | KApplication::showLicence(); | 1558 | KApplication::showLicence(); |
1556 | 1559 | ||
1557 | } | 1560 | } |
1558 | void MainWindow::about() | 1561 | void MainWindow::about() |
1559 | { | 1562 | { |
1560 | QString version; | 1563 | QString version; |
1561 | #include <../version> | 1564 | #include <../version> |
1562 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1565 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1563 | i18n("KOrganizer/Platform-independent\n") + | 1566 | i18n("KOrganizer/Platform-independent\n") + |
1564 | "(KO/Pi) " + version + " - " + | 1567 | "(KO/Pi) " + version + " - " + |
1565 | 1568 | ||
1566 | #ifdef DESKTOP_VERSION | 1569 | #ifdef DESKTOP_VERSION |
1567 | i18n("Desktop Edition\n") + | 1570 | i18n("Desktop Edition\n") + |
1568 | #else | 1571 | #else |
1569 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1572 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1570 | #endif | 1573 | #endif |
1571 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1574 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1572 | } | 1575 | } |
1573 | void MainWindow::keyBindings() | 1576 | void MainWindow::keyBindings() |
1574 | { | 1577 | { |
1575 | QString cap = i18n("KO/Pi Keys + Colors"); | 1578 | QString cap = i18n("KO/Pi Keys + Colors"); |
1576 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1579 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1577 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1580 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1578 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + | 1581 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + |
1579 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + | 1582 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + |
1580 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1583 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1581 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1584 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1582 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ | 1585 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ |
1583 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1586 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1584 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1587 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1585 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ | 1588 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ |
1586 | i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+ | 1589 | i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+ |
1587 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1590 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1588 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1591 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1589 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1592 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1590 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1593 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1591 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1594 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1592 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1595 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1593 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ | 1596 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ |
1594 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1597 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1595 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1598 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1596 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1599 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1597 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1600 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1598 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1601 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1599 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1602 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1600 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1603 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1601 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1604 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1602 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1605 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1603 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1606 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1604 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1607 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1605 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1608 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1606 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1609 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1607 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1610 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1608 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1611 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1609 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1612 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1610 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1613 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1611 | i18n("<p><h3>In list view:</h3></p>\n") + | 1614 | i18n("<p><h3>In list view:</h3></p>\n") + |
1612 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1615 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1613 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1616 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1614 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1617 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1615 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1618 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1616 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1619 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1617 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1620 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1618 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1621 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1619 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1622 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1620 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1623 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1621 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1624 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1622 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1625 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1623 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1626 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1624 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1627 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1625 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1628 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1626 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1629 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1627 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1630 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1628 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1631 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1629 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1632 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1630 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1633 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1631 | displayText( text, cap); | 1634 | displayText( text, cap); |
1632 | } | 1635 | } |
1633 | void MainWindow::aboutAutoSaving() | 1636 | void MainWindow::aboutAutoSaving() |
1634 | { | 1637 | { |
1635 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) 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"); | 1638 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) 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"); |
1636 | 1639 | ||
1637 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1640 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1638 | 1641 | ||
1639 | } | 1642 | } |
1640 | void MainWindow::aboutKnownBugs() | 1643 | void MainWindow::aboutKnownBugs() |
1641 | { | 1644 | { |
1642 | QMessageBox* msg; | 1645 | QMessageBox* msg; |
1643 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1646 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1644 | 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")+ | 1647 | 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")+ |
1645 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1648 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1646 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1649 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1647 | i18n("\nor report them in the bugtracker on\n") + | 1650 | i18n("\nor report them in the bugtracker on\n") + |
1648 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1651 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1649 | QMessageBox::NoIcon, | 1652 | QMessageBox::NoIcon, |
1650 | QMessageBox::Ok, | 1653 | QMessageBox::Ok, |
1651 | QMessageBox::NoButton, | 1654 | QMessageBox::NoButton, |
1652 | QMessageBox::NoButton); | 1655 | QMessageBox::NoButton); |
1653 | msg->exec(); | 1656 | msg->exec(); |
1654 | delete msg; | 1657 | delete msg; |
1655 | 1658 | ||
1656 | } | 1659 | } |
1657 | 1660 | ||
1658 | QString MainWindow::defaultFileName() | 1661 | QString MainWindow::defaultFileName() |
1659 | { | 1662 | { |
1660 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1663 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1661 | } | 1664 | } |
1662 | QString MainWindow::syncFileName() | 1665 | QString MainWindow::syncFileName() |
1663 | { | 1666 | { |
1664 | #ifdef DESKTOP_VERSION | 1667 | #ifdef DESKTOP_VERSION |
1665 | return locateLocal( "tmp", "synccalendar.ics" ); | 1668 | return locateLocal( "tmp", "synccalendar.ics" ); |
1666 | #else | 1669 | #else |
1667 | return QString( "/tmp/synccalendar.ics" ); | 1670 | return QString( "/tmp/synccalendar.ics" ); |
1668 | #endif | 1671 | #endif |
1669 | } | 1672 | } |
1670 | #include "koglobals.h" | 1673 | #include "koglobals.h" |
1671 | #include <kcalendarsystem.h> | 1674 | #include <kcalendarsystem.h> |
1672 | void MainWindow::updateWeek(QDate seda) | 1675 | void MainWindow::updateWeek(QDate seda) |
1673 | { | 1676 | { |
1674 | int weekNum = KGlobal::locale()->weekNum ( seda ); | 1677 | int weekNum = KGlobal::locale()->weekNum ( seda ); |
1675 | mWeekPixmap.fill( mWeekBgColor ); | 1678 | mWeekPixmap.fill( mWeekBgColor ); |
1676 | QPainter p ( &mWeekPixmap ); | 1679 | QPainter p ( &mWeekPixmap ); |
1677 | p.setFont( mWeekFont ); | 1680 | p.setFont( mWeekFont ); |
1678 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1681 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1679 | p.end(); | 1682 | p.end(); |
1680 | QIconSet icon3 ( mWeekPixmap ); | 1683 | QIconSet icon3 ( mWeekPixmap ); |
1681 | mWeekAction->setIconSet ( icon3 ); | 1684 | mWeekAction->setIconSet ( icon3 ); |
1682 | 1685 | ||
1683 | } | 1686 | } |
1684 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1687 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1685 | { | 1688 | { |
1686 | updateWeek( selectedDates.first() ); | 1689 | updateWeek( selectedDates.first() ); |
1687 | } | 1690 | } |
1688 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1691 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1689 | { | 1692 | { |
1690 | if ( !incidence ) { | 1693 | if ( !incidence ) { |
1691 | mShowAction->setMenuText( i18n("Show") ); | 1694 | mShowAction->setMenuText( i18n("Show") ); |
1692 | enableIncidenceActions( false ); | 1695 | enableIncidenceActions( false ); |
1693 | mNewSubTodoAction->setEnabled( false ); | 1696 | mNewSubTodoAction->setEnabled( false ); |
1694 | setCaptionToDates(); | 1697 | setCaptionToDates(); |
1695 | return; | 1698 | return; |
1696 | } | 1699 | } |
1697 | QString startString = ""; | 1700 | QString startString = ""; |
1698 | if ( incidence->typeID() != todoID ) { | 1701 | if ( incidence->typeID() != todoID ) { |
1699 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1702 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1700 | if ( incidence->doesFloat() ) { | 1703 | if ( incidence->doesFloat() ) { |
1701 | startString += ": "+incidence->dtStartDateStr( true ); | 1704 | startString += ": "+incidence->dtStartDateStr( true ); |
1702 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1705 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1703 | } else { | 1706 | } else { |
1704 | startString = ": "+incidence->dtStartStr(true); | 1707 | startString = ": "+incidence->dtStartStr(true); |
1705 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1708 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1706 | } | 1709 | } |
1707 | } else { | 1710 | } else { |
1708 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1711 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1709 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1712 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1710 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1713 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1711 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1714 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1712 | bool ok; | 1715 | bool ok; |
1713 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1716 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1714 | if ( ok ) { | 1717 | if ( ok ) { |
1715 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1718 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1716 | startString += i18n(" (%1 y.)"). arg( years ); | 1719 | startString += i18n(" (%1 y.)"). arg( years ); |
1717 | } | 1720 | } |
1718 | } | 1721 | } |
1719 | else | 1722 | else |
1720 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1723 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1721 | } | 1724 | } |
1722 | } | 1725 | } |
1723 | else { | 1726 | else { |
1724 | if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) | 1727 | if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) |
1725 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); | 1728 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); |
1726 | else | 1729 | else |
1727 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1730 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1728 | } | 1731 | } |
1729 | if ( !incidence->location().isEmpty() ) | 1732 | if ( !incidence->location().isEmpty() ) |
1730 | startString += " (" +incidence->location()+")"; | 1733 | startString += " (" +incidence->location()+")"; |
1731 | setCaption( incidence->summary()+startString); | 1734 | setCaption( incidence->summary()+startString); |
1732 | enableIncidenceActions( true ); | 1735 | enableIncidenceActions( true ); |
1733 | if ( incidence->typeID() == eventID ) { | 1736 | if ( incidence->typeID() == eventID ) { |
1734 | mShowAction->setMenuText( i18n("Show Event") ); | 1737 | mShowAction->setMenuText( i18n("Show Event") ); |
1735 | mNewSubTodoAction->setEnabled( false ); | 1738 | mNewSubTodoAction->setEnabled( false ); |
1736 | } else if ( incidence->typeID() == todoID ) { | 1739 | } else if ( incidence->typeID() == todoID ) { |
1737 | mShowAction->setMenuText( i18n("Show Todo") ); | 1740 | mShowAction->setMenuText( i18n("Show Todo") ); |
1738 | mNewSubTodoAction->setEnabled( true ); | 1741 | mNewSubTodoAction->setEnabled( true ); |
1739 | } else { | 1742 | } else { |
1740 | mShowAction->setMenuText( i18n("Show") ); | 1743 | mShowAction->setMenuText( i18n("Show") ); |
1741 | mNewSubTodoAction->setEnabled( false ); | 1744 | mNewSubTodoAction->setEnabled( false ); |
1742 | } | 1745 | } |
1746 | static QPixmap jP = SmallIcon( "journal" ); | ||
1747 | static QPixmap eP = SmallIcon( "newevent" ); | ||
1748 | static QPixmap tP = SmallIcon( "newtodo" ); | ||
1749 | #ifdef DESKTOP_VERSION | ||
1750 | QIconSet icon; | ||
1751 | if ( incidence->typeID() == todoID ) | ||
1752 | icon = QIconSet ( tP ); | ||
1753 | else if ( incidence->typeID() == eventID ) | ||
1754 | icon = QIconSet ( eP ); | ||
1755 | else if ( incidence->typeID() == journalID ) | ||
1756 | icon = QIconSet ( jP ); | ||
1757 | mPrintSelAction->setIconSet ( icon ); | ||
1758 | #endif | ||
1743 | } | 1759 | } |
1744 | 1760 | ||
1745 | void MainWindow::enableIncidenceActions( bool enabled ) | 1761 | void MainWindow::enableIncidenceActions( bool enabled ) |
1746 | { | 1762 | { |
1747 | mShowAction->setEnabled( enabled ); | 1763 | mShowAction->setEnabled( enabled ); |
1748 | mEditAction->setEnabled( enabled ); | 1764 | mEditAction->setEnabled( enabled ); |
1749 | mDeleteAction->setEnabled( enabled ); | 1765 | mDeleteAction->setEnabled( enabled ); |
1750 | 1766 | ||
1751 | mCloneAction->setEnabled( enabled ); | 1767 | mCloneAction->setEnabled( enabled ); |
1752 | mMoveAction->setEnabled( enabled ); | 1768 | mMoveAction->setEnabled( enabled ); |
1753 | #ifndef DESKTOP_VERSION | 1769 | #ifndef DESKTOP_VERSION |
1754 | mBeamAction->setEnabled( enabled ); | 1770 | mBeamAction->setEnabled( enabled ); |
1755 | #endif | 1771 | #else |
1772 | mPrintSelAction->setEnabled( enabled ); | ||
1773 | #endif | ||
1756 | mCancelAction->setEnabled( enabled ); | 1774 | mCancelAction->setEnabled( enabled ); |
1757 | } | 1775 | } |
1758 | 1776 | ||
1759 | void MainWindow::importOL() | 1777 | void MainWindow::importOL() |
1760 | { | 1778 | { |
1761 | #ifdef _OL_IMPORT_ | 1779 | #ifdef _OL_IMPORT_ |
1762 | mView->clearAllViews(); | 1780 | mView->clearAllViews(); |
1763 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1781 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1764 | id->exec(); | 1782 | id->exec(); |
1765 | delete id; | 1783 | delete id; |
1766 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1784 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1767 | mView->updateView(); | 1785 | mView->updateView(); |
1768 | #endif | 1786 | #endif |
1769 | } | 1787 | } |
1770 | void MainWindow::importBday() | 1788 | void MainWindow::importBday() |
1771 | { | 1789 | { |
1772 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), | 1790 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1773 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1791 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1774 | i18n("Import!"), i18n("Cancel"), 0, | 1792 | i18n("Import!"), i18n("Cancel"), 0, |
1775 | 0, 1 ); | 1793 | 0, 1 ); |
1776 | if ( result == 0 ) { | 1794 | if ( result == 0 ) { |
1777 | mView->importBday(); | 1795 | mView->importBday(); |
1778 | 1796 | ||
1779 | } | 1797 | } |
1780 | 1798 | ||
1781 | 1799 | ||
1782 | } | 1800 | } |
1783 | void MainWindow::importQtopia() | 1801 | void MainWindow::importQtopia() |
1784 | { | 1802 | { |
1785 | //#ifndef DESKTOP_VERSION | 1803 | //#ifndef DESKTOP_VERSION |
1786 | QString mess = 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"); | 1804 | QString mess = 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"); |
1787 | #ifdef DESKTOP_VERSION | 1805 | #ifdef DESKTOP_VERSION |
1788 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1806 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1789 | #endif | 1807 | #endif |
1790 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1808 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1791 | i18n("Import!"), i18n("Cancel"), 0, | 1809 | i18n("Import!"), i18n("Cancel"), 0, |
1792 | 0, 1 ); | 1810 | 0, 1 ); |
1793 | if ( result == 0 ) { | 1811 | if ( result == 0 ) { |
1794 | #ifndef DESKTOP_VERSION | 1812 | #ifndef DESKTOP_VERSION |
1795 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1813 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1796 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1814 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1797 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1815 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1798 | #else | 1816 | #else |
1799 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1817 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1800 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1818 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1801 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1819 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1802 | #endif | 1820 | #endif |
1803 | mView->importQtopia( categories, datebook, todolist ); | 1821 | mView->importQtopia( categories, datebook, todolist ); |
1804 | } | 1822 | } |
1805 | mView->calendar()->reInitAlarmSettings(); | 1823 | mView->calendar()->reInitAlarmSettings(); |
1806 | #if 0 | 1824 | #if 0 |
1807 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1825 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1808 | i18n("Not supported \non desktop!\n"), | 1826 | i18n("Not supported \non desktop!\n"), |
1809 | i18n("Ok"), i18n("Cancel"), 0, | 1827 | i18n("Ok"), i18n("Cancel"), 0, |
1810 | 0, 1 ); | 1828 | 0, 1 ); |
1811 | 1829 | ||
1812 | #endif | 1830 | #endif |
1813 | } | 1831 | } |
1814 | 1832 | ||
1815 | void MainWindow::saveOnClose() | 1833 | void MainWindow::saveOnClose() |
1816 | { | 1834 | { |
1817 | KOPrefs *p = KOPrefs::instance(); | 1835 | KOPrefs *p = KOPrefs::instance(); |
1818 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1836 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1819 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1837 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1820 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1838 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1821 | if ( filterToolBar ) { | 1839 | if ( filterToolBar ) { |
1822 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1840 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1823 | } | 1841 | } |
1824 | #ifdef DESKTOP_VERSION | 1842 | #ifdef DESKTOP_VERSION |
1825 | 1843 | ||
1826 | QPoint myP; | 1844 | QPoint myP; |
1827 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1845 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1828 | if ( p->mToolBarHor ) | 1846 | if ( p->mToolBarHor ) |
1829 | p->mToolBarUp = myP.y() > height()/2; | 1847 | p->mToolBarUp = myP.y() > height()/2; |
1830 | else | 1848 | else |
1831 | p->mToolBarUp = myP.x() > width()/2; | 1849 | p->mToolBarUp = myP.x() > width()/2; |
1832 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1850 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1833 | if ( p->mToolBarHorV ) | 1851 | if ( p->mToolBarHorV ) |
1834 | p->mToolBarUpV = myP.y() > height()/2; | 1852 | p->mToolBarUpV = myP.y() > height()/2; |
1835 | else | 1853 | else |
1836 | p->mToolBarUpV = myP.x() > width()/2 ; | 1854 | p->mToolBarUpV = myP.x() > width()/2 ; |
1837 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1855 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1838 | if ( p->mToolBarHorN ) | 1856 | if ( p->mToolBarHorN ) |
1839 | p->mToolBarUpN = myP.y() > height()/2; | 1857 | p->mToolBarUpN = myP.y() > height()/2; |
1840 | else | 1858 | else |
1841 | p->mToolBarUpN = myP.x() > width()/2 ; | 1859 | p->mToolBarUpN = myP.x() > width()/2 ; |
1842 | if ( filterToolBar ) { | 1860 | if ( filterToolBar ) { |
1843 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1861 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1844 | if ( p->mToolBarHorF ) | 1862 | if ( p->mToolBarHorF ) |
1845 | p->mToolBarUpF = myP.y() > height()/2; | 1863 | p->mToolBarUpF = myP.y() > height()/2; |
1846 | else | 1864 | else |
1847 | p->mToolBarUpF = myP.x() > width()/2 ; | 1865 | p->mToolBarUpF = myP.x() > width()/2 ; |
1848 | } | 1866 | } |
1849 | #else | 1867 | #else |
1850 | if ( p->mToolBarHor ) | 1868 | if ( p->mToolBarHor ) |
1851 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1869 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1852 | else | 1870 | else |
1853 | p->mToolBarUp = iconToolBar->x() > width()/2; | 1871 | p->mToolBarUp = iconToolBar->x() > width()/2; |
1854 | if ( p->mToolBarHorV ) | 1872 | if ( p->mToolBarHorV ) |
1855 | p->mToolBarUpV = viewToolBar->y() > height()/2; | 1873 | p->mToolBarUpV = viewToolBar->y() > height()/2; |
1856 | else | 1874 | else |
1857 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; | 1875 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; |
1858 | 1876 | ||
1859 | if ( p->mToolBarHorN ) | 1877 | if ( p->mToolBarHorN ) |
1860 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | 1878 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; |
1861 | else | 1879 | else |
1862 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1880 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1863 | if ( filterToolBar ) { | 1881 | if ( filterToolBar ) { |
1864 | if ( p->mToolBarHorF ) | 1882 | if ( p->mToolBarHorF ) |
1865 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1883 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1866 | else | 1884 | else |
1867 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1885 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1868 | } | 1886 | } |
1869 | #endif | 1887 | #endif |
1870 | save(); | 1888 | save(); |
1871 | mView->writeSettings(); | 1889 | mView->writeSettings(); |
1872 | mView->checkSuspendAlarm(); | 1890 | mView->checkSuspendAlarm(); |
1873 | } | 1891 | } |
1874 | void MainWindow::slotModifiedChanged( bool ) | 1892 | void MainWindow::slotModifiedChanged( bool ) |
1875 | { | 1893 | { |
1876 | if ( mBlockAtStartup ) | 1894 | if ( mBlockAtStartup ) |
1877 | return; | 1895 | return; |
1878 | 1896 | ||
1879 | int msec; | 1897 | int msec; |
1880 | // we store the changes after 1 minute, | 1898 | // we store the changes after 1 minute, |
1881 | // and for safety reasons after 10 minutes again | 1899 | // and for safety reasons after 10 minutes again |
1882 | if ( !mSyncManager->blockSave() ) | 1900 | if ( !mSyncManager->blockSave() ) |
1883 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1901 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1884 | else | 1902 | else |
1885 | msec = 1000 * 600; | 1903 | msec = 1000 * 600; |
1886 | mSaveTimer.start( msec, true ); // 1 minute | 1904 | mSaveTimer.start( msec, true ); // 1 minute |
1887 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1905 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1888 | mCalendarModifiedFlag = true; | 1906 | mCalendarModifiedFlag = true; |
1889 | } | 1907 | } |
1890 | void MainWindow::saveStopTimer() | 1908 | void MainWindow::saveStopTimer() |
1891 | { | 1909 | { |
1892 | mSaveTimer.stop(); | 1910 | mSaveTimer.stop(); |
1893 | } | 1911 | } |
1894 | void MainWindow::backupAllFiles() | 1912 | void MainWindow::backupAllFiles() |
1895 | { | 1913 | { |
1896 | QDate reference ( 2000,1,1); | 1914 | QDate reference ( 2000,1,1); |
1897 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1915 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1898 | setCaption(i18n("Creating backup ... please wait ..." )); | 1916 | setCaption(i18n("Creating backup ... please wait ..." )); |
1899 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); | 1917 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); |
1900 | // we need the file path, the backup dir and the number of bups as param | 1918 | // we need the file path, the backup dir and the number of bups as param |
1901 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 1919 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
1902 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 1920 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
1903 | bupDir = KGlobalSettings::backupDataDir(); | 1921 | bupDir = KGlobalSettings::backupDataDir(); |
1904 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1922 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1905 | if ( retval == 0 ) { | 1923 | if ( retval == 0 ) { |
1906 | setCaption(i18n("Backup cancelled" )); | 1924 | setCaption(i18n("Backup cancelled" )); |
1907 | qDebug("KO: Backup cancelled. Will try again tomorrow "); | 1925 | qDebug("KO: Backup cancelled. Will try again tomorrow "); |
1908 | // retval == 0 : backup skipped for today, try again tomorrow | 1926 | // retval == 0 : backup skipped for today, try again tomorrow |
1909 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; | 1927 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; |
1910 | } else if ( retval == 1 ){ | 1928 | } else if ( retval == 1 ){ |
1911 | qDebug("KO: Backup created."); | 1929 | qDebug("KO: Backup created."); |
1912 | // backup ok | 1930 | // backup ok |
1913 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 1931 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
1914 | KopiCalendarFile * cal = calendars.first(); | 1932 | KopiCalendarFile * cal = calendars.first(); |
1915 | cal = calendars.next(); | 1933 | cal = calendars.next(); |
1916 | while ( cal ) { | 1934 | while ( cal ) { |
1917 | if ( !cal->mErrorOnLoad ) { | 1935 | if ( !cal->mErrorOnLoad ) { |
1918 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1936 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1919 | } | 1937 | } |
1920 | cal = calendars.next(); | 1938 | cal = calendars.next(); |
1921 | } | 1939 | } |
1922 | KOPrefs::instance()->mLastBackupDate = daysTo; | 1940 | KOPrefs::instance()->mLastBackupDate = daysTo; |
1923 | setCaption(i18n("Backup succesfully finished" )); | 1941 | setCaption(i18n("Backup succesfully finished" )); |
1924 | } else if ( retval == 2 ){ | 1942 | } else if ( retval == 2 ){ |
1925 | setCaption(i18n("Backup globally disabled" )); | 1943 | setCaption(i18n("Backup globally disabled" )); |
1926 | qDebug("KO: Backup globally cancelled."); | 1944 | qDebug("KO: Backup globally cancelled."); |
1927 | // backup globally cancelled | 1945 | // backup globally cancelled |
1928 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 1946 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
1929 | } | 1947 | } |
1930 | // retval == 3: do nothing, try again later | 1948 | // retval == 3: do nothing, try again later |
1931 | } | 1949 | } |
1932 | void MainWindow::save() | 1950 | void MainWindow::save() |
1933 | { | 1951 | { |
1934 | 1952 | ||
1935 | if ( mView->viewManager()->journalView() ) | 1953 | if ( mView->viewManager()->journalView() ) |
1936 | mView->viewManager()->journalView()->checkModified(); | 1954 | mView->viewManager()->journalView()->checkModified(); |
1937 | if ( !mCalendarModifiedFlag ) { | 1955 | if ( !mCalendarModifiedFlag ) { |
1938 | qDebug("KO: Calendar not modified. Nothing saved."); | 1956 | qDebug("KO: Calendar not modified. Nothing saved."); |
1939 | return; | 1957 | return; |
1940 | } | 1958 | } |
1941 | if ( mSyncManager->blockSave() ) | 1959 | if ( mSyncManager->blockSave() ) |
1942 | return; | 1960 | return; |
1943 | mSyncManager->setBlockSave(true); | 1961 | mSyncManager->setBlockSave(true); |
1944 | if ( mView->checkAllFileVersions() ) { | 1962 | if ( mView->checkAllFileVersions() ) { |
1945 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ | 1963 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ |
1946 | QDate reference ( 2000,1,1); | 1964 | QDate reference ( 2000,1,1); |
1947 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1965 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1948 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { | 1966 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |
1949 | backupAllFiles(); | 1967 | backupAllFiles(); |
1950 | } | 1968 | } |
1951 | ; // KPimGlobalPrefs::instance()->mLastBackupDate | 1969 | ; // KPimGlobalPrefs::instance()->mLastBackupDate |
1952 | } | 1970 | } |
1953 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1971 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1954 | if ( !isMinimized () ) | 1972 | if ( !isMinimized () ) |
1955 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1973 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1956 | qDebug("KO: Start saving data to file!"); | 1974 | qDebug("KO: Start saving data to file!"); |
1957 | mView->saveCalendars(); | 1975 | mView->saveCalendars(); |
1958 | mCalendarModifiedFlag = false; | 1976 | mCalendarModifiedFlag = false; |
1959 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1977 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1960 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1978 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1961 | QString savemes; | 1979 | QString savemes; |
1962 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1980 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1963 | if ( !isMinimized () ) | 1981 | if ( !isMinimized () ) |
1964 | setCaption(savemes); | 1982 | setCaption(savemes); |
1965 | else | 1983 | else |
1966 | qDebug(savemes); | 1984 | qDebug(savemes); |
1967 | } else | 1985 | } else |
1968 | setCaption(i18n("Saving cancelled!")); | 1986 | setCaption(i18n("Saving cancelled!")); |
1969 | mSyncManager->setBlockSave( false ); | 1987 | mSyncManager->setBlockSave( false ); |
1970 | } | 1988 | } |
1971 | 1989 | ||
1972 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1990 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1973 | { | 1991 | { |
1974 | if ( !e->isAutoRepeat() ) { | 1992 | if ( !e->isAutoRepeat() ) { |
1975 | mFlagKeyPressed = false; | 1993 | mFlagKeyPressed = false; |
1976 | } | 1994 | } |
1977 | } | 1995 | } |
1978 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1996 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1979 | { | 1997 | { |
1980 | qApp->processEvents(); | 1998 | qApp->processEvents(); |
1981 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1999 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1982 | e->ignore(); | 2000 | e->ignore(); |
1983 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 2001 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1984 | return; | 2002 | return; |
1985 | } | 2003 | } |
1986 | if (! e->isAutoRepeat() ) | 2004 | if (! e->isAutoRepeat() ) |
1987 | mFlagKeyPressed = true; | 2005 | mFlagKeyPressed = true; |
1988 | KOPrefs *p = KOPrefs::instance(); | 2006 | KOPrefs *p = KOPrefs::instance(); |
1989 | bool showSelectedDates = false; | 2007 | bool showSelectedDates = false; |
1990 | int size; | 2008 | int size; |
1991 | int pro = 0; | 2009 | int pro = 0; |
1992 | //qDebug("MainWindow::keyPressEvent "); | 2010 | //qDebug("MainWindow::keyPressEvent "); |
1993 | switch ( e->key() ) { | 2011 | switch ( e->key() ) { |
1994 | case Qt::Key_Right: | 2012 | case Qt::Key_Right: |
1995 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 2013 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1996 | mView->goNextMonth(); | 2014 | mView->goNextMonth(); |
1997 | else | 2015 | else |
1998 | mView->goNext(); | 2016 | mView->goNext(); |
1999 | showSelectedDates = true; | 2017 | showSelectedDates = true; |
2000 | break; | 2018 | break; |
2001 | case Qt::Key_Left: | 2019 | case Qt::Key_Left: |
2002 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2020 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2003 | mView->goPreviousMonth(); | 2021 | mView->goPreviousMonth(); |
2004 | else | 2022 | else |
2005 | mView->goPrevious(); | 2023 | mView->goPrevious(); |
2006 | showSelectedDates = true; | 2024 | showSelectedDates = true; |
2007 | break; | 2025 | break; |
2008 | case Qt::Key_Down: | 2026 | case Qt::Key_Down: |
2009 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 2027 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
2010 | break; | 2028 | break; |
2011 | case Qt::Key_Up: | 2029 | case Qt::Key_Up: |
2012 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 2030 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
2013 | break; | 2031 | break; |
2014 | case Qt::Key_K: | 2032 | case Qt::Key_K: |
2015 | mView->viewManager()->showMonthViewWeek(); | 2033 | mView->viewManager()->showMonthViewWeek(); |
2016 | break; | 2034 | break; |
2017 | case Qt::Key_I: | 2035 | case Qt::Key_I: |
2018 | mView->showIncidence(); | 2036 | mView->showIncidence(); |
2019 | break; | 2037 | break; |
2020 | case Qt::Key_Delete: | 2038 | case Qt::Key_Delete: |
2021 | case Qt::Key_Backspace: | 2039 | case Qt::Key_Backspace: |
2022 | mView->deleteIncidence(); | 2040 | mView->deleteIncidence(); |
2023 | break; | 2041 | break; |
2024 | case Qt::Key_D: | 2042 | case Qt::Key_D: |
2025 | mView->viewManager()->showDayView(); | 2043 | mView->viewManager()->showDayView(); |
2026 | showSelectedDates = true; | 2044 | showSelectedDates = true; |
2027 | break; | 2045 | break; |
2028 | case Qt::Key_O: | 2046 | case Qt::Key_O: |
2029 | mView->toggleFilerEnabled( ); | 2047 | mView->toggleFilerEnabled( ); |
2030 | break; | 2048 | break; |
2031 | case Qt::Key_0: | 2049 | case Qt::Key_0: |
2032 | case Qt::Key_1: | 2050 | case Qt::Key_1: |
2033 | case Qt::Key_2: | 2051 | case Qt::Key_2: |
2034 | case Qt::Key_3: | 2052 | case Qt::Key_3: |
2035 | case Qt::Key_4: | 2053 | case Qt::Key_4: |
2036 | case Qt::Key_5: | 2054 | case Qt::Key_5: |
2037 | case Qt::Key_6: | 2055 | case Qt::Key_6: |
2038 | case Qt::Key_7: | 2056 | case Qt::Key_7: |
2039 | case Qt::Key_8: | 2057 | case Qt::Key_8: |
2040 | case Qt::Key_9: | 2058 | case Qt::Key_9: |
2041 | pro = e->key()-48; | 2059 | pro = e->key()-48; |
2042 | if ( pro == 0 ) | 2060 | if ( pro == 0 ) |
2043 | pro = 10; | 2061 | pro = 10; |
2044 | if ( e->state() == Qt::ControlButton) | 2062 | if ( e->state() == Qt::ControlButton) |
2045 | pro += 10; | 2063 | pro += 10; |
2046 | break; | 2064 | break; |
2047 | case Qt::Key_M: | 2065 | case Qt::Key_M: |
2048 | mView->viewManager()->showMonthView(); | 2066 | mView->viewManager()->showMonthView(); |
2049 | showSelectedDates = true; | 2067 | showSelectedDates = true; |
2050 | break; | 2068 | break; |
2051 | case Qt::Key_Insert: | 2069 | case Qt::Key_Insert: |
2052 | mView->newEvent(); | 2070 | mView->newEvent(); |
2053 | break; | 2071 | break; |
2054 | case Qt::Key_S : | 2072 | case Qt::Key_S : |
2055 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 2073 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
2056 | mView->newSubTodo(); | 2074 | mView->newSubTodo(); |
2057 | else | 2075 | else |
2058 | mView->dialogManager()->showSearchDialog(); | 2076 | mView->dialogManager()->showSearchDialog(); |
2059 | break; | 2077 | break; |
2060 | case Qt::Key_Y : | 2078 | case Qt::Key_Y : |
2061 | case Qt::Key_Z : | 2079 | case Qt::Key_Z : |
2062 | mView->viewManager()->showWorkWeekView(); | 2080 | mView->viewManager()->showWorkWeekView(); |
2063 | showSelectedDates = true; | 2081 | showSelectedDates = true; |
2064 | break; | 2082 | break; |
2065 | case Qt::Key_U : | 2083 | case Qt::Key_U : |
2066 | mView->viewManager()->showWeekView(); | 2084 | mView->viewManager()->showWeekView(); |
2067 | showSelectedDates = true; | 2085 | showSelectedDates = true; |
2068 | break; | 2086 | break; |
2069 | case Qt::Key_H : | 2087 | case Qt::Key_H : |
2070 | keyBindings(); | 2088 | keyBindings(); |
2071 | break; | 2089 | break; |
2072 | case Qt::Key_W: | 2090 | case Qt::Key_W: |
2073 | mView->viewManager()->showWhatsNextView(); | 2091 | mView->viewManager()->showWhatsNextView(); |
2074 | break; | 2092 | break; |
2075 | case Qt::Key_L: | 2093 | case Qt::Key_L: |
2076 | mView->viewManager()->showListView(); | 2094 | mView->viewManager()->showListView(); |
2077 | break; | 2095 | break; |
2078 | case Qt::Key_N: | 2096 | case Qt::Key_N: |
2079 | mView->viewManager()->showNextView(); | 2097 | mView->viewManager()->showNextView(); |
2080 | break; | 2098 | break; |
2081 | case Qt::Key_V: | 2099 | case Qt::Key_V: |
2082 | mView->viewManager()->showTodoView(); | 2100 | mView->viewManager()->showTodoView(); |
2083 | break; | 2101 | break; |
2084 | case Qt::Key_C: | 2102 | case Qt::Key_C: |
2085 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 2103 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
2086 | break; | 2104 | break; |
2087 | case Qt::Key_P: | 2105 | case Qt::Key_P: |
2088 | mView->showDatePicker( ); | 2106 | mView->showDatePicker( ); |
2089 | break; | 2107 | break; |
2090 | case Qt::Key_F: | 2108 | case Qt::Key_F: |
2091 | mView->editFilters(); | 2109 | mView->editFilters(); |
2092 | break; | 2110 | break; |
2093 | case Qt::Key_R: | 2111 | case Qt::Key_R: |
2094 | mView->toggleFilter(); | 2112 | mView->toggleFilter(); |
2095 | break; | 2113 | break; |
2096 | case Qt::Key_X: | 2114 | case Qt::Key_X: |
2097 | if ( e->state() == Qt::ControlButton ) | 2115 | if ( e->state() == Qt::ControlButton ) |
2098 | mView->toggleDateNavigatorWidget(); | 2116 | mView->toggleDateNavigatorWidget(); |
2099 | else { | 2117 | else { |
2100 | mView->viewManager()->showNextXView(); | 2118 | mView->viewManager()->showNextXView(); |
2101 | showSelectedDates = true; | 2119 | showSelectedDates = true; |
2102 | } | 2120 | } |
2103 | break; | 2121 | break; |
2104 | case Qt::Key_Space: | 2122 | case Qt::Key_Space: |
2105 | mView->toggleExpand(); | 2123 | mView->toggleExpand(); |
2106 | break; | 2124 | break; |
2107 | case Qt::Key_A: | 2125 | case Qt::Key_A: |
2108 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) | 2126 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) |
2109 | mView->showNextAlarms(); | 2127 | mView->showNextAlarms(); |
2110 | else | 2128 | else |
2111 | mView->toggleAllDaySize(); | 2129 | mView->toggleAllDaySize(); |
2112 | break; | 2130 | break; |
2113 | case Qt::Key_T: | 2131 | case Qt::Key_T: |
2114 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2132 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2115 | mView->newTodo(); | 2133 | mView->newTodo(); |
2116 | else { | 2134 | else { |
2117 | mView->goToday(); | 2135 | mView->goToday(); |
2118 | showSelectedDates = true; | 2136 | showSelectedDates = true; |
2119 | } | 2137 | } |
2120 | break; | 2138 | break; |
2121 | case Qt::Key_Q: | 2139 | case Qt::Key_Q: |
2122 | if ( e->state() == Qt::ControlButton ) | 2140 | if ( e->state() == Qt::ControlButton ) |
2123 | mView->conflictNotAll(); | 2141 | mView->conflictNotAll(); |
2124 | else if ( e->state() == Qt::ShiftButton ) | 2142 | else if ( e->state() == Qt::ShiftButton ) |
2125 | mView->conflictAllday(); | 2143 | mView->conflictAllday(); |
2126 | else | 2144 | else |
2127 | mView->conflictAll(); | 2145 | mView->conflictAll(); |
2128 | break; | 2146 | break; |
2129 | case Qt::Key_J: | 2147 | case Qt::Key_J: |
2130 | mView->viewManager()->showJournalView(); | 2148 | mView->viewManager()->showJournalView(); |
2131 | break; | 2149 | break; |
2132 | case Qt::Key_B: | 2150 | case Qt::Key_B: |
2133 | mView->editIncidenceDescription();; | 2151 | mView->editIncidenceDescription();; |
2134 | break; | 2152 | break; |
2135 | // case Qt::Key_Return: | 2153 | // case Qt::Key_Return: |
2136 | case Qt::Key_E: | 2154 | case Qt::Key_E: |
2137 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2155 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2138 | mView->newEvent(); | 2156 | mView->newEvent(); |
2139 | else | 2157 | else |
2140 | mView->editIncidence(); | 2158 | mView->editIncidence(); |
2141 | break; | 2159 | break; |
2142 | case Qt::Key_Plus: | 2160 | case Qt::Key_Plus: |
2143 | size = p->mHourSize +2; | 2161 | size = p->mHourSize +2; |
2144 | if ( size <= 22 ) | 2162 | if ( size <= 22 ) |
2145 | configureAgenda( size ); | 2163 | configureAgenda( size ); |
2146 | break; | 2164 | break; |
2147 | case Qt::Key_Minus: | 2165 | case Qt::Key_Minus: |
2148 | size = p->mHourSize - 2; | 2166 | size = p->mHourSize - 2; |
2149 | if ( size >= 4 ) | 2167 | if ( size >= 4 ) |
2150 | configureAgenda( size ); | 2168 | configureAgenda( size ); |
2151 | break; | 2169 | break; |
2152 | 2170 | ||
2153 | 2171 | ||
2154 | default: | 2172 | default: |
2155 | e->ignore(); | 2173 | e->ignore(); |
2156 | } | 2174 | } |
2157 | if ( pro > 0 ) { | 2175 | if ( pro > 0 ) { |
2158 | selectFilter( pro+1 ); | 2176 | selectFilter( pro+1 ); |
2159 | } | 2177 | } |
2160 | if ( showSelectedDates ) { | 2178 | if ( showSelectedDates ) { |
2161 | ;// setCaptionToDates(); | 2179 | ;// setCaptionToDates(); |
2162 | } | 2180 | } |
2163 | 2181 | ||
2164 | } | 2182 | } |
2165 | void MainWindow::fillFilterMenuTB() | 2183 | void MainWindow::fillFilterMenuTB() |
2166 | { | 2184 | { |
2167 | selectFilterMenuTB->clear(); | 2185 | selectFilterMenuTB->clear(); |
2168 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); | 2186 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); |
2169 | selectFilterMenuTB->insertSeparator(); | 2187 | selectFilterMenuTB->insertSeparator(); |
2170 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); | 2188 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); |
2171 | 2189 | ||
2172 | selectFilterMenuTB->insertSeparator(); | 2190 | selectFilterMenuTB->insertSeparator(); |
2173 | QPtrList<CalFilter> fili = mView->filters(); | 2191 | QPtrList<CalFilter> fili = mView->filters(); |
2174 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2192 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2175 | CalFilter *filter = fili.first(); | 2193 | CalFilter *filter = fili.first(); |
2176 | int iii = 2; | 2194 | int iii = 2; |
2177 | bool checkitem = mView->filterView()->filtersEnabled(); | 2195 | bool checkitem = mView->filterView()->filtersEnabled(); |
2178 | while(filter) { | 2196 | while(filter) { |
2179 | selectFilterMenuTB->insertItem( filter->name(), iii ); | 2197 | selectFilterMenuTB->insertItem( filter->name(), iii ); |
2180 | if ( filter == curfilter) | 2198 | if ( filter == curfilter) |
2181 | selectFilterMenuTB->setItemChecked( iii, checkitem ); | 2199 | selectFilterMenuTB->setItemChecked( iii, checkitem ); |
2182 | filter = fili.next(); | 2200 | filter = fili.next(); |
2183 | ++iii; | 2201 | ++iii; |
2184 | } | 2202 | } |
2185 | if ( !checkitem ) | 2203 | if ( !checkitem ) |
2186 | selectFilterMenuTB->setItemChecked( 1, true ); | 2204 | selectFilterMenuTB->setItemChecked( 1, true ); |
2187 | 2205 | ||
2188 | int x = 0; | 2206 | int x = 0; |
2189 | int y = iconToolBar->height(); | 2207 | int y = iconToolBar->height(); |
2190 | int dX = 0; | 2208 | int dX = 0; |
2191 | int dY = 0; | 2209 | int dY = 0; |
2192 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2210 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2193 | if ( iconToolBar->y() > height()/2 ) { | 2211 | if ( iconToolBar->y() > height()/2 ) { |
2194 | dY = selectFilterMenuTB->sizeHint().height()+8; | 2212 | dY = selectFilterMenuTB->sizeHint().height()+8; |
2195 | y = 0; | 2213 | y = 0; |
2196 | } | 2214 | } |
2197 | } else { | 2215 | } else { |
2198 | if ( iconToolBar->x() > width()/2 ) { // right side | 2216 | if ( iconToolBar->x() > width()/2 ) { // right side |
2199 | x=0; | 2217 | x=0; |
2200 | dX= selectFilterMenuTB->sizeHint().width()+8; | 2218 | dX= selectFilterMenuTB->sizeHint().width()+8; |
2201 | y = 0; | 2219 | y = 0; |
2202 | } else { | 2220 | } else { |
2203 | x= iconToolBar->width(); | 2221 | x= iconToolBar->width(); |
2204 | y = 0; | 2222 | y = 0; |
2205 | } | 2223 | } |
2206 | } | 2224 | } |
2207 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2225 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2208 | selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); | 2226 | selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); |
2209 | } | 2227 | } |
2210 | void MainWindow::fillFilterMenu() | 2228 | void MainWindow::fillFilterMenu() |
2211 | { | 2229 | { |
2212 | selectFilterMenu->clear(); | 2230 | selectFilterMenu->clear(); |
2213 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 2231 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
2214 | selectFilterMenu->insertSeparator(); | 2232 | selectFilterMenu->insertSeparator(); |
2215 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); | 2233 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); |
2216 | 2234 | ||
2217 | selectFilterMenu->insertSeparator(); | 2235 | selectFilterMenu->insertSeparator(); |
2218 | QPtrList<CalFilter> fili = mView->filters(); | 2236 | QPtrList<CalFilter> fili = mView->filters(); |
2219 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2237 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2220 | CalFilter *filter = fili.first(); | 2238 | CalFilter *filter = fili.first(); |
2221 | int iii = 2; | 2239 | int iii = 2; |
2222 | bool checkitem = mView->filterView()->filtersEnabled(); | 2240 | bool checkitem = mView->filterView()->filtersEnabled(); |
2223 | while(filter) { | 2241 | while(filter) { |
2224 | selectFilterMenu->insertItem( filter->name(), iii ); | 2242 | selectFilterMenu->insertItem( filter->name(), iii ); |
2225 | if ( filter == curfilter) | 2243 | if ( filter == curfilter) |
2226 | selectFilterMenu->setItemChecked( iii, checkitem ); | 2244 | selectFilterMenu->setItemChecked( iii, checkitem ); |
2227 | filter = fili.next(); | 2245 | filter = fili.next(); |
2228 | ++iii; | 2246 | ++iii; |
2229 | } | 2247 | } |
2230 | if ( !checkitem ) | 2248 | if ( !checkitem ) |
2231 | selectFilterMenu->setItemChecked( 1, true ); | 2249 | selectFilterMenu->setItemChecked( 1, true ); |
2232 | } | 2250 | } |
2233 | void MainWindow::fillFilterMenuPopup() | 2251 | void MainWindow::fillFilterMenuPopup() |
2234 | { | 2252 | { |
2235 | filterPopupMenu->clear(); | 2253 | filterPopupMenu->clear(); |
2236 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); | 2254 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); |
2237 | 2255 | ||
2238 | filterPopupMenu->insertSeparator(); | 2256 | filterPopupMenu->insertSeparator(); |
2239 | QPtrList<CalFilter> fili = mView->filters(); | 2257 | QPtrList<CalFilter> fili = mView->filters(); |
2240 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2258 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2241 | CalFilter *filter = fili.first(); | 2259 | CalFilter *filter = fili.first(); |
2242 | int iii = 1; | 2260 | int iii = 1; |
2243 | bool checkitem = mView->filterView()->filtersEnabled(); | 2261 | bool checkitem = mView->filterView()->filtersEnabled(); |
2244 | while(filter) { | 2262 | while(filter) { |
2245 | filterPopupMenu->insertItem( filter->name(), iii ); | 2263 | filterPopupMenu->insertItem( filter->name(), iii ); |
2246 | if ( filter == curfilter) | 2264 | if ( filter == curfilter) |
2247 | filterPopupMenu->setItemChecked( iii, checkitem ); | 2265 | filterPopupMenu->setItemChecked( iii, checkitem ); |
2248 | filter = fili.next(); | 2266 | filter = fili.next(); |
2249 | ++iii; | 2267 | ++iii; |
2250 | } | 2268 | } |
2251 | if ( !checkitem ) | 2269 | if ( !checkitem ) |
2252 | filterPopupMenu->setItemChecked( 0, true ); | 2270 | filterPopupMenu->setItemChecked( 0, true ); |
2253 | } | 2271 | } |
2254 | void MainWindow::selectFilter( int fil ) | 2272 | void MainWindow::selectFilter( int fil ) |
2255 | { | 2273 | { |
2256 | 2274 | ||
2257 | if ( fil == 0 ) { | 2275 | if ( fil == 0 ) { |
2258 | mView->editFilters( ); | 2276 | mView->editFilters( ); |
2259 | } else if ( fil == 1 ){ | 2277 | } else if ( fil == 1 ){ |
2260 | if ( mView->filterView()->filtersEnabled() ) | 2278 | if ( mView->filterView()->filtersEnabled() ) |
2261 | mView->toggleFilerEnabled( ); | 2279 | mView->toggleFilerEnabled( ); |
2262 | } else { | 2280 | } else { |
2263 | if ( !mView->filterView()->filtersEnabled() ) { | 2281 | if ( !mView->filterView()->filtersEnabled() ) { |
2264 | mView->filterView()->blockSignals( true ); | 2282 | mView->filterView()->blockSignals( true ); |
2265 | mView->toggleFilerEnabled( ); | 2283 | mView->toggleFilerEnabled( ); |
2266 | mView->filterView()->blockSignals( false ); | 2284 | mView->filterView()->blockSignals( false ); |
2267 | } | 2285 | } |
2268 | mView->selectFilter( fil-2 ); | 2286 | mView->selectFilter( fil-2 ); |
2269 | } | 2287 | } |
2270 | } | 2288 | } |
2271 | void MainWindow::updateFilterToolbar() | 2289 | void MainWindow::updateFilterToolbar() |
2272 | { | 2290 | { |
2273 | if ( filterMenubar ) { | 2291 | if ( filterMenubar ) { |
2274 | if ( !mView->filterView()->filtersEnabled() ) { | 2292 | if ( !mView->filterView()->filtersEnabled() ) { |
2275 | filterMenubar->changeItem( 0, i18n("No Filter") ); | 2293 | filterMenubar->changeItem( 0, i18n("No Filter") ); |
2276 | } else { | 2294 | } else { |
2277 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2295 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2278 | if ( curfilter ) { | 2296 | if ( curfilter ) { |
2279 | filterMenubar->changeItem( 0, curfilter->name() ); | 2297 | filterMenubar->changeItem( 0, curfilter->name() ); |
2280 | } | 2298 | } |
2281 | } | 2299 | } |
2282 | } | 2300 | } |
2283 | } | 2301 | } |
2284 | void MainWindow::selectFilterPopup( int fil ) | 2302 | void MainWindow::selectFilterPopup( int fil ) |
2285 | { | 2303 | { |
2286 | selectFilter( fil + 1 ); | 2304 | selectFilter( fil + 1 ); |
2287 | 2305 | ||
2288 | } | 2306 | } |
2289 | void MainWindow::configureToolBar( int item ) | 2307 | void MainWindow::configureToolBar( int item ) |
2290 | { | 2308 | { |
2291 | 2309 | ||
2292 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 2310 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
2293 | KOPrefs *p = KOPrefs::instance(); | 2311 | KOPrefs *p = KOPrefs::instance(); |
2294 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 2312 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
2295 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); | 2313 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); |
2296 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | 2314 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); |
2297 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 2315 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
2298 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 2316 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
2299 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); | 2317 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); |
2300 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); | 2318 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); |
2301 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); | 2319 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); |
2302 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); | 2320 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); |
2303 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 2321 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
2304 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 2322 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
2305 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 2323 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
2306 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 2324 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
2307 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 2325 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
2308 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 2326 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
2309 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 2327 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
2310 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 2328 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
2311 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 2329 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
2312 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 2330 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
2313 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 2331 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
2314 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 2332 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
2315 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 2333 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
2316 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 2334 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
2317 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 2335 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
2318 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 2336 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
2319 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 2337 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
2320 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 2338 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
2321 | // initActions(); | 2339 | // initActions(); |
2322 | setCaption ( i18n("Toolbar changes needs a restart!") ); | 2340 | setCaption ( i18n("Toolbar changes needs a restart!") ); |
2323 | } | 2341 | } |
2324 | void MainWindow::setCaption ( const QString & c ) | 2342 | void MainWindow::setCaption ( const QString & c ) |
2325 | { | 2343 | { |
2326 | QString cap = c; | 2344 | QString cap = c; |
2327 | cap.replace( QRegExp("\n"), " " ); | 2345 | cap.replace( QRegExp("\n"), " " ); |
2328 | cap = cap.stripWhiteSpace(); | 2346 | cap = cap.stripWhiteSpace(); |
2329 | if ( cap.isEmpty() ) | 2347 | if ( cap.isEmpty() ) |
2330 | cap = "KO/Pi"; | 2348 | cap = "KO/Pi"; |
2331 | QWidget::setCaption( cap ); | 2349 | QWidget::setCaption( cap ); |
2332 | } | 2350 | } |
2333 | void MainWindow::setCaptionToDates() | 2351 | void MainWindow::setCaptionToDates() |
2334 | { | 2352 | { |
2335 | QString selDates; | 2353 | QString selDates; |
2336 | QDate date = mView->startDate(); | 2354 | QDate date = mView->startDate(); |
2337 | if ( ! date.isValid() ) { | 2355 | if ( ! date.isValid() ) { |
2338 | setCaption(""); | 2356 | setCaption(""); |
2339 | return; | 2357 | return; |
2340 | } | 2358 | } |
2341 | selDates = KGlobal::locale()->formatDate( date, true); | 2359 | selDates = KGlobal::locale()->formatDate( date, true); |
2342 | if (mView->startDate() < mView->endDate() ) | 2360 | if (mView->startDate() < mView->endDate() ) |
2343 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 2361 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
2344 | else { | 2362 | else { |
2345 | QString addString; | 2363 | QString addString; |
2346 | if ( date == QDateTime::currentDateTime().date() ) | 2364 | if ( date == QDateTime::currentDateTime().date() ) |
2347 | addString = i18n("Today"); | 2365 | addString = i18n("Today"); |
2348 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 2366 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
2349 | addString = i18n("Tomorrow"); | 2367 | addString = i18n("Tomorrow"); |
2350 | if ( !addString.isEmpty() ) | 2368 | if ( !addString.isEmpty() ) |
2351 | selDates = addString+", "+selDates ; | 2369 | selDates = addString+", "+selDates ; |
2352 | } | 2370 | } |
2353 | setCaption( i18n("Dates: ") + selDates ); | 2371 | setCaption( i18n("Dates: ") + selDates ); |
2354 | 2372 | ||
2355 | } | 2373 | } |
2356 | void MainWindow::showConfigureAgenda( ) | 2374 | void MainWindow::showConfigureAgenda( ) |
2357 | { | 2375 | { |
2358 | int iii; | 2376 | int iii; |
2359 | for ( iii = 1;iii<= 10 ;++iii ){ | 2377 | for ( iii = 1;iii<= 10 ;++iii ){ |
2360 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 2378 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
2361 | } | 2379 | } |
2362 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2380 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2363 | } | 2381 | } |
2364 | void MainWindow::configureAgenda( int item ) | 2382 | void MainWindow::configureAgenda( int item ) |
2365 | { | 2383 | { |
2366 | if ( KOPrefs::instance()->mHourSize == item ) | 2384 | if ( KOPrefs::instance()->mHourSize == item ) |
2367 | return; | 2385 | return; |
2368 | KOPrefs::instance()->mHourSize=item; | 2386 | KOPrefs::instance()->mHourSize=item; |
2369 | mView->viewManager()->agendaView()->updateConfig(); | 2387 | mView->viewManager()->agendaView()->updateConfig(); |
2370 | } | 2388 | } |
2371 | 2389 | ||
2372 | void MainWindow::saveCalendar() | 2390 | void MainWindow::saveCalendar() |
2373 | { | 2391 | { |
2374 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2392 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2375 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2393 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2376 | bupDir = KGlobalSettings::backupDataDir(); | 2394 | bupDir = KGlobalSettings::backupDataDir(); |
2377 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); | 2395 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); |
2378 | QString bupHint; | 2396 | QString bupHint; |
2379 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2397 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2380 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2398 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
2381 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2399 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2382 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | 2400 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; |
2383 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 2401 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
2384 | save(); | 2402 | save(); |
2385 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; | 2403 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; |
2386 | backupAllFiles(); | 2404 | backupAllFiles(); |
2387 | } | 2405 | } |
2388 | void MainWindow::loadCalendar() | 2406 | void MainWindow::loadCalendar() |
2389 | { | 2407 | { |
2390 | 2408 | ||
2391 | 2409 | ||
2392 | #if 0 | 2410 | #if 0 |
2393 | QString fn = KOPrefs::instance()->mLastLoadFile; | 2411 | QString fn = KOPrefs::instance()->mLastLoadFile; |
2394 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 2412 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
2395 | 2413 | ||
2396 | if ( fn == "" ) | 2414 | if ( fn == "" ) |
2397 | return; | 2415 | return; |
2398 | QFileInfo info; | 2416 | QFileInfo info; |
2399 | info.setFile( fn ); | 2417 | info.setFile( fn ); |
2400 | QString mess; | 2418 | QString mess; |
2401 | bool loadbup = true; | 2419 | bool loadbup = true; |
2402 | if ( info. exists() ) { | 2420 | if ( info. exists() ) { |
2403 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2421 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2404 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2422 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2405 | mess, | 2423 | mess, |
2406 | i18n("Load!"), i18n("Cancel"), 0, | 2424 | i18n("Load!"), i18n("Cancel"), 0, |
2407 | 0, 1 ); | 2425 | 0, 1 ); |
2408 | if ( result != 0 ) { | 2426 | if ( result != 0 ) { |
2409 | loadbup = false; | 2427 | loadbup = false; |
2410 | } | 2428 | } |
2411 | } else { | 2429 | } else { |
2412 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2430 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2413 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 2431 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
2414 | 0, 1 ); | 2432 | 0, 1 ); |
2415 | 2433 | ||
2416 | return; | 2434 | return; |
2417 | } | 2435 | } |
2418 | if ( loadbup ) { | 2436 | if ( loadbup ) { |
2419 | mView->openCalendar( fn ); | 2437 | mView->openCalendar( fn ); |
2420 | KOPrefs::instance()->mLastLoadFile = fn; | 2438 | KOPrefs::instance()->mLastLoadFile = fn; |
2421 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 2439 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
2422 | setCaption(mess); | 2440 | setCaption(mess); |
2423 | } | 2441 | } |
2424 | #endif | 2442 | #endif |
2425 | 2443 | ||
2426 | } | 2444 | } |
2427 | void MainWindow::quickImportIcal() | 2445 | void MainWindow::quickImportIcal() |
2428 | { | 2446 | { |
2429 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 2447 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
2430 | } | 2448 | } |
2431 | void MainWindow::importFile( QString fn, bool quick ) | 2449 | void MainWindow::importFile( QString fn, bool quick ) |
2432 | { | 2450 | { |
2433 | QFileInfo info; | 2451 | QFileInfo info; |
2434 | info.setFile( fn ); | 2452 | info.setFile( fn ); |
2435 | QString mess; | 2453 | QString mess; |
2436 | if ( !info. exists() ) { | 2454 | if ( !info. exists() ) { |
2437 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 2455 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
2438 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2456 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2439 | mess ); | 2457 | mess ); |
2440 | return; | 2458 | return; |
2441 | } | 2459 | } |
2442 | int result = 0; | 2460 | int result = 0; |
2443 | if ( !quick ) { | 2461 | if ( !quick ) { |
2444 | 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 )); | 2462 | 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 )); |
2445 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2463 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2446 | mess, | 2464 | mess, |
2447 | "Import", "Cancel", 0, | 2465 | "Import", "Cancel", 0, |
2448 | 0, 1 ); | 2466 | 0, 1 ); |
2449 | } | 2467 | } |
2450 | if ( result == 0 ) { | 2468 | if ( result == 0 ) { |
2451 | if ( mView->openCalendar( fn, true )) { | 2469 | if ( mView->openCalendar( fn, true )) { |
2452 | KOPrefs::instance()->mLastImportFile = fn; | 2470 | KOPrefs::instance()->mLastImportFile = fn; |
2453 | setCaption(i18n("Imported file successfully")); | 2471 | setCaption(i18n("Imported file successfully")); |
2454 | } else { | 2472 | } else { |
2455 | setCaption(i18n("Error importing file")); | 2473 | setCaption(i18n("Error importing file")); |
2456 | } | 2474 | } |
2457 | } | 2475 | } |
2458 | } | 2476 | } |
2459 | 2477 | ||
2460 | void MainWindow::importIcal() | 2478 | void MainWindow::importIcal() |
2461 | { | 2479 | { |
2462 | 2480 | ||
2463 | QString fn =KOPrefs::instance()->mLastImportFile; | 2481 | QString fn =KOPrefs::instance()->mLastImportFile; |
2464 | 2482 | ||
2465 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 2483 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
2466 | if ( fn == "" ) | 2484 | if ( fn == "" ) |
2467 | return; | 2485 | return; |
2468 | importFile( fn, true ); | 2486 | importFile( fn, true ); |
2469 | 2487 | ||
2470 | } | 2488 | } |
2471 | 2489 | ||
2472 | void MainWindow::exportVCalendar() | 2490 | void MainWindow::exportVCalendar() |
2473 | { | 2491 | { |
2474 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2492 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2475 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2493 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
2476 | if ( fn == "" ) | 2494 | if ( fn == "" ) |
2477 | return; | 2495 | return; |
2478 | QFileInfo info; | 2496 | QFileInfo info; |
2479 | info.setFile( fn ); | 2497 | info.setFile( fn ); |
2480 | QString mes; | 2498 | QString mes; |
2481 | bool createbup = true; | 2499 | bool createbup = true; |
2482 | if ( info. exists() ) { | 2500 | if ( info. exists() ) { |
2483 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 2501 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
2484 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 2502 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
2485 | i18n("Overwrite!"), i18n("Cancel"), 0, | 2503 | i18n("Overwrite!"), i18n("Cancel"), 0, |
2486 | 0, 1 ); | 2504 | 0, 1 ); |
2487 | if ( result != 0 ) { | 2505 | if ( result != 0 ) { |
2488 | createbup = false; | 2506 | createbup = false; |
2489 | } | 2507 | } |
2490 | } | 2508 | } |
2491 | if ( createbup ) { | 2509 | if ( createbup ) { |
2492 | if ( mView->exportVCalendar( fn ) ) { | 2510 | if ( mView->exportVCalendar( fn ) ) { |
2493 | KOPrefs::instance()->mLastVcalFile = fn; | 2511 | KOPrefs::instance()->mLastVcalFile = fn; |
2494 | if ( fn.length() > 20 ) | 2512 | if ( fn.length() > 20 ) |
2495 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 2513 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
2496 | else | 2514 | else |
2497 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 2515 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
2498 | setCaption(mes); | 2516 | setCaption(mes); |
2499 | } | 2517 | } |
2500 | } | 2518 | } |
2501 | 2519 | ||
2502 | } | 2520 | } |
2503 | QString MainWindow::sentSyncFile() | 2521 | QString MainWindow::sentSyncFile() |
2504 | { | 2522 | { |
2505 | #ifdef DESKTOP_VERSION | 2523 | #ifdef DESKTOP_VERSION |
2506 | return locateLocal( "tmp", "copysynccal.ics" ); | 2524 | return locateLocal( "tmp", "copysynccal.ics" ); |
2507 | #else | 2525 | #else |
2508 | return QString( "/tmp/copysynccal.ics" ); | 2526 | return QString( "/tmp/copysynccal.ics" ); |
2509 | #endif | 2527 | #endif |
2510 | } | 2528 | } |
2511 | 2529 | ||
2512 | void MainWindow::syncFileRequest() | 2530 | void MainWindow::syncFileRequest() |
2513 | { | 2531 | { |
2514 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2532 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2515 | mSyncManager->slotSyncMenu( 999 ); | 2533 | mSyncManager->slotSyncMenu( 999 ); |
2516 | } | 2534 | } |
2517 | 2535 | ||
2518 | setCaption(i18n("Saving Data to temp file ..." )); | 2536 | setCaption(i18n("Saving Data to temp file ..." )); |
2519 | mView->saveCalendar( sentSyncFile() ); | 2537 | mView->saveCalendar( sentSyncFile() ); |
2520 | setCaption(i18n("Data saved to temp file!" )); | 2538 | setCaption(i18n("Data saved to temp file!" )); |
2521 | 2539 | ||
2522 | } | 2540 | } |
2523 | void MainWindow::getFile( bool success ) | 2541 | void MainWindow::getFile( bool success ) |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 41d5807..d648f14 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,173 +1,174 @@ | |||
1 | #ifndef KORGE_MAINWINDOW_H | 1 | #ifndef KORGE_MAINWINDOW_H |
2 | #define KORGE_MAINWINDOW_H | 2 | #define KORGE_MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qdict.h> | 6 | #include <qdict.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qmenubar.h> | 8 | #include <qmenubar.h> |
9 | #include <qtextstream.h> | 9 | #include <qtextstream.h> |
10 | #include <qregexp.h> | 10 | #include <qregexp.h> |
11 | 11 | ||
12 | #include <libkcal/incidence.h> | 12 | #include <libkcal/incidence.h> |
13 | #include <ksyncmanager.h> | 13 | #include <ksyncmanager.h> |
14 | #ifndef DESKTOP_VERSION | 14 | #ifndef DESKTOP_VERSION |
15 | #include <qcopchannel_qws.h> | 15 | #include <qcopchannel_qws.h> |
16 | #endif | 16 | #endif |
17 | class QAction; | 17 | class QAction; |
18 | class CalendarView; | 18 | class CalendarView; |
19 | class KSyncProfile; | 19 | class KSyncProfile; |
20 | #ifdef DESKTOP_VERSION | 20 | #ifdef DESKTOP_VERSION |
21 | 21 | ||
22 | #define QPEToolBar QToolBar | 22 | #define QPEToolBar QToolBar |
23 | #define QPEMenuBar QMenuBar | 23 | #define QPEMenuBar QMenuBar |
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | class QPEMenuBar; | 26 | class QPEMenuBar; |
27 | 27 | ||
28 | 28 | ||
29 | namespace KCal { | 29 | namespace KCal { |
30 | class CalendarLocal; | 30 | class CalendarLocal; |
31 | } | 31 | } |
32 | 32 | ||
33 | using namespace KCal; | 33 | using namespace KCal; |
34 | 34 | ||
35 | class MainWindow : public QMainWindow | 35 | class MainWindow : public QMainWindow |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | MainWindow( QWidget *parent = 0, const char *name = 0 ); | 39 | MainWindow( QWidget *parent = 0, const char *name = 0 ); |
40 | ~MainWindow(); | 40 | ~MainWindow(); |
41 | bool beamReceiveEnabled(); | 41 | bool beamReceiveEnabled(); |
42 | static QString defaultFileName(); | 42 | static QString defaultFileName(); |
43 | static QString syncFileName(); | 43 | static QString syncFileName(); |
44 | static QString resourcePath(); | 44 | static QString resourcePath(); |
45 | public slots: | 45 | public slots: |
46 | void setUsesBigPixmaps ( bool ); | 46 | void setUsesBigPixmaps ( bool ); |
47 | void setCaption ( const QString & ); | 47 | void setCaption ( const QString & ); |
48 | void updateWeekNum(const KCal::DateList &); | 48 | void updateWeekNum(const KCal::DateList &); |
49 | void updateWeek(QDate); | 49 | void updateWeek(QDate); |
50 | void updateFilterToolbar(); | 50 | void updateFilterToolbar(); |
51 | virtual void showMaximized (); | 51 | virtual void showMaximized (); |
52 | void configureAgenda( int ); | 52 | void configureAgenda( int ); |
53 | void recieve( const QCString& msg, const QByteArray& data ); | 53 | void recieve( const QCString& msg, const QByteArray& data ); |
54 | protected slots: | 54 | protected slots: |
55 | void calHint(); | 55 | void calHint(); |
56 | void startMultiSync(); | 56 | void startMultiSync(); |
57 | void setCaptionToDates(); | 57 | void setCaptionToDates(); |
58 | void weekAction(); | 58 | void weekAction(); |
59 | void about(); | 59 | void about(); |
60 | void licence(); | 60 | void licence(); |
61 | void faq(); | 61 | void faq(); |
62 | void usertrans(); | 62 | void usertrans(); |
63 | void features(); | 63 | void features(); |
64 | void synchowto(); | 64 | void synchowto(); |
65 | void storagehowto(); | 65 | void storagehowto(); |
66 | void timetrackinghowto(); | 66 | void timetrackinghowto(); |
67 | void kdesynchowto(); | 67 | void kdesynchowto(); |
68 | void multisynchowto(); | 68 | void multisynchowto(); |
69 | void whatsNew(); | 69 | void whatsNew(); |
70 | void keyBindings(); | 70 | void keyBindings(); |
71 | void aboutAutoSaving();; | 71 | void aboutAutoSaving();; |
72 | void aboutKnownBugs(); | 72 | void aboutKnownBugs(); |
73 | 73 | ||
74 | void processIncidenceSelection( Incidence * ); | 74 | void processIncidenceSelection( Incidence * ); |
75 | 75 | ||
76 | void importQtopia(); | 76 | void importQtopia(); |
77 | void importBday(); | 77 | void importBday(); |
78 | void importOL(); | 78 | void importOL(); |
79 | void importIcal(); | 79 | void importIcal(); |
80 | void importFile( QString, bool ); | 80 | void importFile( QString, bool ); |
81 | void quickImportIcal(); | 81 | void quickImportIcal(); |
82 | 82 | ||
83 | void slotModifiedChanged( bool ); | 83 | void slotModifiedChanged( bool ); |
84 | 84 | ||
85 | void save(); | 85 | void save(); |
86 | void backupAllFiles(); | 86 | void backupAllFiles(); |
87 | void saveStopTimer(); | 87 | void saveStopTimer(); |
88 | void configureToolBar( int ); | 88 | void configureToolBar( int ); |
89 | void printSel(); | 89 | void printSel(); |
90 | void printCal(); | 90 | void printCal(); |
91 | void printListView(); | 91 | void printListView(); |
92 | void saveCalendar(); | 92 | void saveCalendar(); |
93 | void loadCalendar(); | 93 | void loadCalendar(); |
94 | void exportVCalendar(); | 94 | void exportVCalendar(); |
95 | void fillFilterMenu(); | 95 | void fillFilterMenu(); |
96 | void fillFilterMenuTB(); | 96 | void fillFilterMenuTB(); |
97 | void selectFilter( int ); | 97 | void selectFilter( int ); |
98 | void fillFilterMenuPopup(); | 98 | void fillFilterMenuPopup(); |
99 | void selectFilterPopup( int ); | 99 | void selectFilterPopup( int ); |
100 | void exportToPhone( int ); | 100 | void exportToPhone( int ); |
101 | void toggleBeamReceive(); | 101 | void toggleBeamReceive(); |
102 | void disableBR(bool); | 102 | void disableBR(bool); |
103 | signals: | 103 | signals: |
104 | void selectWeek ( int ); | 104 | void selectWeek ( int ); |
105 | private slots: | 105 | private slots: |
106 | void showConfigureAgenda(); | 106 | void showConfigureAgenda(); |
107 | void getFile( bool ); | 107 | void getFile( bool ); |
108 | void syncFileRequest(); | 108 | void syncFileRequest(); |
109 | 109 | ||
110 | protected: | 110 | protected: |
111 | void hideEvent ( QHideEvent * ); | 111 | void hideEvent ( QHideEvent * ); |
112 | QString sentSyncFile(); | 112 | QString sentSyncFile(); |
113 | void displayText( QString, QString); | 113 | void displayText( QString, QString); |
114 | void enableIncidenceActions( bool ); | 114 | void enableIncidenceActions( bool ); |
115 | 115 | ||
116 | private: | 116 | private: |
117 | bool mBRdisabled; | 117 | bool mBRdisabled; |
118 | #ifndef DESKTOP_VERSION | 118 | #ifndef DESKTOP_VERSION |
119 | QCopChannel* infrared; | 119 | QCopChannel* infrared; |
120 | #endif | 120 | #endif |
121 | QAction* brAction; | 121 | QAction* brAction; |
122 | KSyncManager* mSyncManager; | 122 | KSyncManager* mSyncManager; |
123 | bool mClosed; | 123 | bool mClosed; |
124 | void saveOnClose(); | 124 | void saveOnClose(); |
125 | bool mFlagKeyPressed; | 125 | bool mFlagKeyPressed; |
126 | bool mBlockAtStartup; | 126 | bool mBlockAtStartup; |
127 | QPEToolBar *iconToolBar; | 127 | QPEToolBar *iconToolBar; |
128 | QPEToolBar *viewToolBar; | 128 | QPEToolBar *viewToolBar; |
129 | QPEToolBar *navigatorToolBar; | 129 | QPEToolBar *navigatorToolBar; |
130 | QPEToolBar *filterToolBar; | 130 | QPEToolBar *filterToolBar; |
131 | QMenuBar *filterMenubar; | 131 | QMenuBar *filterMenubar; |
132 | QPopupMenu * filterPopupMenu; | 132 | QPopupMenu * filterPopupMenu; |
133 | QPopupMenu * mCurrentItemMenu; | 133 | QPopupMenu * mCurrentItemMenu; |
134 | void initActions(); | 134 | void initActions(); |
135 | void setDefaultPreferences(); | 135 | void setDefaultPreferences(); |
136 | void resizeEvent( QResizeEvent* e); | 136 | void resizeEvent( QResizeEvent* e); |
137 | void keyPressEvent ( QKeyEvent * ) ; | 137 | void keyPressEvent ( QKeyEvent * ) ; |
138 | void keyReleaseEvent ( QKeyEvent * ) ; | 138 | void keyReleaseEvent ( QKeyEvent * ) ; |
139 | QPopupMenu *configureToolBarMenu; | 139 | QPopupMenu *configureToolBarMenu; |
140 | QPopupMenu *selectFilterMenu; | 140 | QPopupMenu *selectFilterMenu; |
141 | QPopupMenu *selectFilterMenuTB; | 141 | QPopupMenu *selectFilterMenuTB; |
142 | QPopupMenu *configureAgendaMenu, *syncMenu; | 142 | QPopupMenu *configureAgendaMenu, *syncMenu; |
143 | CalendarLocal *mCalendar; | 143 | CalendarLocal *mCalendar; |
144 | CalendarView *mView; | 144 | CalendarView *mView; |
145 | QAction *mNewSubTodoAction; | 145 | QAction *mNewSubTodoAction; |
146 | QAction *mWeekAction; | 146 | QAction *mWeekAction; |
147 | QFont mWeekFont; | 147 | QFont mWeekFont; |
148 | QPixmap mWeekPixmap; | 148 | QPixmap mWeekPixmap; |
149 | QColor mWeekBgColor; | 149 | QColor mWeekBgColor; |
150 | 150 | ||
151 | QAction *mShowAction; | 151 | QAction *mShowAction; |
152 | QAction *mEditAction; | 152 | QAction *mEditAction; |
153 | QAction *mDeleteAction; | 153 | QAction *mDeleteAction; |
154 | QAction *mCloneAction; | 154 | QAction *mCloneAction; |
155 | QAction *mMoveAction; | 155 | QAction *mMoveAction; |
156 | QAction *mBeamAction; | 156 | QAction *mBeamAction; |
157 | QAction *mCancelAction; | 157 | QAction *mCancelAction; |
158 | QAction *mPrintSelAction; | ||
158 | 159 | ||
159 | QAction *mToggleNav; | 160 | QAction *mToggleNav; |
160 | QAction *mToggleFilter; | 161 | QAction *mToggleFilter; |
161 | QAction *mToggleAllday; | 162 | QAction *mToggleAllday; |
162 | QAction *actionFilterMenuTB; | 163 | QAction *actionFilterMenuTB; |
163 | 164 | ||
164 | void closeEvent( QCloseEvent* ce ); | 165 | void closeEvent( QCloseEvent* ce ); |
165 | QTimer mSaveTimer; | 166 | QTimer mSaveTimer; |
166 | //bool mBlockSaveFlag; | 167 | //bool mBlockSaveFlag; |
167 | bool mCalendarModifiedFlag; | 168 | bool mCalendarModifiedFlag; |
168 | QPixmap loadPixmap( QString ); | 169 | QPixmap loadPixmap( QString ); |
169 | QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; | 170 | QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; |
170 | }; | 171 | }; |
171 | 172 | ||
172 | 173 | ||
173 | #endif | 174 | #endif |