Diffstat (limited to 'korganizer/kodialogmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kodialogmanager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index ea30fac..deb1e46 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -1,91 +1,93 @@ | |||
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 | #include <kapplication.h> | 43 | #include <kapplication.h> |
44 | //Added by qt3to4: | ||
45 | #include <Q3PtrList> | ||
44 | 46 | ||
45 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 47 | KODialogManager::KODialogManager( CalendarView *mainView ) : |
46 | QObject(), mMainView( mainView ) | 48 | QObject(), mMainView( mainView ) |
47 | { | 49 | { |
48 | mOutgoingDialog = 0; | 50 | mOutgoingDialog = 0; |
49 | mIncomingDialog = 0; | 51 | mIncomingDialog = 0; |
50 | mOptionsDialog = 0; | 52 | mOptionsDialog = 0; |
51 | mSearchDialog = 0; | 53 | mSearchDialog = 0; |
52 | mArchiveDialog = 0; | 54 | mArchiveDialog = 0; |
53 | mFilterEditDialog = 0; | 55 | mFilterEditDialog = 0; |
54 | mPluginDialog = 0; | 56 | mPluginDialog = 0; |
55 | 57 | ||
56 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); | 58 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); |
57 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); | 59 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); |
58 | } | 60 | } |
59 | 61 | ||
60 | KODialogManager::~KODialogManager() | 62 | KODialogManager::~KODialogManager() |
61 | { | 63 | { |
62 | delete mOutgoingDialog; | 64 | delete mOutgoingDialog; |
63 | delete mIncomingDialog; | 65 | delete mIncomingDialog; |
64 | delete mOptionsDialog; | 66 | delete mOptionsDialog; |
65 | delete mSearchDialog; | 67 | delete mSearchDialog; |
66 | #ifndef KORG_NOARCHIVE | 68 | #ifndef KORG_NOARCHIVE |
67 | delete mArchiveDialog; | 69 | delete mArchiveDialog; |
68 | #endif | 70 | #endif |
69 | delete mFilterEditDialog; | 71 | delete mFilterEditDialog; |
70 | #ifndef KORG_NOPLUGINS | 72 | #ifndef KORG_NOPLUGINS |
71 | delete mPluginDialog; | 73 | delete mPluginDialog; |
72 | #endif | 74 | #endif |
73 | } | 75 | } |
74 | 76 | ||
75 | OutgoingDialog *KODialogManager::outgoingDialog() | 77 | OutgoingDialog *KODialogManager::outgoingDialog() |
76 | { | 78 | { |
77 | createOutgoingDialog(); | 79 | createOutgoingDialog(); |
78 | return mOutgoingDialog; | 80 | return mOutgoingDialog; |
79 | } | 81 | } |
80 | 82 | ||
81 | void KODialogManager::createOutgoingDialog() | 83 | void KODialogManager::createOutgoingDialog() |
82 | { | 84 | { |
83 | if (!mOutgoingDialog) { | 85 | if (!mOutgoingDialog) { |
84 | mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); | 86 | mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); |
85 | if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); | 87 | if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); |
86 | connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), | 88 | connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), |
87 | mMainView,SIGNAL(numOutgoingChanged(int))); | 89 | mMainView,SIGNAL(numOutgoingChanged(int))); |
88 | } | 90 | } |
89 | } | 91 | } |
90 | 92 | ||
91 | void KODialogManager::showGlobalOptionsDialog( bool showSync ) | 93 | void KODialogManager::showGlobalOptionsDialog( bool showSync ) |
@@ -143,155 +145,155 @@ IncomingDialog *KODialogManager::incomingDialog() | |||
143 | void KODialogManager::createIncomingDialog() | 145 | void KODialogManager::createIncomingDialog() |
144 | { | 146 | { |
145 | createOutgoingDialog(); | 147 | createOutgoingDialog(); |
146 | if (!mIncomingDialog) { | 148 | if (!mIncomingDialog) { |
147 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); | 149 | mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); |
148 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), | 150 | connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), |
149 | mMainView,SIGNAL(numIncomingChanged(int))); | 151 | mMainView,SIGNAL(numIncomingChanged(int))); |
150 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), | 152 | connect(mIncomingDialog,SIGNAL(calendarUpdated()), |
151 | mMainView,SLOT(updateView())); | 153 | mMainView,SLOT(updateView())); |
152 | } | 154 | } |
153 | } | 155 | } |
154 | 156 | ||
155 | void KODialogManager::showIncomingDialog() | 157 | void KODialogManager::showIncomingDialog() |
156 | { | 158 | { |
157 | createIncomingDialog(); | 159 | createIncomingDialog(); |
158 | mIncomingDialog->show(); | 160 | mIncomingDialog->show(); |
159 | mIncomingDialog->raise(); | 161 | mIncomingDialog->raise(); |
160 | } | 162 | } |
161 | /* | 163 | /* |
162 | void KODialogManager::showCategoryEditDialog() | 164 | void KODialogManager::showCategoryEditDialog() |
163 | { | 165 | { |
164 | mCategoryEditDialog->show(); | 166 | mCategoryEditDialog->show(); |
165 | } | 167 | } |
166 | */ | 168 | */ |
167 | void KODialogManager::hideSearchDialog() | 169 | void KODialogManager::hideSearchDialog() |
168 | { | 170 | { |
169 | if (mSearchDialog) | 171 | if (mSearchDialog) |
170 | mSearchDialog->hide(); | 172 | mSearchDialog->hide(); |
171 | } | 173 | } |
172 | 174 | ||
173 | void KODialogManager::showSearchDialog() | 175 | void KODialogManager::showSearchDialog() |
174 | { | 176 | { |
175 | if (!mSearchDialog) { | 177 | if (!mSearchDialog) { |
176 | mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); | 178 | mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); |
177 | KOListView * lview = mSearchDialog->listview(); | 179 | KOListView * lview = mSearchDialog->listview(); |
178 | 180 | ||
179 | connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), | 181 | connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), |
180 | mMainView, SLOT(showIncidence(Incidence *))); | 182 | mMainView, SLOT(showIncidence(Incidence *))); |
181 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), | 183 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), |
182 | mMainView, SLOT(editIncidence(Incidence *))); | 184 | mMainView, SLOT(editIncidence(Incidence *))); |
183 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), | 185 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), |
184 | mMainView, SLOT(deleteIncidence(Incidence *))); | 186 | mMainView, SLOT(deleteIncidence(Incidence *))); |
185 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), | 187 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), |
186 | mMainView, SLOT(cloneIncidence(Incidence *))); | 188 | mMainView, SLOT(cloneIncidence(Incidence *))); |
187 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), | 189 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), |
188 | mMainView, SLOT(beamIncidence(Incidence *))); | 190 | mMainView, SLOT(beamIncidence(Incidence *))); |
189 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), | 191 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), |
190 | mMainView, SLOT(moveIncidence(Incidence *))); | 192 | mMainView, SLOT(moveIncidence(Incidence *))); |
191 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), | 193 | connect(lview, SIGNAL(beamIncidenceList(Q3PtrList<Incidence> )), |
192 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); | 194 | mMainView, SLOT(beamIncidenceList(Q3PtrList<Incidence> ))); |
193 | 195 | ||
194 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); | 196 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); |
195 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); | 197 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); |
196 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), | 198 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), |
197 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 199 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
198 | #ifndef DESKTOP_VERSION | 200 | #ifndef DESKTOP_VERSION |
199 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | 201 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
200 | mSearchDialog->showMaximized(); | 202 | mSearchDialog->showMaximized(); |
201 | #else | 203 | #else |
202 | KConfig *config = KOGlobals::config(); | 204 | KConfig *config = KOGlobals::config(); |
203 | config->setGroup("WidgetLayout"); | 205 | config->setGroup("WidgetLayout"); |
204 | QStringList list; | 206 | QStringList list; |
205 | list = config->readListEntry("SearchLayout"); | 207 | list = config->readListEntry("SearchLayout"); |
206 | int x,y,w,h; | 208 | int x,y,w,h; |
207 | if ( ! list.isEmpty() ) { | 209 | if ( ! list.isEmpty() ) { |
208 | x = list[0].toInt(); | 210 | x = list[0].toInt(); |
209 | y = list[1].toInt(); | 211 | y = list[1].toInt(); |
210 | w = list[2].toInt(); | 212 | w = list[2].toInt(); |
211 | h = list[3].toInt(); | 213 | h = list[3].toInt(); |
212 | KApplication::testCoords( &x,&y,&w,&h ); | 214 | KApplication::testCoords( &x,&y,&w,&h ); |
213 | mSearchDialog->setGeometry(x,y,w,h); | 215 | mSearchDialog->setGeometry(x,y,w,h); |
214 | 216 | ||
215 | } | 217 | } |
216 | 218 | ||
217 | #endif | 219 | #endif |
218 | } | 220 | } |
219 | // make sure the widget is on top again | 221 | // make sure the widget is on top again |
220 | #ifdef DESKTOP_VERSION | 222 | #ifdef DESKTOP_VERSION |
221 | mSearchDialog->show(); | 223 | mSearchDialog->show(); |
222 | #else | 224 | #else |
223 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | 225 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
224 | mSearchDialog->showMaximized(); | 226 | mSearchDialog->showMaximized(); |
225 | #endif | 227 | #endif |
226 | mSearchDialog->raiseAndSelect(); | 228 | mSearchDialog->raiseAndSelect(); |
227 | } | 229 | } |
228 | 230 | ||
229 | SearchDialog * KODialogManager::getSearchDialog() | 231 | SearchDialog * KODialogManager::getSearchDialog() |
230 | { | 232 | { |
231 | return mSearchDialog; | 233 | return mSearchDialog; |
232 | } | 234 | } |
233 | void KODialogManager::showArchiveDialog() | 235 | void KODialogManager::showArchiveDialog() |
234 | { | 236 | { |
235 | #ifndef KORG_NOARCHIVE | 237 | #ifndef KORG_NOARCHIVE |
236 | if (!mArchiveDialog) { | 238 | if (!mArchiveDialog) { |
237 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); | 239 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); |
238 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), | 240 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), |
239 | mMainView,SLOT(updateView())); | 241 | mMainView,SLOT(updateView())); |
240 | } | 242 | } |
241 | mArchiveDialog->show(); | 243 | mArchiveDialog->show(); |
242 | mArchiveDialog->raise(); | 244 | mArchiveDialog->raise(); |
243 | 245 | ||
244 | // Workaround. | 246 | // Workaround. |
245 | QApplication::restoreOverrideCursor(); | 247 | QApplication::restoreOverrideCursor(); |
246 | #endif | 248 | #endif |
247 | } | 249 | } |
248 | 250 | ||
249 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 251 | void KODialogManager::showFilterEditDialog(Q3PtrList<CalFilter> *filters) |
250 | { | 252 | { |
251 | if (!mFilterEditDialog) { | 253 | if (!mFilterEditDialog) { |
252 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); | 254 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); |
253 | connect(mFilterEditDialog,SIGNAL(filterChanged()), | 255 | connect(mFilterEditDialog,SIGNAL(filterChanged()), |
254 | mMainView,SLOT(filterEdited())); | 256 | mMainView,SLOT(filterEdited())); |
255 | 257 | ||
256 | } | 258 | } |
257 | 259 | ||
258 | #ifndef DESKTOP_VERSION | 260 | #ifndef DESKTOP_VERSION |
259 | mFilterEditDialog->showMaximized(); | 261 | mFilterEditDialog->showMaximized(); |
260 | #else | 262 | #else |
261 | mFilterEditDialog->show(); | 263 | mFilterEditDialog->show(); |
262 | #endif | 264 | #endif |
263 | mFilterEditDialog->raise(); | 265 | mFilterEditDialog->raise(); |
264 | } | 266 | } |
265 | 267 | ||
266 | void KODialogManager::showPluginDialog() | 268 | void KODialogManager::showPluginDialog() |
267 | { | 269 | { |
268 | #ifndef KORG_NOPLUGINS | 270 | #ifndef KORG_NOPLUGINS |
269 | if (!mPluginDialog) { | 271 | if (!mPluginDialog) { |
270 | mPluginDialog = new PluginDialog(mMainView); | 272 | mPluginDialog = new PluginDialog(mMainView); |
271 | connect(mPluginDialog,SIGNAL(configChanged()), | 273 | connect(mPluginDialog,SIGNAL(configChanged()), |
272 | mMainView,SLOT(updateConfig())); | 274 | mMainView,SLOT(updateConfig())); |
273 | } | 275 | } |
274 | mPluginDialog->show(); | 276 | mPluginDialog->show(); |
275 | mPluginDialog->raise(); | 277 | mPluginDialog->raise(); |
276 | #endif | 278 | #endif |
277 | } | 279 | } |
278 | 280 | ||
279 | KOEventEditor *KODialogManager::getEventEditor() | 281 | KOEventEditor *KODialogManager::getEventEditor() |
280 | { | 282 | { |
281 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), | 283 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), |
282 | mMainView ); | 284 | mMainView ); |
283 | 285 | ||
284 | connect(eventEditor,SIGNAL(eventAdded(Event *)), | 286 | connect(eventEditor,SIGNAL(eventAdded(Event *)), |
285 | mMainView,SLOT(eventAdded(Event *))); | 287 | mMainView,SLOT(eventAdded(Event *))); |
286 | connect(eventEditor,SIGNAL(eventChanged(Event *)), | 288 | connect(eventEditor,SIGNAL(eventChanged(Event *)), |
287 | mMainView,SLOT(eventChanged(Event *))); | 289 | mMainView,SLOT(eventChanged(Event *))); |
288 | connect(eventEditor,SIGNAL(eventDeleted()), | 290 | connect(eventEditor,SIGNAL(eventDeleted()), |
289 | mMainView,SLOT(eventDeleted())); | 291 | mMainView,SLOT(eventDeleted())); |
290 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), | 292 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), |
291 | mMainView,SLOT(schedule_cancel(Incidence *))); | 293 | mMainView,SLOT(schedule_cancel(Incidence *))); |
292 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), | 294 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), |
293 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 295 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
294 | connect( eventEditor, SIGNAL( showAgendaView( bool)), | 296 | connect( eventEditor, SIGNAL( showAgendaView( bool)), |
295 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 297 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
296 | 298 | ||
297 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 299 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |