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