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 | |||
@@ -12,64 +12,66 @@ | |||
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() |
@@ -159,123 +161,123 @@ void KODialogManager::showIncomingDialog() | |||
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(), |