author | zautrix <zautrix> | 2005-03-08 11:09:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-08 11:09:44 (UTC) |
commit | 90f53697a44fdcccec00ef8c53fe5c9c15aca713 (patch) (unidiff) | |
tree | 85d2e38b4ccffbc5414c22938d8c6fccd3cf8b58 /korganizer | |
parent | 91e7aeec0b15d28eb263c0699fdce4a00a3669c6 (diff) | |
download | kdepimpi-90f53697a44fdcccec00ef8c53fe5c9c15aca713.zip kdepimpi-90f53697a44fdcccec00ef8c53fe5c9c15aca713.tar.gz kdepimpi-90f53697a44fdcccec00ef8c53fe5c9c15aca713.tar.bz2 |
menu cleanup
-rw-r--r-- | korganizer/kodialogmanager.cpp | 87 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 59 |
2 files changed, 78 insertions, 68 deletions
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index 41a4dc1..1af9dad 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -1,346 +1,349 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2001 | 4 | Copyright (c) 2001 |
5 | Cornelius Schumacher <schumacher@kde.org> | 5 | Cornelius Schumacher <schumacher@kde.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <libkdepim/categoryeditdialog.h> | 22 | #include <libkdepim/categoryeditdialog.h> |
23 | 23 | ||
24 | #include "calendarview.h" | 24 | #include "calendarview.h" |
25 | #include "incomingdialog.h" | 25 | #include "incomingdialog.h" |
26 | #include "outgoingdialog.h" | 26 | #include "outgoingdialog.h" |
27 | #include "koprefsdialog.h" | 27 | #include "koprefsdialog.h" |
28 | #include "koeventeditor.h" | 28 | #include "koeventeditor.h" |
29 | #include "koprefs.h" | 29 | #include "koprefs.h" |
30 | #include "datenavigator.h" | 30 | #include "datenavigator.h" |
31 | #include "kotodoeditor.h" | 31 | #include "kotodoeditor.h" |
32 | #include "searchdialog.h" | 32 | #include "searchdialog.h" |
33 | #include "filtereditdialog.h" | 33 | #include "filtereditdialog.h" |
34 | #ifndef KORG_NOPLUGINS | 34 | #ifndef KORG_NOPLUGINS |
35 | #include "plugindialog.h" | 35 | #include "plugindialog.h" |
36 | #endif | 36 | #endif |
37 | #ifndef KORG_NOARCHIVE | 37 | #ifndef KORG_NOARCHIVE |
38 | #include "archivedialog.h" | 38 | #include "archivedialog.h" |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #include "kconfig.h" | 41 | #include "kconfig.h" |
42 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
43 | 43 | ||
44 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 44 | KODialogManager::KODialogManager( CalendarView *mainView ) : |
45 | QObject(), mMainView( mainView ) | 45 | QObject(), mMainView( mainView ) |
46 | { | 46 | { |
47 | mOutgoingDialog = 0; | 47 | mOutgoingDialog = 0; |
48 | mIncomingDialog = 0; | 48 | mIncomingDialog = 0; |
49 | mOptionsDialog = 0; | 49 | mOptionsDialog = 0; |
50 | mSearchDialog = 0; | 50 | mSearchDialog = 0; |
51 | mArchiveDialog = 0; | 51 | mArchiveDialog = 0; |
52 | mFilterEditDialog = 0; | 52 | mFilterEditDialog = 0; |
53 | mPluginDialog = 0; | 53 | mPluginDialog = 0; |
54 | 54 | ||
55 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); | 55 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); |
56 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); | 56 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); |
57 | } | 57 | } |
58 | 58 | ||
59 | KODialogManager::~KODialogManager() | 59 | KODialogManager::~KODialogManager() |
60 | { | 60 | { |
61 | delete mOutgoingDialog; | 61 | delete mOutgoingDialog; |
62 | delete mIncomingDialog; | 62 | delete mIncomingDialog; |
63 | delete mOptionsDialog; | 63 | delete mOptionsDialog; |
64 | delete mSearchDialog; | 64 | delete mSearchDialog; |
65 | #ifndef KORG_NOARCHIVE | 65 | #ifndef KORG_NOARCHIVE |
66 | delete mArchiveDialog; | 66 | delete mArchiveDialog; |
67 | #endif | 67 | #endif |
68 | delete mFilterEditDialog; | 68 | delete mFilterEditDialog; |
69 | #ifndef KORG_NOPLUGINS | 69 | #ifndef KORG_NOPLUGINS |
70 | delete mPluginDialog; | 70 | delete mPluginDialog; |
71 | #endif | 71 | #endif |
72 | } | 72 | } |
73 | 73 | ||
74 | OutgoingDialog *KODialogManager::outgoingDialog() | 74 | OutgoingDialog *KODialogManager::outgoingDialog() |
75 | { | 75 | { |
76 | createOutgoingDialog(); | 76 | createOutgoingDialog(); |
77 | return mOutgoingDialog; | 77 | return mOutgoingDialog; |
78 | } | 78 | } |
79 | 79 | ||
80 | void KODialogManager::createOutgoingDialog() | 80 | void KODialogManager::createOutgoingDialog() |
81 | { | 81 | { |
82 | if (!mOutgoingDialog) { | 82 | if (!mOutgoingDialog) { |
83 | mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); | 83 | mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); |
84 | if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); | 84 | if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); |
85 | connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), | 85 | connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), |
86 | mMainView,SIGNAL(numOutgoingChanged(int))); | 86 | mMainView,SIGNAL(numOutgoingChanged(int))); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void KODialogManager::showOptionsDialog( bool showSync ) | 90 | void KODialogManager::showOptionsDialog( bool showSync ) |
91 | { | 91 | { |
92 | 92 | ||
93 | if (!mOptionsDialog) { | 93 | if (!mOptionsDialog) { |
94 | mOptionsDialog = new KOPrefsDialog(mMainView); | 94 | mOptionsDialog = new KOPrefsDialog(mMainView); |
95 | //mOptionsDialog->readConfig(); | 95 | //mOptionsDialog->readConfig(); |
96 | connect(mOptionsDialog,SIGNAL(configChanged()), | 96 | connect(mOptionsDialog,SIGNAL(configChanged()), |
97 | mMainView,SLOT(updateConfig())); | 97 | mMainView,SLOT(updateConfig())); |
98 | //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 98 | //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
99 | // mOptionsDialog,SLOT(updateCategories())); | 99 | // mOptionsDialog,SLOT(updateCategories())); |
100 | 100 | ||
101 | } | 101 | } |
102 | mOptionsDialog->readConfig(); | 102 | mOptionsDialog->readConfig(); |
103 | #ifndef DESKTOP_VERSION | 103 | #ifndef DESKTOP_VERSION |
104 | mOptionsDialog->showMaximized(); | 104 | mOptionsDialog->showMaximized(); |
105 | #else | 105 | #else |
106 | mOptionsDialog->show(); | 106 | mOptionsDialog->show(); |
107 | #endif | 107 | #endif |
108 | if ( showSync ) | 108 | if ( showSync ) |
109 | mOptionsDialog->showSyncPage(); | 109 | mOptionsDialog->showSyncPage(); |
110 | mOptionsDialog->exec(); | 110 | mOptionsDialog->exec(); |
111 | 111 | ||
112 | } | 112 | } |
113 | void KODialogManager::showSyncOptions() | 113 | void KODialogManager::showSyncOptions() |
114 | { | 114 | { |
115 | showOptionsDialog( true ); | 115 | showOptionsDialog( true ); |
116 | 116 | ||
117 | } | 117 | } |
118 | void KODialogManager::showOutgoingDialog() | 118 | void KODialogManager::showOutgoingDialog() |
119 | { | 119 | { |
120 | createOutgoingDialog(); | 120 | createOutgoingDialog(); |
121 | mOutgoingDialog->show(); | 121 | mOutgoingDialog->show(); |
122 | mOutgoingDialog->raise(); | 122 | mOutgoingDialog->raise(); |
123 | } | 123 | } |
124 | 124 | ||
125 | IncomingDialog *KODialogManager::incomingDialog() | 125 | IncomingDialog *KODialogManager::incomingDialog() |
126 | { | 126 | { |
127 | createOutgoingDialog(); | 127 | createOutgoingDialog(); |
128 | if (!mIncomingDialog) { | 128 | if (!mIncomingDialog) { |
129 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); | 129 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); |
130 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), | 130 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), |
131 | mMainView,SIGNAL(numIncomingChanged(int))); | 131 | mMainView,SIGNAL(numIncomingChanged(int))); |
132 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), | 132 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), |
133 | mMainView,SLOT(updateView())); | 133 | mMainView,SLOT(updateView())); |
134 | } | 134 | } |
135 | return mIncomingDialog; | 135 | return mIncomingDialog; |
136 | } | 136 | } |
137 | 137 | ||
138 | void KODialogManager::createIncomingDialog() | 138 | void KODialogManager::createIncomingDialog() |
139 | { | 139 | { |
140 | createOutgoingDialog(); | 140 | createOutgoingDialog(); |
141 | if (!mIncomingDialog) { | 141 | if (!mIncomingDialog) { |
142 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); | 142 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); |
143 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), | 143 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), |
144 | mMainView,SIGNAL(numIncomingChanged(int))); | 144 | mMainView,SIGNAL(numIncomingChanged(int))); |
145 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), | 145 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), |
146 | mMainView,SLOT(updateView())); | 146 | mMainView,SLOT(updateView())); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | void KODialogManager::showIncomingDialog() | 150 | void KODialogManager::showIncomingDialog() |
151 | { | 151 | { |
152 | createIncomingDialog(); | 152 | createIncomingDialog(); |
153 | mIncomingDialog->show(); | 153 | mIncomingDialog->show(); |
154 | mIncomingDialog->raise(); | 154 | mIncomingDialog->raise(); |
155 | } | 155 | } |
156 | /* | 156 | /* |
157 | void KODialogManager::showCategoryEditDialog() | 157 | void KODialogManager::showCategoryEditDialog() |
158 | { | 158 | { |
159 | mCategoryEditDialog->show(); | 159 | mCategoryEditDialog->show(); |
160 | } | 160 | } |
161 | */ | 161 | */ |
162 | void KODialogManager::hideSearchDialog() | 162 | void KODialogManager::hideSearchDialog() |
163 | { | 163 | { |
164 | if (mSearchDialog) | 164 | if (mSearchDialog) |
165 | mSearchDialog->hide(); | 165 | mSearchDialog->hide(); |
166 | } | 166 | } |
167 | 167 | ||
168 | void KODialogManager::showSearchDialog() | 168 | void KODialogManager::showSearchDialog() |
169 | { | 169 | { |
170 | if (!mSearchDialog) { | 170 | if (!mSearchDialog) { |
171 | mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); | 171 | mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); |
172 | KOListView * lview = mSearchDialog->listview(); | 172 | KOListView * lview = mSearchDialog->listview(); |
173 | 173 | ||
174 | connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), | 174 | connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), |
175 | mMainView, SLOT(showIncidence(Incidence *))); | 175 | mMainView, SLOT(showIncidence(Incidence *))); |
176 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), | 176 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), |
177 | mMainView, SLOT(editIncidence(Incidence *))); | 177 | mMainView, SLOT(editIncidence(Incidence *))); |
178 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), | 178 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), |
179 | mMainView, SLOT(deleteIncidence(Incidence *))); | 179 | mMainView, SLOT(deleteIncidence(Incidence *))); |
180 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), | 180 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), |
181 | mMainView, SLOT(cloneIncidence(Incidence *))); | 181 | mMainView, SLOT(cloneIncidence(Incidence *))); |
182 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), | 182 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), |
183 | mMainView, SLOT(beamIncidence(Incidence *))); | 183 | mMainView, SLOT(beamIncidence(Incidence *))); |
184 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), | 184 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), |
185 | mMainView, SLOT(moveIncidence(Incidence *))); | 185 | mMainView, SLOT(moveIncidence(Incidence *))); |
186 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), | 186 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), |
187 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); | 187 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); |
188 | 188 | ||
189 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); | 189 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); |
190 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); | 190 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); |
191 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), | 191 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), |
192 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 192 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
193 | #ifndef DESKTOP_VERSION | 193 | #ifndef DESKTOP_VERSION |
194 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | 194 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
195 | //mSearchDialog->setGeometry( 40,40, 400, 300); | 195 | mSearchDialog->showMaximized(); |
196 | mSearchDialog->showMaximized(); | ||
197 | #else | 196 | #else |
198 | KConfig *config = KOGlobals::config(); | 197 | KConfig *config = KOGlobals::config(); |
199 | config->setGroup("WidgetLayout"); | 198 | config->setGroup("WidgetLayout"); |
200 | QStringList list; | 199 | QStringList list; |
201 | list = config->readListEntry("SearchLayout"); | 200 | list = config->readListEntry("SearchLayout"); |
202 | int x,y,w,h; | 201 | int x,y,w,h; |
203 | if ( ! list.isEmpty() ) { | 202 | if ( ! list.isEmpty() ) { |
204 | x = list[0].toInt(); | 203 | x = list[0].toInt(); |
205 | y = list[1].toInt(); | 204 | y = list[1].toInt(); |
206 | w = list[2].toInt(); | 205 | w = list[2].toInt(); |
207 | h = list[3].toInt(); | 206 | h = list[3].toInt(); |
208 | mSearchDialog->setGeometry(x,y,w,h); | 207 | mSearchDialog->setGeometry(x,y,w,h); |
209 | 208 | ||
210 | } | 209 | } |
211 | 210 | ||
212 | #endif | 211 | #endif |
213 | } | 212 | } |
214 | // make sure the widget is on top again | 213 | // make sure the widget is on top again |
215 | mSearchDialog->show(); | 214 | #ifdef DESKTOP_VERSION |
216 | mSearchDialog->raise(); | 215 | mSearchDialog->show(); |
216 | #else | ||
217 | mSearchDialog->showMaximized(); | ||
218 | #endif | ||
219 | mSearchDialog->raise(); | ||
217 | } | 220 | } |
218 | 221 | ||
219 | SearchDialog * KODialogManager::getSearchDialog() | 222 | SearchDialog * KODialogManager::getSearchDialog() |
220 | { | 223 | { |
221 | return mSearchDialog; | 224 | return mSearchDialog; |
222 | } | 225 | } |
223 | void KODialogManager::showArchiveDialog() | 226 | void KODialogManager::showArchiveDialog() |
224 | { | 227 | { |
225 | #ifndef KORG_NOARCHIVE | 228 | #ifndef KORG_NOARCHIVE |
226 | if (!mArchiveDialog) { | 229 | if (!mArchiveDialog) { |
227 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); | 230 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); |
228 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), | 231 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), |
229 | mMainView,SLOT(updateView())); | 232 | mMainView,SLOT(updateView())); |
230 | } | 233 | } |
231 | mArchiveDialog->show(); | 234 | mArchiveDialog->show(); |
232 | mArchiveDialog->raise(); | 235 | mArchiveDialog->raise(); |
233 | 236 | ||
234 | // Workaround. | 237 | // Workaround. |
235 | QApplication::restoreOverrideCursor(); | 238 | QApplication::restoreOverrideCursor(); |
236 | #endif | 239 | #endif |
237 | } | 240 | } |
238 | 241 | ||
239 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 242 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) |
240 | { | 243 | { |
241 | if (!mFilterEditDialog) { | 244 | if (!mFilterEditDialog) { |
242 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); | 245 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); |
243 | connect(mFilterEditDialog,SIGNAL(filterChanged()), | 246 | connect(mFilterEditDialog,SIGNAL(filterChanged()), |
244 | mMainView,SLOT(filterEdited())); | 247 | mMainView,SLOT(filterEdited())); |
245 | 248 | ||
246 | } | 249 | } |
247 | 250 | ||
248 | #ifndef DESKTOP_VERSION | 251 | #ifndef DESKTOP_VERSION |
249 | mFilterEditDialog->showMaximized(); | 252 | mFilterEditDialog->showMaximized(); |
250 | #else | 253 | #else |
251 | mFilterEditDialog->show(); | 254 | mFilterEditDialog->show(); |
252 | #endif | 255 | #endif |
253 | mFilterEditDialog->raise(); | 256 | mFilterEditDialog->raise(); |
254 | } | 257 | } |
255 | 258 | ||
256 | void KODialogManager::showPluginDialog() | 259 | void KODialogManager::showPluginDialog() |
257 | { | 260 | { |
258 | #ifndef KORG_NOPLUGINS | 261 | #ifndef KORG_NOPLUGINS |
259 | if (!mPluginDialog) { | 262 | if (!mPluginDialog) { |
260 | mPluginDialog = new PluginDialog(mMainView); | 263 | mPluginDialog = new PluginDialog(mMainView); |
261 | connect(mPluginDialog,SIGNAL(configChanged()), | 264 | connect(mPluginDialog,SIGNAL(configChanged()), |
262 | mMainView,SLOT(updateConfig())); | 265 | mMainView,SLOT(updateConfig())); |
263 | } | 266 | } |
264 | mPluginDialog->show(); | 267 | mPluginDialog->show(); |
265 | mPluginDialog->raise(); | 268 | mPluginDialog->raise(); |
266 | #endif | 269 | #endif |
267 | } | 270 | } |
268 | 271 | ||
269 | KOEventEditor *KODialogManager::getEventEditor() | 272 | KOEventEditor *KODialogManager::getEventEditor() |
270 | { | 273 | { |
271 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), | 274 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), |
272 | mMainView ); | 275 | mMainView ); |
273 | 276 | ||
274 | connect(eventEditor,SIGNAL(eventAdded(Event *)), | 277 | connect(eventEditor,SIGNAL(eventAdded(Event *)), |
275 | mMainView,SLOT(eventAdded(Event *))); | 278 | mMainView,SLOT(eventAdded(Event *))); |
276 | connect(eventEditor,SIGNAL(eventChanged(Event *)), | 279 | connect(eventEditor,SIGNAL(eventChanged(Event *)), |
277 | mMainView,SLOT(eventChanged(Event *))); | 280 | mMainView,SLOT(eventChanged(Event *))); |
278 | connect(eventEditor,SIGNAL(eventDeleted()), | 281 | connect(eventEditor,SIGNAL(eventDeleted()), |
279 | mMainView,SLOT(eventDeleted())); | 282 | mMainView,SLOT(eventDeleted())); |
280 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), | 283 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), |
281 | mMainView,SLOT(schedule_cancel(Incidence *))); | 284 | mMainView,SLOT(schedule_cancel(Incidence *))); |
282 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), | 285 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), |
283 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 286 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
284 | connect( eventEditor, SIGNAL( showAgendaView( bool)), | 287 | connect( eventEditor, SIGNAL( showAgendaView( bool)), |
285 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 288 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
286 | 289 | ||
287 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 290 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
288 | // eventEditor,SLOT(updateCategoryConfig())); | 291 | // eventEditor,SLOT(updateCategoryConfig())); |
289 | // connect(eventEditor,SIGNAL(editCategories()), | 292 | // connect(eventEditor,SIGNAL(editCategories()), |
290 | // mCategoryEditDialog,SLOT(show())); | 293 | // mCategoryEditDialog,SLOT(show())); |
291 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), | 294 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), |
292 | mMainView,SLOT(dialogClosing(Incidence*))); | 295 | mMainView,SLOT(dialogClosing(Incidence*))); |
293 | 296 | ||
294 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); | 297 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); |
295 | 298 | ||
296 | #ifndef DESKTOP_VERSION | 299 | #ifndef DESKTOP_VERSION |
297 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); | 300 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); |
298 | #endif | 301 | #endif |
299 | return eventEditor; | 302 | return eventEditor; |
300 | } | 303 | } |
301 | 304 | ||
302 | KOTodoEditor *KODialogManager::getTodoEditor() | 305 | KOTodoEditor *KODialogManager::getTodoEditor() |
303 | { | 306 | { |
304 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), | 307 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), |
305 | mMainView ); | 308 | mMainView ); |
306 | 309 | ||
307 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 310 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
308 | // todoEditor,SLOT(updateCategoryConfig())); | 311 | // todoEditor,SLOT(updateCategoryConfig())); |
309 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); | 312 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); |
310 | 313 | ||
311 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), | 314 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), |
312 | mMainView,SLOT(todoAdded(Todo *))); | 315 | mMainView,SLOT(todoAdded(Todo *))); |
313 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), | 316 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), |
314 | mMainView,SLOT(todoChanged(Todo *))); | 317 | mMainView,SLOT(todoChanged(Todo *))); |
315 | connect(todoEditor,SIGNAL(todoDeleted()), | 318 | connect(todoEditor,SIGNAL(todoDeleted()), |
316 | mMainView,SLOT(todoDeleted())); | 319 | mMainView,SLOT(todoDeleted())); |
317 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), | 320 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), |
318 | mMainView,SLOT(dialogClosing(Incidence*))); | 321 | mMainView,SLOT(dialogClosing(Incidence*))); |
319 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), | 322 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), |
320 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 323 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
321 | connect( todoEditor, SIGNAL( showAgendaView( bool)), | 324 | connect( todoEditor, SIGNAL( showAgendaView( bool)), |
322 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 325 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
323 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), | 326 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), |
324 | // mMainView,SLOT(schedule_cancel(Incidence *))); | 327 | // mMainView,SLOT(schedule_cancel(Incidence *))); |
325 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); | 328 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); |
326 | #ifndef DESKTOP_VERSION | 329 | #ifndef DESKTOP_VERSION |
327 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); | 330 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); |
328 | #endif | 331 | #endif |
329 | return todoEditor; | 332 | return todoEditor; |
330 | } | 333 | } |
331 | 334 | ||
332 | void KODialogManager::updateSearchDialog() | 335 | void KODialogManager::updateSearchDialog() |
333 | { | 336 | { |
334 | if (mSearchDialog) mSearchDialog->updateView(); | 337 | if (mSearchDialog) mSearchDialog->updateView(); |
335 | } | 338 | } |
336 | 339 | ||
337 | void KODialogManager::setDocumentId( const QString &id ) | 340 | void KODialogManager::setDocumentId( const QString &id ) |
338 | { | 341 | { |
339 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); | 342 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); |
340 | } | 343 | } |
341 | 344 | ||
342 | void KODialogManager::writeSettings( KConfig *config ) | 345 | void KODialogManager::writeSettings( KConfig *config ) |
343 | { | 346 | { |
344 | if (mSearchDialog) | 347 | if (mSearchDialog) |
345 | mSearchDialog->listview()->writeSettings(config,"SearchListView Layout"); | 348 | mSearchDialog->listview()->writeSettings(config,"SearchListView Layout"); |
346 | } | 349 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 019f41f..4f71788 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -132,1172 +132,1179 @@ int globalFlagBlockStartup; | |||
132 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 132 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
133 | QMainWindow( parent, name ) | 133 | QMainWindow( parent, name ) |
134 | { | 134 | { |
135 | 135 | ||
136 | mClosed = false; | 136 | mClosed = false; |
137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
138 | QString confFile = locateLocal("config","korganizerrc"); | 138 | QString confFile = locateLocal("config","korganizerrc"); |
139 | QFileInfo finf ( confFile ); | 139 | QFileInfo finf ( confFile ); |
140 | bool showWarning = !finf.exists(); | 140 | bool showWarning = !finf.exists(); |
141 | setIcon(SmallIcon( "ko24" ) ); | 141 | setIcon(SmallIcon( "ko24" ) ); |
142 | mBlockAtStartup = true; | 142 | mBlockAtStartup = true; |
143 | mFlagKeyPressed = false; | 143 | mFlagKeyPressed = false; |
144 | setCaption("KOrganizer/Pi"); | 144 | setCaption("KOrganizer/Pi"); |
145 | KOPrefs *p = KOPrefs::instance(); | 145 | KOPrefs *p = KOPrefs::instance(); |
146 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 146 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
147 | if ( p->mHourSize > 22 ) | 147 | if ( p->mHourSize > 22 ) |
148 | p->mHourSize = 22; | 148 | p->mHourSize = 22; |
149 | QMainWindow::ToolBarDock tbd; | 149 | QMainWindow::ToolBarDock tbd; |
150 | if ( p->mToolBarHor ) { | 150 | if ( p->mToolBarHor ) { |
151 | if ( p->mToolBarUp ) | 151 | if ( p->mToolBarUp ) |
152 | tbd = Bottom; | 152 | tbd = Bottom; |
153 | else | 153 | else |
154 | tbd = Top; | 154 | tbd = Top; |
155 | } | 155 | } |
156 | else { | 156 | else { |
157 | if ( p->mToolBarUp ) | 157 | if ( p->mToolBarUp ) |
158 | tbd = Right; | 158 | tbd = Right; |
159 | else | 159 | else |
160 | tbd = Left; | 160 | tbd = Left; |
161 | } | 161 | } |
162 | if ( KOPrefs::instance()->mUseAppColors ) | 162 | if ( KOPrefs::instance()->mUseAppColors ) |
163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
164 | globalFlagBlockStartup = 1; | 164 | globalFlagBlockStartup = 1; |
165 | iconToolBar = new QPEToolBar( this ); | 165 | iconToolBar = new QPEToolBar( this ); |
166 | addToolBar (iconToolBar , tbd ); | 166 | addToolBar (iconToolBar , tbd ); |
167 | mCalendarModifiedFlag = false; | 167 | mCalendarModifiedFlag = false; |
168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
169 | splash->setAlignment ( AlignCenter ); | 169 | splash->setAlignment ( AlignCenter ); |
170 | setCentralWidget( splash ); | 170 | setCentralWidget( splash ); |
171 | #ifndef DESKTOP_VERSION | 171 | #ifndef DESKTOP_VERSION |
172 | showMaximized(); | 172 | showMaximized(); |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
176 | setDefaultPreferences(); | 176 | setDefaultPreferences(); |
177 | mCalendar = new CalendarLocal(); | 177 | mCalendar = new CalendarLocal(); |
178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
179 | mView->hide(); | 179 | mView->hide(); |
180 | //mView->resize(splash->size() ); | 180 | //mView->resize(splash->size() ); |
181 | initActions(); | 181 | initActions(); |
182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
183 | mSyncManager->setBlockSave(false); | 183 | mSyncManager->setBlockSave(false); |
184 | mView->setSyncManager(mSyncManager); | 184 | mView->setSyncManager(mSyncManager); |
185 | #ifndef DESKTOP_VERSION | 185 | #ifndef DESKTOP_VERSION |
186 | iconToolBar->show(); | 186 | iconToolBar->show(); |
187 | qApp->processEvents(); | 187 | qApp->processEvents(); |
188 | #endif | 188 | #endif |
189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
190 | int vh = height() ; | 190 | int vh = height() ; |
191 | int vw = width(); | 191 | int vw = width(); |
192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
194 | vh -= iconToolBar->height(); | 194 | vh -= iconToolBar->height(); |
195 | } else { | 195 | } else { |
196 | vw -= iconToolBar->height(); | 196 | vw -= iconToolBar->height(); |
197 | } | 197 | } |
198 | //mView->setMaximumSize( splash->size() ); | 198 | //mView->setMaximumSize( splash->size() ); |
199 | //mView->resize( splash->size() ); | 199 | //mView->resize( splash->size() ); |
200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
201 | mView->readSettings(); | 201 | mView->readSettings(); |
202 | bool newFile = false; | 202 | bool newFile = false; |
203 | if( !QFile::exists( defaultFileName() ) ) { | 203 | if( !QFile::exists( defaultFileName() ) ) { |
204 | QFileInfo finfo ( defaultFileName() ); | 204 | QFileInfo finfo ( defaultFileName() ); |
205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
206 | qDebug("oldfile %s ", oldFile.latin1()); | 206 | qDebug("oldfile %s ", oldFile.latin1()); |
207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
208 | finfo.setFile( oldFile ); | 208 | finfo.setFile( oldFile ); |
209 | if (finfo.exists() ) { | 209 | if (finfo.exists() ) { |
210 | KMessageBox::information( this, message); | 210 | KMessageBox::information( this, message); |
211 | mView->openCalendar( oldFile ); | 211 | mView->openCalendar( oldFile ); |
212 | qApp->processEvents(); | 212 | qApp->processEvents(); |
213 | } else { | 213 | } else { |
214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
215 | finfo.setFile( oldFile ); | 215 | finfo.setFile( oldFile ); |
216 | if (finfo.exists() ) { | 216 | if (finfo.exists() ) { |
217 | KMessageBox::information( this, message); | 217 | KMessageBox::information( this, message); |
218 | mView->openCalendar( oldFile ); | 218 | mView->openCalendar( oldFile ); |
219 | qApp->processEvents(); | 219 | qApp->processEvents(); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | mView->saveCalendar( defaultFileName() ); | 222 | mView->saveCalendar( defaultFileName() ); |
223 | newFile = true; | 223 | newFile = true; |
224 | } | 224 | } |
225 | 225 | ||
226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
227 | mView->openCalendar( defaultFileName() ); | 227 | mView->openCalendar( defaultFileName() ); |
228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
230 | 230 | ||
231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
232 | KOPrefs::instance()->setAllDefaults(); | 232 | KOPrefs::instance()->setAllDefaults(); |
233 | int count = mView->addCategories(); | 233 | int count = mView->addCategories(); |
234 | } | 234 | } |
235 | processIncidenceSelection( 0 ); | 235 | processIncidenceSelection( 0 ); |
236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
237 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 237 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
239 | SLOT( slotModifiedChanged( bool ) ) ); | 239 | SLOT( slotModifiedChanged( bool ) ) ); |
240 | 240 | ||
241 | 241 | ||
242 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 242 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
243 | SLOT( disableBR(bool) ) ); | 243 | SLOT( disableBR(bool) ) ); |
244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
245 | mView->setModified( false ); | 245 | mView->setModified( false ); |
246 | mBlockAtStartup = false; | 246 | mBlockAtStartup = false; |
247 | mView->setModified( false ); | 247 | mView->setModified( false ); |
248 | setCentralWidget( mView ); | 248 | setCentralWidget( mView ); |
249 | globalFlagBlockStartup = 0; | 249 | globalFlagBlockStartup = 0; |
250 | mView->show(); | 250 | mView->show(); |
251 | delete splash; | 251 | delete splash; |
252 | if ( newFile ) | 252 | if ( newFile ) |
253 | mView->updateConfig(); | 253 | mView->updateConfig(); |
254 | // qApp->processEvents(); | 254 | // qApp->processEvents(); |
255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
256 | //fillSyncMenu(); | 256 | //fillSyncMenu(); |
257 | 257 | ||
258 | 258 | ||
259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
264 | mSyncManager->setDefaultFileName( sentSyncFile()); | 264 | mSyncManager->setDefaultFileName( sentSyncFile()); |
265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
266 | mSyncManager->fillSyncMenu(); | 266 | mSyncManager->fillSyncMenu(); |
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
271 | if ( showWarning ) { | 271 | if ( showWarning ) { |
272 | KMessageBox::information( this, | 272 | KMessageBox::information( this, |
273 | "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"); | 273 | "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"); |
274 | qApp->processEvents(); | 274 | qApp->processEvents(); |
275 | mView->dialogManager()->showSyncOptions(); | 275 | mView->dialogManager()->showSyncOptions(); |
276 | } | 276 | } |
277 | 277 | ||
278 | //US listen for result adressed from Ka/Pi | 278 | //US listen for result adressed from Ka/Pi |
279 | #ifndef DESKTOP_VERSION | 279 | #ifndef DESKTOP_VERSION |
280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
281 | #endif | 281 | #endif |
282 | #ifndef DESKTOP_VERSION | 282 | #ifndef DESKTOP_VERSION |
283 | infrared = 0; | 283 | infrared = 0; |
284 | #endif | 284 | #endif |
285 | updateWeek( mView->startDate() ); | 285 | updateWeek( mView->startDate() ); |
286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
288 | mBRdisabled = false; | 288 | mBRdisabled = false; |
289 | //toggleBeamReceive(); | 289 | //toggleBeamReceive(); |
290 | } | 290 | } |
291 | MainWindow::~MainWindow() | 291 | MainWindow::~MainWindow() |
292 | { | 292 | { |
293 | //qDebug("MainWindow::~MainWindow() "); | 293 | //qDebug("MainWindow::~MainWindow() "); |
294 | //save toolbar location | 294 | //save toolbar location |
295 | delete mCalendar; | 295 | delete mCalendar; |
296 | delete mSyncManager; | 296 | delete mSyncManager; |
297 | #ifndef DESKTOP_VERSION | 297 | #ifndef DESKTOP_VERSION |
298 | if ( infrared ) | 298 | if ( infrared ) |
299 | delete infrared; | 299 | delete infrared; |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | 302 | ||
303 | } | 303 | } |
304 | 304 | ||
305 | void MainWindow::disableBR(bool b) | 305 | void MainWindow::disableBR(bool b) |
306 | { | 306 | { |
307 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
308 | if ( b ) { | 308 | if ( b ) { |
309 | if ( infrared ) { | 309 | if ( infrared ) { |
310 | toggleBeamReceive(); | 310 | toggleBeamReceive(); |
311 | mBRdisabled = true; | 311 | mBRdisabled = true; |
312 | } | 312 | } |
313 | mBRdisabled = true; | 313 | mBRdisabled = true; |
314 | } else { | 314 | } else { |
315 | if ( mBRdisabled ) { | 315 | if ( mBRdisabled ) { |
316 | mBRdisabled = false; | 316 | mBRdisabled = false; |
317 | //makes no sense,because other cal ap is probably running | 317 | //makes no sense,because other cal ap is probably running |
318 | // toggleBeamReceive(); | 318 | // toggleBeamReceive(); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | } | 323 | } |
324 | bool MainWindow::beamReceiveEnabled() | 324 | bool MainWindow::beamReceiveEnabled() |
325 | { | 325 | { |
326 | #ifndef DESKTOP_VERSION | 326 | #ifndef DESKTOP_VERSION |
327 | return ( infrared != 0 ); | 327 | return ( infrared != 0 ); |
328 | #endif | 328 | #endif |
329 | return false; | 329 | return false; |
330 | } | 330 | } |
331 | 331 | ||
332 | void MainWindow::toggleBeamReceive() | 332 | void MainWindow::toggleBeamReceive() |
333 | { | 333 | { |
334 | if ( mBRdisabled ) | 334 | if ( mBRdisabled ) |
335 | return; | 335 | return; |
336 | #ifndef DESKTOP_VERSION | 336 | #ifndef DESKTOP_VERSION |
337 | if ( infrared ) { | 337 | if ( infrared ) { |
338 | qDebug("disable BeamReceive "); | 338 | qDebug("disable BeamReceive "); |
339 | delete infrared; | 339 | delete infrared; |
340 | infrared = 0; | 340 | infrared = 0; |
341 | brAction->setOn(false); | 341 | brAction->setOn(false); |
342 | return; | 342 | return; |
343 | } | 343 | } |
344 | qDebug("enable BeamReceive "); | 344 | qDebug("enable BeamReceive "); |
345 | brAction->setOn(true); | 345 | brAction->setOn(true); |
346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
348 | #endif | 348 | #endif |
349 | } | 349 | } |
350 | void MainWindow::showMaximized () | 350 | void MainWindow::showMaximized () |
351 | { | 351 | { |
352 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
353 | if ( ! globalFlagBlockStartup ) | 353 | if ( ! globalFlagBlockStartup ) |
354 | if ( mClosed ) | 354 | if ( mClosed ) |
355 | mView->goToday(); | 355 | mView->goToday(); |
356 | #endif | 356 | #endif |
357 | QWidget::showMaximized () ; | 357 | QWidget::showMaximized () ; |
358 | mClosed = false; | 358 | mClosed = false; |
359 | } | 359 | } |
360 | void MainWindow::closeEvent( QCloseEvent* ce ) | 360 | void MainWindow::closeEvent( QCloseEvent* ce ) |
361 | { | 361 | { |
362 | 362 | ||
363 | 363 | ||
364 | 364 | ||
365 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 365 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
366 | saveOnClose(); | 366 | saveOnClose(); |
367 | mClosed = true; | 367 | mClosed = true; |
368 | ce->accept(); | 368 | ce->accept(); |
369 | return; | 369 | return; |
370 | 370 | ||
371 | } | 371 | } |
372 | 372 | ||
373 | switch( QMessageBox::information( this, "KO/Pi", | 373 | switch( QMessageBox::information( this, "KO/Pi", |
374 | i18n("Do you really want\nto close KO/Pi?"), | 374 | i18n("Do you really want\nto close KO/Pi?"), |
375 | i18n("Close"), i18n("No"), | 375 | i18n("Close"), i18n("No"), |
376 | 0, 0 ) ) { | 376 | 0, 0 ) ) { |
377 | case 0: | 377 | case 0: |
378 | saveOnClose(); | 378 | saveOnClose(); |
379 | mClosed = true; | 379 | mClosed = true; |
380 | ce->accept(); | 380 | ce->accept(); |
381 | break; | 381 | break; |
382 | case 1: | 382 | case 1: |
383 | ce->ignore(); | 383 | ce->ignore(); |
384 | break; | 384 | break; |
385 | case 2: | 385 | case 2: |
386 | 386 | ||
387 | default: | 387 | default: |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | } | 392 | } |
393 | 393 | ||
394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
395 | { | 395 | { |
396 | QDataStream stream( data, IO_ReadOnly ); | 396 | QDataStream stream( data, IO_ReadOnly ); |
397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
398 | //QString datamess; | 398 | //QString datamess; |
399 | //qDebug("message "); | 399 | //qDebug("message "); |
400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
401 | 401 | ||
402 | if ( cmsg == "setDocument(QString)" ) { | 402 | if ( cmsg == "setDocument(QString)" ) { |
403 | QDataStream stream( data, IO_ReadOnly ); | 403 | QDataStream stream( data, IO_ReadOnly ); |
404 | QString fileName; | 404 | QString fileName; |
405 | stream >> fileName; | 405 | stream >> fileName; |
406 | //qDebug("filename %s ", fileName.latin1()); | 406 | //qDebug("filename %s ", fileName.latin1()); |
407 | showMaximized(); | 407 | showMaximized(); |
408 | raise(); | 408 | raise(); |
409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
410 | mSyncManager->slotSyncMenu( 1002 ); | 410 | mSyncManager->slotSyncMenu( 1002 ); |
411 | return; | 411 | return; |
412 | } | 412 | } |
413 | 413 | ||
414 | if ( cmsg == "-writeFile" ) { | 414 | if ( cmsg == "-writeFile" ) { |
415 | // I made from the "-writeFile" an "-writeAlarm" | 415 | // I made from the "-writeFile" an "-writeAlarm" |
416 | mView->viewManager()->showWhatsNextView(); | 416 | mView->viewManager()->showWhatsNextView(); |
417 | mCalendar->checkAlarmForIncidence( 0, true); | 417 | mCalendar->checkAlarmForIncidence( 0, true); |
418 | showMaximized(); | 418 | showMaximized(); |
419 | raise(); | 419 | raise(); |
420 | return; | 420 | return; |
421 | 421 | ||
422 | } | 422 | } |
423 | if ( cmsg == "-writeFileSilent" ) { | 423 | if ( cmsg == "-writeFileSilent" ) { |
424 | // I made from the "-writeFile" an "-writeAlarm" | 424 | // I made from the "-writeFile" an "-writeAlarm" |
425 | // mView->viewManager()->showWhatsNextView(); | 425 | // mView->viewManager()->showWhatsNextView(); |
426 | mCalendar->checkAlarmForIncidence( 0, true); | 426 | mCalendar->checkAlarmForIncidence( 0, true); |
427 | //showMaximized(); | 427 | //showMaximized(); |
428 | //raise(); | 428 | //raise(); |
429 | hide(); | 429 | hide(); |
430 | return; | 430 | return; |
431 | } | 431 | } |
432 | if ( cmsg == "-newCountdown" ) { | 432 | if ( cmsg == "-newCountdown" ) { |
433 | qDebug("newCountdown "); | 433 | qDebug("newCountdown "); |
434 | 434 | ||
435 | } | 435 | } |
436 | QString msg ; | 436 | QString msg ; |
437 | QString allmsg = cmsg; | 437 | QString allmsg = cmsg; |
438 | while ( allmsg.length() > 0 ) { | 438 | while ( allmsg.length() > 0 ) { |
439 | int nextC = allmsg.find( "-", 1 ); | 439 | int nextC = allmsg.find( "-", 1 ); |
440 | if ( nextC == -1 ) { | 440 | if ( nextC == -1 ) { |
441 | msg = allmsg; | 441 | msg = allmsg; |
442 | allmsg = ""; | 442 | allmsg = ""; |
443 | } else{ | 443 | } else{ |
444 | msg = allmsg.left( nextC ); | 444 | msg = allmsg.left( nextC ); |
445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
446 | } | 446 | } |
447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
448 | if ( msg == "-newEvent" ) { | 448 | if ( msg == "-newEvent" ) { |
449 | mView->newEvent(); | 449 | mView->newEvent(); |
450 | } | 450 | } |
451 | if ( msg == "-newTodo" ) { | 451 | if ( msg == "-newTodo" ) { |
452 | mView->newTodo(); | 452 | mView->newTodo(); |
453 | 453 | ||
454 | } | 454 | } |
455 | if ( msg == "-showWN" ) { | 455 | if ( msg == "-showWN" ) { |
456 | mView->viewManager()->showWhatsNextView(); | 456 | mView->viewManager()->showWhatsNextView(); |
457 | } | 457 | } |
458 | if ( msg == "-showTodo" ) { | 458 | if ( msg == "-showTodo" ) { |
459 | mView->viewManager()->showTodoView(); | 459 | mView->viewManager()->showTodoView(); |
460 | } | 460 | } |
461 | if ( msg == "-showList" ) { | 461 | if ( msg == "-showList" ) { |
462 | mView->viewManager()->showListView(); | 462 | mView->viewManager()->showListView(); |
463 | } | 463 | } |
464 | else if ( msg == "-showDay" ) { | 464 | else if ( msg == "-showDay" ) { |
465 | mView->viewManager()->showDayView(); | 465 | mView->viewManager()->showDayView(); |
466 | } | 466 | } |
467 | else if ( msg == "-showWWeek" ) { | 467 | else if ( msg == "-showWWeek" ) { |
468 | mView->viewManager()->showWorkWeekView(); | 468 | mView->viewManager()->showWorkWeekView(); |
469 | } | 469 | } |
470 | else if ( msg == "-ringSync" ) { | 470 | else if ( msg == "-ringSync" ) { |
471 | mSyncManager->multiSync( false ); | 471 | mSyncManager->multiSync( false ); |
472 | } | 472 | } |
473 | else if ( msg == "-showWeek" ) { | 473 | else if ( msg == "-showWeek" ) { |
474 | mView->viewManager()->showWeekView(); | 474 | mView->viewManager()->showWeekView(); |
475 | } | 475 | } |
476 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
477 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
478 | } | 478 | } |
479 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
480 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
481 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
482 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
488 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
489 | } | 489 | } |
490 | else if ( msg == "-showNextXView" ) { | 490 | else if ( msg == "-showNextXView" ) { |
491 | mView->viewManager()->showNextXView(); | 491 | mView->viewManager()->showNextXView(); |
492 | } | 492 | } |
493 | 493 | ||
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | showMaximized(); | 497 | showMaximized(); |
498 | raise(); | 498 | raise(); |
499 | } | 499 | } |
500 | 500 | ||
501 | QPixmap MainWindow::loadPixmap( QString name ) | 501 | QPixmap MainWindow::loadPixmap( QString name ) |
502 | { | 502 | { |
503 | return SmallIcon( name ); | 503 | return SmallIcon( name ); |
504 | 504 | ||
505 | } | 505 | } |
506 | void MainWindow::initActions() | 506 | void MainWindow::initActions() |
507 | { | 507 | { |
508 | //KOPrefs::instance()->mShowFullMenu | 508 | //KOPrefs::instance()->mShowFullMenu |
509 | iconToolBar->clear(); | 509 | iconToolBar->clear(); |
510 | KOPrefs *p = KOPrefs::instance(); | 510 | KOPrefs *p = KOPrefs::instance(); |
511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
512 | 512 | ||
513 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 513 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
514 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 514 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
515 | QPopupMenu *importMenu = new QPopupMenu( this ); | 515 | QPopupMenu *importMenu = new QPopupMenu( this ); |
516 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | ||
517 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | ||
518 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | ||
516 | selectFilterMenu = new QPopupMenu( this ); | 519 | selectFilterMenu = new QPopupMenu( this ); |
517 | selectFilterMenu->setCheckable( true ); | 520 | selectFilterMenu->setCheckable( true ); |
518 | syncMenu = new QPopupMenu( this ); | 521 | syncMenu = new QPopupMenu( this ); |
519 | configureAgendaMenu = new QPopupMenu( this ); | 522 | configureAgendaMenu = new QPopupMenu( this ); |
520 | configureToolBarMenu = new QPopupMenu( this ); | 523 | configureToolBarMenu = new QPopupMenu( this ); |
521 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 524 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
522 | |||
523 | QIconSet icon; | 525 | QIconSet icon; |
524 | int pixWid = 22, pixHei = 22; | 526 | int pixWid = 22, pixHei = 22; |
525 | QString pathString = ""; | 527 | QString pathString = ""; |
526 | if ( !p->mToolBarMiniIcons ) { | 528 | if ( !p->mToolBarMiniIcons ) { |
527 | if ( QApplication::desktop()->width() < 480 ) { | 529 | if ( QApplication::desktop()->width() < 480 ) { |
528 | pathString += "icons16/"; | 530 | pathString += "icons16/"; |
529 | pixWid = 18; pixHei = 16; | 531 | pixWid = 18; pixHei = 16; |
530 | } | 532 | } |
531 | } else { | 533 | } else { |
532 | pathString += "iconsmini/"; | 534 | pathString += "iconsmini/"; |
533 | pixWid = 18; pixHei = 16; | 535 | pixWid = 18; pixHei = 16; |
534 | } | 536 | } |
535 | if ( KOPrefs::instance()->mShowFullMenu ) { | 537 | if ( KOPrefs::instance()->mShowFullMenu ) { |
536 | QMenuBar *menuBar1; | 538 | QMenuBar *menuBar1; |
537 | menuBar1 = menuBar(); | 539 | menuBar1 = menuBar(); |
538 | menuBar1->insertItem( i18n("File"), importMenu ); | 540 | menuBar1->insertItem( i18n("File"), importMenu ); |
539 | menuBar1->insertItem( i18n("View"), viewMenu ); | 541 | menuBar1->insertItem( i18n("View"), viewMenu ); |
540 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 542 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
541 | #ifdef DESKTOP_VERSION | 543 | #ifdef DESKTOP_VERSION |
542 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 544 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
543 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 545 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
544 | #else | 546 | #else |
545 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 547 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
546 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 548 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
547 | #endif | 549 | #endif |
548 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 550 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
549 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 551 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
550 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 552 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
551 | } else { | 553 | } else { |
552 | QPEMenuBar *menuBar1; | 554 | QPEMenuBar *menuBar1; |
553 | menuBar1 = new QPEMenuBar( iconToolBar ); | 555 | menuBar1 = new QPEMenuBar( iconToolBar ); |
554 | QPopupMenu *menuBar = new QPopupMenu( this ); | 556 | QPopupMenu *menuBar = new QPopupMenu( this ); |
555 | icon = loadPixmap( pathString + "z_menu" ); | 557 | icon = loadPixmap( pathString + "z_menu" ); |
556 | menuBar1->insertItem( icon.pixmap(), menuBar); | 558 | menuBar1->insertItem( icon.pixmap(), menuBar); |
557 | //menuBar1->insertItem( i18n("ME"), menuBar); | 559 | //menuBar1->insertItem( i18n("ME"), menuBar); |
558 | menuBar->insertItem( i18n("File"), importMenu ); | 560 | menuBar->insertItem( i18n("File"), importMenu ); |
559 | menuBar->insertItem( i18n("View"), viewMenu ); | 561 | menuBar->insertItem( i18n("View"), viewMenu ); |
560 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 562 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
561 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 563 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
562 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 564 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
563 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 565 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
564 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 566 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
565 | menuBar->insertItem( i18n("Help"), helpMenu ); | 567 | menuBar->insertItem( i18n("Help"), helpMenu ); |
566 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 568 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
567 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 569 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
568 | } | 570 | } |
569 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 571 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
570 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 572 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
571 | mWeekBgColor = iconToolBar->backgroundColor(); | 573 | mWeekBgColor = iconToolBar->backgroundColor(); |
572 | mWeekPixmap.resize( pixWid , pixHei ); | 574 | mWeekPixmap.resize( pixWid , pixHei ); |
573 | mWeekPixmap.fill( mWeekBgColor ); | 575 | mWeekPixmap.fill( mWeekBgColor ); |
574 | icon = mWeekPixmap; | 576 | icon = mWeekPixmap; |
575 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 577 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
576 | if ( p-> mShowIconWeekNum ) | 578 | if ( p-> mShowIconWeekNum ) |
577 | mWeekAction->addTo( iconToolBar ); | 579 | mWeekAction->addTo( iconToolBar ); |
578 | mWeekFont = font(); | 580 | mWeekFont = font(); |
579 | 581 | ||
580 | int fontPoint = mWeekFont.pointSize(); | 582 | int fontPoint = mWeekFont.pointSize(); |
581 | QFontMetrics f( mWeekFont ); | 583 | QFontMetrics f( mWeekFont ); |
582 | int fontWid = f.width( "30" ); | 584 | int fontWid = f.width( "30" ); |
583 | while ( fontWid > pixWid ) { | 585 | while ( fontWid > pixWid ) { |
584 | --fontPoint; | 586 | --fontPoint; |
585 | mWeekFont.setPointSize( fontPoint ); | 587 | mWeekFont.setPointSize( fontPoint ); |
586 | QFontMetrics f( mWeekFont ); | 588 | QFontMetrics f( mWeekFont ); |
587 | fontWid = f.width( "30" ); | 589 | fontWid = f.width( "30" ); |
588 | qDebug("dec-- "); | 590 | qDebug("dec-- "); |
589 | } | 591 | } |
590 | 592 | ||
591 | connect( mWeekAction, SIGNAL( activated() ), | 593 | connect( mWeekAction, SIGNAL( activated() ), |
592 | this, SLOT( weekAction() ) ); | 594 | this, SLOT( weekAction() ) ); |
593 | 595 | ||
594 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 596 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
595 | 597 | ||
596 | //#endif | 598 | //#endif |
597 | // ****************** | 599 | // ****************** |
598 | QAction *action; | 600 | QAction *action; |
599 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 601 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
600 | configureToolBarMenu->setCheckable( true ); | 602 | configureToolBarMenu->setCheckable( true ); |
601 | 603 | ||
602 | 604 | ||
603 | configureAgendaMenu->setCheckable( true ); | 605 | configureAgendaMenu->setCheckable( true ); |
604 | int iii ; | 606 | int iii ; |
605 | for ( iii = 1;iii<= 10 ;++iii ){ | 607 | for ( iii = 1;iii<= 10 ;++iii ){ |
606 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 608 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
607 | } | 609 | } |
608 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 610 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
609 | 611 | ||
610 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 612 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
611 | this, SLOT( showConfigureAgenda( ) ) ); | 613 | this, SLOT( showConfigureAgenda( ) ) ); |
612 | 614 | ||
613 | icon = loadPixmap( pathString + "configure" ); | 615 | icon = loadPixmap( pathString + "configure" ); |
614 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 616 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
615 | action->addTo( actionMenu ); | 617 | action->addTo( actionMenu ); |
616 | connect( action, SIGNAL( activated() ), | 618 | connect( action, SIGNAL( activated() ), |
617 | mView, SLOT( edit_options() ) ); | 619 | mView, SLOT( edit_options() ) ); |
618 | actionMenu->insertSeparator(); | 620 | actionMenu->insertSeparator(); |
619 | 621 | ||
620 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 622 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
621 | action->addTo( actionMenu ); | 623 | action->addTo( actionMenu ); |
622 | connect( action, SIGNAL( activated() ), | 624 | connect( action, SIGNAL( activated() ), |
623 | mView, SLOT( undo_delete() ) ); | 625 | mView, SLOT( undo_delete() ) ); |
624 | actionMenu->insertSeparator(); | 626 | actionMenu->insertSeparator(); |
625 | 627 | ||
626 | icon = loadPixmap( pathString + "newevent" ); | 628 | icon = loadPixmap( pathString + "newevent" ); |
627 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 629 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
628 | configureToolBarMenu->insertSeparator(); | 630 | configureToolBarMenu->insertSeparator(); |
629 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 631 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
630 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 632 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
631 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 633 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
632 | ne_action->addTo( actionMenu ); | 634 | ne_action->addTo( actionMenu ); |
633 | connect( ne_action, SIGNAL( activated() ), | 635 | connect( ne_action, SIGNAL( activated() ), |
634 | mView, SLOT( newEvent() ) ); | 636 | mView, SLOT( newEvent() ) ); |
635 | icon = loadPixmap( pathString + "newtodo" ); | 637 | icon = loadPixmap( pathString + "newtodo" ); |
636 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 638 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
637 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 639 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
638 | nt_action->addTo( actionMenu ); | 640 | nt_action->addTo( actionMenu ); |
639 | connect( nt_action, SIGNAL( activated() ), | 641 | connect( nt_action, SIGNAL( activated() ), |
640 | mView, SLOT( newTodo() ) ); | 642 | mView, SLOT( newTodo() ) ); |
641 | 643 | ||
642 | icon = loadPixmap( pathString + "today" ); | 644 | icon = loadPixmap( pathString + "today" ); |
643 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 645 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
644 | today_action->addTo( viewMenu ); | 646 | today_action->addTo( viewMenu ); |
645 | connect( today_action, SIGNAL( activated() ), | 647 | connect( today_action, SIGNAL( activated() ), |
646 | mView, SLOT( goToday() ) ); | 648 | mView, SLOT( goToday() ) ); |
647 | viewMenu->insertSeparator(); | 649 | viewMenu->insertSeparator(); |
648 | 650 | ||
649 | icon = loadPixmap( pathString + "navi" ); | 651 | icon = loadPixmap( pathString + "navi" ); |
650 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 652 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
651 | action->addTo( viewMenu ); | 653 | action->addTo( viewMenu ); |
652 | connect( action, SIGNAL( activated() ), | 654 | connect( action, SIGNAL( activated() ), |
653 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 655 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
654 | mToggleNav = action ; | 656 | mToggleNav = action ; |
655 | icon = loadPixmap( pathString + "filter" ); | 657 | icon = loadPixmap( pathString + "filter" ); |
656 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 658 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
657 | action->addTo( viewMenu ); | 659 | action->addTo( viewMenu ); |
658 | connect( action, SIGNAL( activated() ), | 660 | connect( action, SIGNAL( activated() ), |
659 | mView, SLOT( toggleFilter() ) ); | 661 | mView, SLOT( toggleFilter() ) ); |
660 | mToggleFilter = action; | 662 | mToggleFilter = action; |
661 | icon = loadPixmap( pathString + "allday" ); | 663 | icon = loadPixmap( pathString + "allday" ); |
662 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 664 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
663 | action->addTo( viewMenu ); | 665 | action->addTo( viewMenu ); |
664 | connect( action, SIGNAL( activated() ), | 666 | connect( action, SIGNAL( activated() ), |
665 | mView, SLOT( toggleAllDaySize() ) ); | 667 | mView, SLOT( toggleAllDaySize() ) ); |
666 | mToggleAllday = action; | 668 | mToggleAllday = action; |
667 | 669 | ||
668 | 670 | ||
669 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 671 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
670 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 672 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
671 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 673 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
672 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 674 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
673 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 675 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
674 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 676 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
675 | 677 | ||
676 | viewMenu->insertSeparator(); | 678 | viewMenu->insertSeparator(); |
677 | icon = loadPixmap( pathString + "picker" ); | 679 | icon = loadPixmap( pathString + "picker" ); |
678 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 680 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
679 | action->addTo( viewMenu ); | 681 | action->addTo( viewMenu ); |
680 | connect( action, SIGNAL( activated() ), | 682 | connect( action, SIGNAL( activated() ), |
681 | mView, SLOT( showDatePicker() ) ); | 683 | mView, SLOT( showDatePicker() ) ); |
682 | action->addTo( iconToolBar ); | 684 | action->addTo( iconToolBar ); |
683 | viewMenu->insertSeparator(); | 685 | viewMenu->insertSeparator(); |
684 | icon = loadPixmap( pathString + "list" ); | 686 | icon = loadPixmap( pathString + "list" ); |
685 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 687 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
686 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 688 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
687 | showlist_action->addTo( viewMenu ); | 689 | showlist_action->addTo( viewMenu ); |
688 | connect( showlist_action, SIGNAL( activated() ), | 690 | connect( showlist_action, SIGNAL( activated() ), |
689 | mView->viewManager(), SLOT( showListView() ) ); | 691 | mView->viewManager(), SLOT( showListView() ) ); |
690 | 692 | ||
691 | 693 | ||
692 | icon = loadPixmap( pathString + "day" ); | 694 | icon = loadPixmap( pathString + "day" ); |
693 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 695 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
694 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 696 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
695 | day1_action->addTo( viewMenu ); | 697 | day1_action->addTo( viewMenu ); |
696 | // action->addTo( toolBar ); | 698 | // action->addTo( toolBar ); |
697 | connect( day1_action, SIGNAL( activated() ), | 699 | connect( day1_action, SIGNAL( activated() ), |
698 | mView->viewManager(), SLOT( showDayView() ) ); | 700 | mView->viewManager(), SLOT( showDayView() ) ); |
699 | 701 | ||
700 | icon = loadPixmap( pathString + "workweek" ); | 702 | icon = loadPixmap( pathString + "workweek" ); |
701 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 703 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
702 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 704 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
703 | day5_action->addTo( viewMenu ); | 705 | day5_action->addTo( viewMenu ); |
704 | connect( day5_action, SIGNAL( activated() ), | 706 | connect( day5_action, SIGNAL( activated() ), |
705 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 707 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
706 | 708 | ||
707 | icon = loadPixmap( pathString + "week" ); | 709 | icon = loadPixmap( pathString + "week" ); |
708 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 710 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
709 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 711 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
710 | day7_action->addTo( viewMenu ); | 712 | day7_action->addTo( viewMenu ); |
711 | connect( day7_action, SIGNAL( activated() ), | 713 | connect( day7_action, SIGNAL( activated() ), |
712 | mView->viewManager(), SLOT( showWeekView() ) ); | 714 | mView->viewManager(), SLOT( showWeekView() ) ); |
713 | 715 | ||
714 | icon = loadPixmap( pathString + "workweek2" ); | 716 | icon = loadPixmap( pathString + "workweek2" ); |
715 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 717 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
716 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 718 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
717 | day6_action->addTo( viewMenu ); | 719 | day6_action->addTo( viewMenu ); |
718 | connect( day6_action, SIGNAL( activated() ), | 720 | connect( day6_action, SIGNAL( activated() ), |
719 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 721 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
720 | 722 | ||
721 | icon = loadPixmap( pathString + "month" ); | 723 | icon = loadPixmap( pathString + "month" ); |
722 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 724 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
723 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 725 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
724 | month_action->addTo( viewMenu ); | 726 | month_action->addTo( viewMenu ); |
725 | connect( month_action, SIGNAL( activated() ), | 727 | connect( month_action, SIGNAL( activated() ), |
726 | mView->viewManager(), SLOT( showMonthView() ) ); | 728 | mView->viewManager(), SLOT( showMonthView() ) ); |
727 | 729 | ||
728 | icon = loadPixmap( pathString + "todo" ); | 730 | icon = loadPixmap( pathString + "todo" ); |
729 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 731 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
730 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 732 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
731 | todoview_action->addTo( viewMenu ); | 733 | todoview_action->addTo( viewMenu ); |
732 | connect( todoview_action, SIGNAL( activated() ), | 734 | connect( todoview_action, SIGNAL( activated() ), |
733 | mView->viewManager(), SLOT( showTodoView() ) ); | 735 | mView->viewManager(), SLOT( showTodoView() ) ); |
734 | 736 | ||
735 | icon = loadPixmap( pathString + "journal" ); | 737 | icon = loadPixmap( pathString + "journal" ); |
736 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 738 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
737 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 739 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
738 | viewjournal_action->addTo( viewMenu ); | 740 | viewjournal_action->addTo( viewMenu ); |
739 | connect( viewjournal_action, SIGNAL( activated() ), | 741 | connect( viewjournal_action, SIGNAL( activated() ), |
740 | mView->viewManager(), SLOT( showJournalView() ) ); | 742 | mView->viewManager(), SLOT( showJournalView() ) ); |
741 | 743 | ||
742 | icon = loadPixmap( pathString + "xdays" ); | 744 | icon = loadPixmap( pathString + "xdays" ); |
743 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 745 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
744 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 746 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
745 | xdays_action->addTo( viewMenu ); | 747 | xdays_action->addTo( viewMenu ); |
746 | connect( xdays_action, SIGNAL( activated() ), | 748 | connect( xdays_action, SIGNAL( activated() ), |
747 | mView->viewManager(), SLOT( showNextXView() ) ); | 749 | mView->viewManager(), SLOT( showNextXView() ) ); |
748 | 750 | ||
749 | icon = loadPixmap( pathString + "whatsnext" ); | 751 | icon = loadPixmap( pathString + "whatsnext" ); |
750 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 752 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
751 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 753 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
752 | whatsnext_action->addTo( viewMenu ); | 754 | whatsnext_action->addTo( viewMenu ); |
753 | connect( whatsnext_action, SIGNAL( activated() ), | 755 | connect( whatsnext_action, SIGNAL( activated() ), |
754 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 756 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
755 | 757 | ||
756 | #if 0 | 758 | #if 0 |
757 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 759 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
758 | action->addTo( viewMenu ); | 760 | action->addTo( viewMenu ); |
759 | connect( action, SIGNAL( activated() ), | 761 | connect( action, SIGNAL( activated() ), |
760 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 762 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
761 | #endif | 763 | #endif |
762 | 764 | ||
763 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 765 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
764 | this ); | 766 | this ); |
765 | mNewSubTodoAction->addTo( actionMenu ); | 767 | mNewSubTodoAction->addTo( actionMenu ); |
766 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 768 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
767 | mView, SLOT( newSubTodo() ) ); | 769 | mView, SLOT( newSubTodo() ) ); |
768 | 770 | ||
769 | actionMenu->insertSeparator(); | 771 | actionMenu->insertSeparator(); |
770 | 772 | ||
771 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 773 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
772 | mShowAction->addTo( actionMenu ); | 774 | mShowAction->addTo( actionMenu ); |
773 | connect( mShowAction, SIGNAL( activated() ), | 775 | connect( mShowAction, SIGNAL( activated() ), |
774 | mView, SLOT( showIncidence() ) ); | 776 | mView, SLOT( showIncidence() ) ); |
775 | 777 | ||
776 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 778 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
777 | mEditAction->addTo( actionMenu ); | 779 | mEditAction->addTo( actionMenu ); |
778 | connect( mEditAction, SIGNAL( activated() ), | 780 | connect( mEditAction, SIGNAL( activated() ), |
779 | mView, SLOT( editIncidence() ) ); | 781 | mView, SLOT( editIncidence() ) ); |
780 | 782 | ||
781 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 783 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
782 | mDeleteAction->addTo( actionMenu ); | 784 | mDeleteAction->addTo( actionMenu ); |
783 | connect( mDeleteAction, SIGNAL( activated() ), | 785 | connect( mDeleteAction, SIGNAL( activated() ), |
784 | mView, SLOT( deleteIncidence() ) ); | 786 | mView, SLOT( deleteIncidence() ) ); |
785 | 787 | ||
786 | 788 | ||
787 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 789 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
788 | mCloneAction->addTo( actionMenu ); | 790 | mCloneAction->addTo( actionMenu ); |
789 | connect( mCloneAction, SIGNAL( activated() ), | 791 | connect( mCloneAction, SIGNAL( activated() ), |
790 | mView, SLOT( cloneIncidence() ) ); | 792 | mView, SLOT( cloneIncidence() ) ); |
791 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 793 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
792 | mMoveAction->addTo( actionMenu ); | 794 | mMoveAction->addTo( actionMenu ); |
793 | connect( mMoveAction, SIGNAL( activated() ), | 795 | connect( mMoveAction, SIGNAL( activated() ), |
794 | mView, SLOT( moveIncidence() ) ); | 796 | mView, SLOT( moveIncidence() ) ); |
795 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 797 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
796 | mBeamAction->addTo( actionMenu ); | 798 | mBeamAction->addTo( actionMenu ); |
797 | connect( mBeamAction, SIGNAL( activated() ), | 799 | connect( mBeamAction, SIGNAL( activated() ), |
798 | mView, SLOT( beamIncidence() ) ); | 800 | mView, SLOT( beamIncidence() ) ); |
799 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 801 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
800 | mCancelAction->addTo( actionMenu ); | 802 | mCancelAction->addTo( actionMenu ); |
801 | connect( mCancelAction, SIGNAL( activated() ), | 803 | connect( mCancelAction, SIGNAL( activated() ), |
802 | mView, SLOT( toggleCancelIncidence() ) ); | 804 | mView, SLOT( toggleCancelIncidence() ) ); |
803 | 805 | ||
804 | actionMenu->insertSeparator(); | 806 | actionMenu->insertSeparator(); |
805 | 807 | ||
806 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 808 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
807 | this ); | 809 | this ); |
808 | action->addTo( actionMenu ); | 810 | action->addTo( actionMenu ); |
809 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 811 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
810 | 812 | ||
811 | icon = loadPixmap( pathString + "search" ); | 813 | icon = loadPixmap( pathString + "search" ); |
812 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 814 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
813 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 815 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
814 | search_action->addTo( actionMenu ); | 816 | search_action->addTo( actionMenu ); |
815 | connect( search_action, SIGNAL( activated() ), | 817 | connect( search_action, SIGNAL( activated() ), |
816 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 818 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
817 | 819 | ||
818 | 820 | ||
819 | 821 | ||
820 | if ( KOPrefs::instance()->mShowFullMenu ) { | 822 | if ( KOPrefs::instance()->mShowFullMenu ) { |
821 | actionMenu->insertSeparator(); | 823 | actionMenu->insertSeparator(); |
822 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 824 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
823 | 825 | ||
824 | } | 826 | } |
825 | // actionMenu->insertSeparator(); | 827 | // actionMenu->insertSeparator(); |
826 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 828 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
827 | this ); | 829 | this ); |
828 | action->addTo( importMenu ); | 830 | action->addTo( importMenu_X ); |
829 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 831 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
830 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 832 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
831 | this ); | 833 | this ); |
832 | action->addTo( importMenu ); | 834 | action->addTo( importMenu_X ); |
833 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 835 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
834 | importMenu->insertSeparator(); | 836 | importMenu_X->insertSeparator(); |
835 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 837 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
836 | this ); | 838 | this ); |
837 | action->addTo( importMenu ); | 839 | action->addTo( importMenu_X ); |
838 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 840 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
839 | //#ifndef DESKTOP_VERSION | 841 | //#ifndef DESKTOP_VERSION |
840 | importMenu->insertSeparator(); | 842 | importMenu_X->insertSeparator(); |
841 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 843 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
842 | this ); | 844 | this ); |
843 | action->addTo( importMenu ); | 845 | action->addTo( importMenu_X ); |
844 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 846 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
845 | //#else | 847 | //#else |
846 | #ifdef _OL_IMPORT_ | 848 | #ifdef _OL_IMPORT_ |
847 | importMenu->insertSeparator(); | 849 | importMenu_X->insertSeparator(); |
848 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 850 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
849 | this ); | 851 | this ); |
850 | action->addTo( importMenu ); | 852 | action->addTo( importMenu_X ); |
851 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 853 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
852 | #endif | 854 | #endif |
853 | //#endif | 855 | //#endif |
854 | 856 | ||
855 | importMenu->insertSeparator(); | 857 | //importMenu->insertSeparator(); |
856 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 858 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
857 | this ); | 859 | this ); |
858 | action->addTo( importMenu ); | 860 | action->addTo( importMenu ); |
859 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 861 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
860 | 862 | ||
861 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 863 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
862 | this ); | 864 | this ); |
863 | action->addTo( importMenu ); | 865 | action->addTo( importMenu ); |
864 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 866 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
865 | |||
866 | importMenu->insertSeparator(); | 867 | importMenu->insertSeparator(); |
868 | importMenu->insertItem( i18n("Import"), importMenu_X ); | ||
869 | //importMenu->insertSeparator(); | ||
867 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 870 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
868 | this ); | 871 | this ); |
869 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 872 | action->addTo( exportMenu_X ); |
873 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | ||
870 | 874 | ||
871 | 875 | ||
872 | //LR | 876 | //LR |
873 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 877 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
874 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 878 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
875 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 879 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
876 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 880 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
877 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); | 881 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
878 | 882 | ||
879 | importMenu->insertSeparator(); | 883 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
880 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | ||
881 | this ); | ||
882 | action->addTo( importMenu ); | ||
883 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | ||
884 | #ifndef DESKTOP_VERSION | 884 | #ifndef DESKTOP_VERSION |
885 | importMenu->insertSeparator(); | 885 | //importMenu->insertSeparator(); |
886 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 886 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
887 | this ); | 887 | this ); |
888 | brAction->addTo( importMenu ); | 888 | brAction->addTo( beamMenu_X ); |
889 | brAction->setToggleAction (true ) ; | 889 | brAction->setToggleAction (true ) ; |
890 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 890 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
891 | 891 | ||
892 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 892 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
893 | this ); | 893 | this ); |
894 | action->addTo( importMenu ); | 894 | action->addTo( beamMenu_X ); |
895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
896 | 896 | ||
897 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 897 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
898 | this ); | 898 | this ); |
899 | action->addTo( importMenu ); | 899 | action->addTo( beamMenu_X ); |
900 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 900 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
901 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | ||
901 | #else | 902 | #else |
902 | importMenu->insertSeparator(); | 903 | //importMenu->insertSeparator(); |
903 | icon = loadPixmap( pathString + "print" ); | 904 | icon = loadPixmap( pathString + "print" ); |
904 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 905 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
905 | action->addTo( importMenu ); | 906 | action->addTo( beamMenu_X ); |
906 | connect( action, SIGNAL( activated() ), | 907 | connect( action, SIGNAL( activated() ), |
907 | this, SLOT( printCal() ) ); | 908 | this, SLOT( printCal() ) ); |
908 | 909 | ||
909 | icon = loadPixmap( pathString + "print" ); | 910 | icon = loadPixmap( pathString + "print" ); |
910 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 911 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
911 | action->addTo( importMenu ); | 912 | action->addTo( beamMenu_X ); |
912 | connect( action, SIGNAL( activated() ), | 913 | connect( action, SIGNAL( activated() ), |
913 | this, SLOT( printSel() ) ); | 914 | this, SLOT( printSel() ) ); |
914 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 915 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
915 | action->addTo( importMenu ); | 916 | action->addTo( beamMenu_X ); |
916 | connect( action, SIGNAL( activated() ), | 917 | connect( action, SIGNAL( activated() ), |
917 | mView->viewManager(), SIGNAL( printWNV() ) ); | 918 | mView->viewManager(), SIGNAL( printWNV() ) ); |
919 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | ||
918 | #endif | 920 | #endif |
919 | importMenu->insertSeparator(); | 921 | importMenu->insertSeparator(); |
922 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | ||
923 | this ); | ||
924 | action->addTo( importMenu ); | ||
925 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | ||
926 | importMenu->insertSeparator(); | ||
920 | action = new QAction( "beam all", i18n("Save"), 0, | 927 | action = new QAction( "beam all", i18n("Save"), 0, |
921 | this ); | 928 | this ); |
922 | action->addTo( importMenu ); | 929 | action->addTo( importMenu ); |
923 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 930 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
924 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 931 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
925 | this ); | 932 | this ); |
926 | action->addTo( importMenu ); | 933 | action->addTo( importMenu ); |
927 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 934 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
928 | 935 | ||
929 | //menuBar->insertItem( "Configure",configureMenu ); | 936 | //menuBar->insertItem( "Configure",configureMenu ); |
930 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 937 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
931 | icon = loadPixmap( "korganizer/korganizer" ); | 938 | icon = loadPixmap( "korganizer/korganizer" ); |
932 | 939 | ||
933 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 940 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
934 | action->addTo( helpMenu ); | 941 | action->addTo( helpMenu ); |
935 | connect( action, SIGNAL( activated() ), | 942 | connect( action, SIGNAL( activated() ), |
936 | SLOT( whatsNew() ) ); | 943 | SLOT( whatsNew() ) ); |
937 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 944 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
938 | action->addTo( helpMenu ); | 945 | action->addTo( helpMenu ); |
939 | connect( action, SIGNAL( activated() ), | 946 | connect( action, SIGNAL( activated() ), |
940 | SLOT( features() ) ); | 947 | SLOT( features() ) ); |
941 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 948 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
942 | action->addTo( helpMenu ); | 949 | action->addTo( helpMenu ); |
943 | connect( action, SIGNAL( activated() ), | 950 | connect( action, SIGNAL( activated() ), |
944 | SLOT( keyBindings() ) ); | 951 | SLOT( keyBindings() ) ); |
945 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 952 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
946 | action->addTo( helpMenu ); | 953 | action->addTo( helpMenu ); |
947 | connect( action, SIGNAL( activated() ), | 954 | connect( action, SIGNAL( activated() ), |
948 | SLOT( synchowto() ) ); | 955 | SLOT( synchowto() ) ); |
949 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 956 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
950 | action->addTo( helpMenu ); | 957 | action->addTo( helpMenu ); |
951 | connect( action, SIGNAL( activated() ), | 958 | connect( action, SIGNAL( activated() ), |
952 | SLOT( kdesynchowto() ) ); | 959 | SLOT( kdesynchowto() ) ); |
953 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 960 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
954 | action->addTo( helpMenu ); | 961 | action->addTo( helpMenu ); |
955 | connect( action, SIGNAL( activated() ), | 962 | connect( action, SIGNAL( activated() ), |
956 | SLOT( multisynchowto() ) ); | 963 | SLOT( multisynchowto() ) ); |
957 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 964 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
958 | action->addTo( helpMenu ); | 965 | action->addTo( helpMenu ); |
959 | connect( action, SIGNAL( activated() ), | 966 | connect( action, SIGNAL( activated() ), |
960 | SLOT( aboutAutoSaving() ) ); | 967 | SLOT( aboutAutoSaving() ) ); |
961 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 968 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
962 | action->addTo( helpMenu ); | 969 | action->addTo( helpMenu ); |
963 | connect( action, SIGNAL( activated() ), | 970 | connect( action, SIGNAL( activated() ), |
964 | SLOT( aboutKnownBugs() ) ); | 971 | SLOT( aboutKnownBugs() ) ); |
965 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 972 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
966 | action->addTo( helpMenu ); | 973 | action->addTo( helpMenu ); |
967 | connect( action, SIGNAL( activated() ), | 974 | connect( action, SIGNAL( activated() ), |
968 | SLOT( usertrans() ) ); | 975 | SLOT( usertrans() ) ); |
969 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 976 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
970 | action->addTo( helpMenu ); | 977 | action->addTo( helpMenu ); |
971 | connect( action, SIGNAL( activated() ), | 978 | connect( action, SIGNAL( activated() ), |
972 | SLOT( faq() ) ); | 979 | SLOT( faq() ) ); |
973 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 980 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
974 | action->addTo( helpMenu ); | 981 | action->addTo( helpMenu ); |
975 | connect( action, SIGNAL( activated() ), | 982 | connect( action, SIGNAL( activated() ), |
976 | SLOT( licence() ) ); | 983 | SLOT( licence() ) ); |
977 | action = new QAction( "about", i18n("About..."), 0, this ); | 984 | action = new QAction( "about", i18n("About..."), 0, this ); |
978 | action->addTo( helpMenu ); | 985 | action->addTo( helpMenu ); |
979 | connect( action, SIGNAL( activated() ), | 986 | connect( action, SIGNAL( activated() ), |
980 | SLOT( about() ) ); | 987 | SLOT( about() ) ); |
981 | //menuBar->insertSeparator(); | 988 | //menuBar->insertSeparator(); |
982 | 989 | ||
983 | // ****************************************************** | 990 | // ****************************************************** |
984 | // menubar icons | 991 | // menubar icons |
985 | 992 | ||
986 | 993 | ||
987 | iconToolBar->setHorizontalStretchable (true ); | 994 | iconToolBar->setHorizontalStretchable (true ); |
988 | //menuBar->insertItem( iconToolBar ); | 995 | //menuBar->insertItem( iconToolBar ); |
989 | //xdays_action | 996 | //xdays_action |
990 | if (p-> mShowIconNewEvent) | 997 | if (p-> mShowIconNewEvent) |
991 | ne_action->addTo( iconToolBar ); | 998 | ne_action->addTo( iconToolBar ); |
992 | if (p->mShowIconNewTodo ) | 999 | if (p->mShowIconNewTodo ) |
993 | nt_action->addTo( iconToolBar ); | 1000 | nt_action->addTo( iconToolBar ); |
994 | if (p-> mShowIconSearch) | 1001 | if (p-> mShowIconSearch) |
995 | search_action->addTo( iconToolBar ); | 1002 | search_action->addTo( iconToolBar ); |
996 | if (p-> mShowIconNext) | 1003 | if (p-> mShowIconNext) |
997 | whatsnext_action->addTo( iconToolBar ); | 1004 | whatsnext_action->addTo( iconToolBar ); |
998 | if (p-> mShowIconNextDays) | 1005 | if (p-> mShowIconNextDays) |
999 | xdays_action->addTo( iconToolBar ); | 1006 | xdays_action->addTo( iconToolBar ); |
1000 | if (p-> mShowIconList) | 1007 | if (p-> mShowIconList) |
1001 | showlist_action->addTo( iconToolBar ); | 1008 | showlist_action->addTo( iconToolBar ); |
1002 | if (p-> mShowIconDay1) | 1009 | if (p-> mShowIconDay1) |
1003 | day1_action->addTo( iconToolBar ); | 1010 | day1_action->addTo( iconToolBar ); |
1004 | if (p-> mShowIconDay5) | 1011 | if (p-> mShowIconDay5) |
1005 | day5_action->addTo( iconToolBar ); | 1012 | day5_action->addTo( iconToolBar ); |
1006 | if (p-> mShowIconDay7) | 1013 | if (p-> mShowIconDay7) |
1007 | day7_action->addTo( iconToolBar ); | 1014 | day7_action->addTo( iconToolBar ); |
1008 | if (p-> mShowIconDay6) | 1015 | if (p-> mShowIconDay6) |
1009 | day6_action->addTo( iconToolBar ); | 1016 | day6_action->addTo( iconToolBar ); |
1010 | if (p-> mShowIconMonth) | 1017 | if (p-> mShowIconMonth) |
1011 | month_action->addTo( iconToolBar ); | 1018 | month_action->addTo( iconToolBar ); |
1012 | if (p-> mShowIconTodoview) | 1019 | if (p-> mShowIconTodoview) |
1013 | todoview_action->addTo( iconToolBar ); | 1020 | todoview_action->addTo( iconToolBar ); |
1014 | if (p-> mShowIconJournal) | 1021 | if (p-> mShowIconJournal) |
1015 | viewjournal_action->addTo( iconToolBar ); | 1022 | viewjournal_action->addTo( iconToolBar ); |
1016 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1023 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1017 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 1024 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
1018 | if (p-> mShowIconBackFast) { | 1025 | if (p-> mShowIconBackFast) { |
1019 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1026 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1020 | connect( action, SIGNAL( activated() ), | 1027 | connect( action, SIGNAL( activated() ), |
1021 | mView, SLOT( goPreviousMonth() ) ); | 1028 | mView, SLOT( goPreviousMonth() ) ); |
1022 | action->addTo( iconToolBar ); | 1029 | action->addTo( iconToolBar ); |
1023 | } | 1030 | } |
1024 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1031 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1025 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 1032 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
1026 | if (p-> mShowIconBack) { | 1033 | if (p-> mShowIconBack) { |
1027 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1034 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1028 | connect( action, SIGNAL( activated() ), | 1035 | connect( action, SIGNAL( activated() ), |
1029 | mView, SLOT( goPrevious() ) ); | 1036 | mView, SLOT( goPrevious() ) ); |
1030 | action->addTo( iconToolBar ); | 1037 | action->addTo( iconToolBar ); |
1031 | } | 1038 | } |
1032 | icon = loadPixmap( pathString + "today" ); | 1039 | icon = loadPixmap( pathString + "today" ); |
1033 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1040 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1034 | if (p-> mShowIconToday) | 1041 | if (p-> mShowIconToday) |
1035 | today_action->addTo( iconToolBar ); | 1042 | today_action->addTo( iconToolBar ); |
1036 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1043 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1037 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1044 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1038 | if (p-> mShowIconForward) { | 1045 | if (p-> mShowIconForward) { |
1039 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1046 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1040 | connect( action, SIGNAL( activated() ), | 1047 | connect( action, SIGNAL( activated() ), |
1041 | mView, SLOT( goNext() ) ); | 1048 | mView, SLOT( goNext() ) ); |
1042 | action->addTo( iconToolBar ); | 1049 | action->addTo( iconToolBar ); |
1043 | } | 1050 | } |
1044 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1051 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1045 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1052 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1046 | if (p-> mShowIconForwardFast) { | 1053 | if (p-> mShowIconForwardFast) { |
1047 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1054 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1048 | connect( action, SIGNAL( activated() ), | 1055 | connect( action, SIGNAL( activated() ), |
1049 | mView, SLOT( goNextMonth() ) ); | 1056 | mView, SLOT( goNextMonth() ) ); |
1050 | action->addTo( iconToolBar ); | 1057 | action->addTo( iconToolBar ); |
1051 | } | 1058 | } |
1052 | 1059 | ||
1053 | 1060 | ||
1054 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 1061 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
1055 | 1062 | ||
1056 | if (p-> mShowIconNewEvent) | 1063 | if (p-> mShowIconNewEvent) |
1057 | configureToolBarMenu->setItemChecked( 10, true ); | 1064 | configureToolBarMenu->setItemChecked( 10, true ); |
1058 | if (p->mShowIconNewTodo ) | 1065 | if (p->mShowIconNewTodo ) |
1059 | configureToolBarMenu->setItemChecked( 20, true ); | 1066 | configureToolBarMenu->setItemChecked( 20, true ); |
1060 | if (p-> mShowIconSearch) | 1067 | if (p-> mShowIconSearch) |
1061 | configureToolBarMenu->setItemChecked( 120, true ); | 1068 | configureToolBarMenu->setItemChecked( 120, true ); |
1062 | if (p-> mShowIconList) | 1069 | if (p-> mShowIconList) |
1063 | configureToolBarMenu->setItemChecked( 30, true ); | 1070 | configureToolBarMenu->setItemChecked( 30, true ); |
1064 | if (p-> mShowIconDay1) | 1071 | if (p-> mShowIconDay1) |
1065 | configureToolBarMenu->setItemChecked( 40, true ); | 1072 | configureToolBarMenu->setItemChecked( 40, true ); |
1066 | if (p-> mShowIconDay5) | 1073 | if (p-> mShowIconDay5) |
1067 | configureToolBarMenu->setItemChecked( 50, true ); | 1074 | configureToolBarMenu->setItemChecked( 50, true ); |
1068 | if (p-> mShowIconDay6) | 1075 | if (p-> mShowIconDay6) |
1069 | configureToolBarMenu->setItemChecked( 75, true ); | 1076 | configureToolBarMenu->setItemChecked( 75, true ); |
1070 | if (p-> mShowIconDay7) | 1077 | if (p-> mShowIconDay7) |
1071 | configureToolBarMenu->setItemChecked( 60, true ); | 1078 | configureToolBarMenu->setItemChecked( 60, true ); |
1072 | if (p-> mShowIconMonth) | 1079 | if (p-> mShowIconMonth) |
1073 | configureToolBarMenu->setItemChecked( 70, true ); | 1080 | configureToolBarMenu->setItemChecked( 70, true ); |
1074 | if (p-> mShowIconTodoview) | 1081 | if (p-> mShowIconTodoview) |
1075 | configureToolBarMenu->setItemChecked( 80, true ); | 1082 | configureToolBarMenu->setItemChecked( 80, true ); |
1076 | if (p-> mShowIconBackFast) | 1083 | if (p-> mShowIconBackFast) |
1077 | configureToolBarMenu->setItemChecked( 200, true ); | 1084 | configureToolBarMenu->setItemChecked( 200, true ); |
1078 | if (p-> mShowIconBack) | 1085 | if (p-> mShowIconBack) |
1079 | configureToolBarMenu->setItemChecked( 210, true ); | 1086 | configureToolBarMenu->setItemChecked( 210, true ); |
1080 | if (p-> mShowIconToday) | 1087 | if (p-> mShowIconToday) |
1081 | configureToolBarMenu->setItemChecked( 130, true ); | 1088 | configureToolBarMenu->setItemChecked( 130, true ); |
1082 | if (p-> mShowIconForward) | 1089 | if (p-> mShowIconForward) |
1083 | configureToolBarMenu->setItemChecked( 220, true ); | 1090 | configureToolBarMenu->setItemChecked( 220, true ); |
1084 | if (p-> mShowIconForwardFast) | 1091 | if (p-> mShowIconForwardFast) |
1085 | configureToolBarMenu->setItemChecked( 230, true ); | 1092 | configureToolBarMenu->setItemChecked( 230, true ); |
1086 | if (p-> mShowIconNextDays) | 1093 | if (p-> mShowIconNextDays) |
1087 | configureToolBarMenu->setItemChecked( 100, true ); | 1094 | configureToolBarMenu->setItemChecked( 100, true ); |
1088 | if (p-> mShowIconNext) | 1095 | if (p-> mShowIconNext) |
1089 | configureToolBarMenu->setItemChecked( 110, true ); | 1096 | configureToolBarMenu->setItemChecked( 110, true ); |
1090 | if (p-> mShowIconJournal) | 1097 | if (p-> mShowIconJournal) |
1091 | configureToolBarMenu->setItemChecked( 90, true ); | 1098 | configureToolBarMenu->setItemChecked( 90, true ); |
1092 | if (p-> mShowIconWhatsThis) | 1099 | if (p-> mShowIconWhatsThis) |
1093 | configureToolBarMenu->setItemChecked( 300, true ); | 1100 | configureToolBarMenu->setItemChecked( 300, true ); |
1094 | if (p-> mShowIconWeekNum) | 1101 | if (p-> mShowIconWeekNum) |
1095 | configureToolBarMenu->setItemChecked( 400, true ); | 1102 | configureToolBarMenu->setItemChecked( 400, true ); |
1096 | QLabel* dummy = new QLabel( iconToolBar ); | 1103 | QLabel* dummy = new QLabel( iconToolBar ); |
1097 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1104 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1098 | if (!p-> mShowIconStretch) | 1105 | if (!p-> mShowIconStretch) |
1099 | iconToolBar->setStretchableWidget ( dummy ) ; | 1106 | iconToolBar->setStretchableWidget ( dummy ) ; |
1100 | else | 1107 | else |
1101 | configureToolBarMenu->setItemChecked( 5, true ); | 1108 | configureToolBarMenu->setItemChecked( 5, true ); |
1102 | if (p-> mShowIconWhatsThis) | 1109 | if (p-> mShowIconWhatsThis) |
1103 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1110 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1104 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1111 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1105 | configureAgenda( p->mHourSize ); | 1112 | configureAgenda( p->mHourSize ); |
1106 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1113 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1107 | } | 1114 | } |
1108 | 1115 | ||
1109 | void MainWindow::exportToPhone( int mode ) | 1116 | void MainWindow::exportToPhone( int mode ) |
1110 | { | 1117 | { |
1111 | 1118 | ||
1112 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1119 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1113 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1120 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1114 | KOex2phonePrefs ex2phone; | 1121 | KOex2phonePrefs ex2phone; |
1115 | 1122 | ||
1116 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1123 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1117 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1124 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1118 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1125 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1119 | if ( mode == 1 ) | 1126 | if ( mode == 1 ) |
1120 | ex2phone.setCaption(i18n("Export complete calendar")); | 1127 | ex2phone.setCaption(i18n("Export complete calendar")); |
1121 | if ( mode == 2 ) | 1128 | if ( mode == 2 ) |
1122 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1129 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1123 | 1130 | ||
1124 | if ( !ex2phone.exec() ) { | 1131 | if ( !ex2phone.exec() ) { |
1125 | return; | 1132 | return; |
1126 | } | 1133 | } |
1127 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1134 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1128 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1135 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1129 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1136 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1130 | 1137 | ||
1131 | int inFuture = 0; | 1138 | int inFuture = 0; |
1132 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1139 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1133 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1140 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1134 | QPtrList<Incidence> delSel; | 1141 | QPtrList<Incidence> delSel; |
1135 | if ( mode == 1 ) | 1142 | if ( mode == 1 ) |
1136 | delSel = mCalendar->rawIncidences(); | 1143 | delSel = mCalendar->rawIncidences(); |
1137 | if ( mode == 2 ) | 1144 | if ( mode == 2 ) |
1138 | delSel = mCalendar->incidences(); | 1145 | delSel = mCalendar->incidences(); |
1139 | CalendarLocal* cal = new CalendarLocal(); | 1146 | CalendarLocal* cal = new CalendarLocal(); |
1140 | cal->setLocalTime(); | 1147 | cal->setLocalTime(); |
1141 | Incidence *incidence = delSel.first(); | 1148 | Incidence *incidence = delSel.first(); |
1142 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1149 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1143 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1150 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1144 | while ( incidence ) { | 1151 | while ( incidence ) { |
1145 | if ( incidence->type() != "Journal" ) { | 1152 | if ( incidence->type() != "Journal" ) { |
1146 | bool add = true; | 1153 | bool add = true; |
1147 | if ( inFuture ) { | 1154 | if ( inFuture ) { |
1148 | QDateTime dt; | 1155 | QDateTime dt; |
1149 | if ( incidence->type() == "Todo" ) { | 1156 | if ( incidence->type() == "Todo" ) { |
1150 | Todo * t = (Todo*)incidence; | 1157 | Todo * t = (Todo*)incidence; |
1151 | if ( t->hasDueDate() ) | 1158 | if ( t->hasDueDate() ) |
1152 | dt = t->dtDue(); | 1159 | dt = t->dtDue(); |
1153 | else | 1160 | else |
1154 | dt = cur.addSecs( 62 ); | 1161 | dt = cur.addSecs( 62 ); |
1155 | } | 1162 | } |
1156 | else { | 1163 | else { |
1157 | bool ok; | 1164 | bool ok; |
1158 | dt = incidence->getNextOccurence( cur, &ok ); | 1165 | dt = incidence->getNextOccurence( cur, &ok ); |
1159 | if ( !ok ) | 1166 | if ( !ok ) |
1160 | dt = cur.addSecs( -62 ); | 1167 | dt = cur.addSecs( -62 ); |
1161 | } | 1168 | } |
1162 | if ( dt < cur || dt > end ) { | 1169 | if ( dt < cur || dt > end ) { |
1163 | add = false; | 1170 | add = false; |
1164 | } | 1171 | } |
1165 | } | 1172 | } |
1166 | if ( add ) { | 1173 | if ( add ) { |
1167 | Incidence *in = incidence->clone(); | 1174 | Incidence *in = incidence->clone(); |
1168 | cal->addIncidence( in ); | 1175 | cal->addIncidence( in ); |
1169 | } | 1176 | } |
1170 | } | 1177 | } |
1171 | incidence = delSel.next(); | 1178 | incidence = delSel.next(); |
1172 | } | 1179 | } |
1173 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1180 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1174 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1181 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1175 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1182 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1176 | 1183 | ||
1177 | setCaption( i18n("Writing to phone...")); | 1184 | setCaption( i18n("Writing to phone...")); |
1178 | if ( PhoneFormat::writeToPhone( cal ) ) | 1185 | if ( PhoneFormat::writeToPhone( cal ) ) |
1179 | setCaption( i18n("Export to phone successful!")); | 1186 | setCaption( i18n("Export to phone successful!")); |
1180 | else | 1187 | else |
1181 | setCaption( i18n("Error exporting to phone!")); | 1188 | setCaption( i18n("Error exporting to phone!")); |
1182 | delete cal; | 1189 | delete cal; |
1183 | } | 1190 | } |
1184 | 1191 | ||
1185 | 1192 | ||
1186 | void MainWindow::setDefaultPreferences() | 1193 | void MainWindow::setDefaultPreferences() |
1187 | { | 1194 | { |
1188 | KOPrefs *p = KOPrefs::instance(); | 1195 | KOPrefs *p = KOPrefs::instance(); |
1189 | 1196 | ||
1190 | p->mCompactDialogs = true; | 1197 | p->mCompactDialogs = true; |
1191 | p->mConfirm = true; | 1198 | p->mConfirm = true; |
1192 | // p->mEnableQuickTodo = false; | 1199 | // p->mEnableQuickTodo = false; |
1193 | 1200 | ||
1194 | } | 1201 | } |
1195 | 1202 | ||
1196 | QString MainWindow::resourcePath() | 1203 | QString MainWindow::resourcePath() |
1197 | { | 1204 | { |
1198 | return KGlobal::iconLoader()->iconPath(); | 1205 | return KGlobal::iconLoader()->iconPath(); |
1199 | } | 1206 | } |
1200 | 1207 | ||
1201 | void MainWindow::displayText( QString text ,QString cap ) | 1208 | void MainWindow::displayText( QString text ,QString cap ) |
1202 | { | 1209 | { |
1203 | QDialog dia( this, "name", true ); ; | 1210 | QDialog dia( this, "name", true ); ; |
1204 | dia.setCaption( cap ); | 1211 | dia.setCaption( cap ); |
1205 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1212 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1206 | lay->setSpacing( 3 ); | 1213 | lay->setSpacing( 3 ); |
1207 | lay->setMargin( 3 ); | 1214 | lay->setMargin( 3 ); |
1208 | QTextBrowser tb ( &dia ); | 1215 | QTextBrowser tb ( &dia ); |
1209 | lay->addWidget( &tb ); | 1216 | lay->addWidget( &tb ); |
1210 | tb.setText( text ); | 1217 | tb.setText( text ); |
1211 | #ifdef DESKTOP_VERSION | 1218 | #ifdef DESKTOP_VERSION |
1212 | dia.resize( 640, 480); | 1219 | dia.resize( 640, 480); |
1213 | #else | 1220 | #else |
1214 | dia.showMaximized(); | 1221 | dia.showMaximized(); |
1215 | #endif | 1222 | #endif |
1216 | dia.exec(); | 1223 | dia.exec(); |
1217 | } | 1224 | } |
1218 | 1225 | ||
1219 | void MainWindow::features() | 1226 | void MainWindow::features() |
1220 | { | 1227 | { |
1221 | 1228 | ||
1222 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1229 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1223 | } | 1230 | } |
1224 | 1231 | ||
1225 | void MainWindow::usertrans() | 1232 | void MainWindow::usertrans() |
1226 | { | 1233 | { |
1227 | 1234 | ||
1228 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1235 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1229 | } | 1236 | } |
1230 | 1237 | ||
1231 | void MainWindow::kdesynchowto() | 1238 | void MainWindow::kdesynchowto() |
1232 | { | 1239 | { |
1233 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1240 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1234 | } | 1241 | } |
1235 | void MainWindow::multisynchowto() | 1242 | void MainWindow::multisynchowto() |
1236 | { | 1243 | { |
1237 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1244 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1238 | } | 1245 | } |
1239 | void MainWindow::synchowto() | 1246 | void MainWindow::synchowto() |
1240 | { | 1247 | { |
1241 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1248 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1242 | } | 1249 | } |
1243 | void MainWindow::faq() | 1250 | void MainWindow::faq() |
1244 | { | 1251 | { |
1245 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1252 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1246 | 1253 | ||
1247 | } | 1254 | } |
1248 | void MainWindow::whatsNew() | 1255 | void MainWindow::whatsNew() |
1249 | { | 1256 | { |
1250 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1257 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1251 | 1258 | ||
1252 | } | 1259 | } |
1253 | void MainWindow::licence() | 1260 | void MainWindow::licence() |
1254 | { | 1261 | { |
1255 | KApplication::showLicence(); | 1262 | KApplication::showLicence(); |
1256 | 1263 | ||
1257 | } | 1264 | } |
1258 | void MainWindow::about() | 1265 | void MainWindow::about() |
1259 | { | 1266 | { |
1260 | QString version; | 1267 | QString version; |
1261 | #include <../version> | 1268 | #include <../version> |
1262 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1269 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1263 | i18n("KOrganizer/Platform-independent\n") + | 1270 | i18n("KOrganizer/Platform-independent\n") + |
1264 | "(KO/Pi) " + version + " - " + | 1271 | "(KO/Pi) " + version + " - " + |
1265 | 1272 | ||
1266 | #ifdef DESKTOP_VERSION | 1273 | #ifdef DESKTOP_VERSION |
1267 | i18n("Desktop Edition\n") + | 1274 | i18n("Desktop Edition\n") + |
1268 | #else | 1275 | #else |
1269 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1276 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1270 | #endif | 1277 | #endif |
1271 | 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.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1278 | 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.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1272 | } | 1279 | } |
1273 | void MainWindow::keyBindings() | 1280 | void MainWindow::keyBindings() |
1274 | { | 1281 | { |
1275 | QString cap = i18n("KO/Pi Keys + Colors"); | 1282 | QString cap = i18n("KO/Pi Keys + Colors"); |
1276 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1283 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1277 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1284 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1278 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1285 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1279 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1286 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1280 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1287 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1281 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1288 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1282 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1289 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1283 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1290 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1284 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1291 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1285 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1292 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1286 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1293 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1287 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1294 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1288 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1295 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1289 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1296 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1290 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1297 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1291 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1298 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1292 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1299 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1293 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1300 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1294 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1301 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1295 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1302 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1296 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1303 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1297 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1304 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1298 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1305 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1299 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1306 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1300 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1307 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1301 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1308 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1302 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1309 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1303 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1310 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |