-rw-r--r-- | korganizer/kodialogmanager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index 1af9dad..a8652ea 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -88,257 +88,258 @@ void KODialogManager::createOutgoingDialog() | |||
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->showMaximized(); | 195 | mSearchDialog->showMaximized(); |
196 | #else | 196 | #else |
197 | KConfig *config = KOGlobals::config(); | 197 | KConfig *config = KOGlobals::config(); |
198 | config->setGroup("WidgetLayout"); | 198 | config->setGroup("WidgetLayout"); |
199 | QStringList list; | 199 | QStringList list; |
200 | list = config->readListEntry("SearchLayout"); | 200 | list = config->readListEntry("SearchLayout"); |
201 | int x,y,w,h; | 201 | int x,y,w,h; |
202 | if ( ! list.isEmpty() ) { | 202 | if ( ! list.isEmpty() ) { |
203 | x = list[0].toInt(); | 203 | x = list[0].toInt(); |
204 | y = list[1].toInt(); | 204 | y = list[1].toInt(); |
205 | w = list[2].toInt(); | 205 | w = list[2].toInt(); |
206 | h = list[3].toInt(); | 206 | h = list[3].toInt(); |
207 | mSearchDialog->setGeometry(x,y,w,h); | 207 | mSearchDialog->setGeometry(x,y,w,h); |
208 | 208 | ||
209 | } | 209 | } |
210 | 210 | ||
211 | #endif | 211 | #endif |
212 | } | 212 | } |
213 | // make sure the widget is on top again | 213 | // make sure the widget is on top again |
214 | #ifdef DESKTOP_VERSION | 214 | #ifdef DESKTOP_VERSION |
215 | mSearchDialog->show(); | 215 | mSearchDialog->show(); |
216 | #else | 216 | #else |
217 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | ||
217 | mSearchDialog->showMaximized(); | 218 | mSearchDialog->showMaximized(); |
218 | #endif | 219 | #endif |
219 | mSearchDialog->raise(); | 220 | mSearchDialog->raise(); |
220 | } | 221 | } |
221 | 222 | ||
222 | SearchDialog * KODialogManager::getSearchDialog() | 223 | SearchDialog * KODialogManager::getSearchDialog() |
223 | { | 224 | { |
224 | return mSearchDialog; | 225 | return mSearchDialog; |
225 | } | 226 | } |
226 | void KODialogManager::showArchiveDialog() | 227 | void KODialogManager::showArchiveDialog() |
227 | { | 228 | { |
228 | #ifndef KORG_NOARCHIVE | 229 | #ifndef KORG_NOARCHIVE |
229 | if (!mArchiveDialog) { | 230 | if (!mArchiveDialog) { |
230 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); | 231 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); |
231 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), | 232 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), |
232 | mMainView,SLOT(updateView())); | 233 | mMainView,SLOT(updateView())); |
233 | } | 234 | } |
234 | mArchiveDialog->show(); | 235 | mArchiveDialog->show(); |
235 | mArchiveDialog->raise(); | 236 | mArchiveDialog->raise(); |
236 | 237 | ||
237 | // Workaround. | 238 | // Workaround. |
238 | QApplication::restoreOverrideCursor(); | 239 | QApplication::restoreOverrideCursor(); |
239 | #endif | 240 | #endif |
240 | } | 241 | } |
241 | 242 | ||
242 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 243 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) |
243 | { | 244 | { |
244 | if (!mFilterEditDialog) { | 245 | if (!mFilterEditDialog) { |
245 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); | 246 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); |
246 | connect(mFilterEditDialog,SIGNAL(filterChanged()), | 247 | connect(mFilterEditDialog,SIGNAL(filterChanged()), |
247 | mMainView,SLOT(filterEdited())); | 248 | mMainView,SLOT(filterEdited())); |
248 | 249 | ||
249 | } | 250 | } |
250 | 251 | ||
251 | #ifndef DESKTOP_VERSION | 252 | #ifndef DESKTOP_VERSION |
252 | mFilterEditDialog->showMaximized(); | 253 | mFilterEditDialog->showMaximized(); |
253 | #else | 254 | #else |
254 | mFilterEditDialog->show(); | 255 | mFilterEditDialog->show(); |
255 | #endif | 256 | #endif |
256 | mFilterEditDialog->raise(); | 257 | mFilterEditDialog->raise(); |
257 | } | 258 | } |
258 | 259 | ||
259 | void KODialogManager::showPluginDialog() | 260 | void KODialogManager::showPluginDialog() |
260 | { | 261 | { |
261 | #ifndef KORG_NOPLUGINS | 262 | #ifndef KORG_NOPLUGINS |
262 | if (!mPluginDialog) { | 263 | if (!mPluginDialog) { |
263 | mPluginDialog = new PluginDialog(mMainView); | 264 | mPluginDialog = new PluginDialog(mMainView); |
264 | connect(mPluginDialog,SIGNAL(configChanged()), | 265 | connect(mPluginDialog,SIGNAL(configChanged()), |
265 | mMainView,SLOT(updateConfig())); | 266 | mMainView,SLOT(updateConfig())); |
266 | } | 267 | } |
267 | mPluginDialog->show(); | 268 | mPluginDialog->show(); |
268 | mPluginDialog->raise(); | 269 | mPluginDialog->raise(); |
269 | #endif | 270 | #endif |
270 | } | 271 | } |
271 | 272 | ||
272 | KOEventEditor *KODialogManager::getEventEditor() | 273 | KOEventEditor *KODialogManager::getEventEditor() |
273 | { | 274 | { |
274 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), | 275 | KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), |
275 | mMainView ); | 276 | mMainView ); |
276 | 277 | ||
277 | connect(eventEditor,SIGNAL(eventAdded(Event *)), | 278 | connect(eventEditor,SIGNAL(eventAdded(Event *)), |
278 | mMainView,SLOT(eventAdded(Event *))); | 279 | mMainView,SLOT(eventAdded(Event *))); |
279 | connect(eventEditor,SIGNAL(eventChanged(Event *)), | 280 | connect(eventEditor,SIGNAL(eventChanged(Event *)), |
280 | mMainView,SLOT(eventChanged(Event *))); | 281 | mMainView,SLOT(eventChanged(Event *))); |
281 | connect(eventEditor,SIGNAL(eventDeleted()), | 282 | connect(eventEditor,SIGNAL(eventDeleted()), |
282 | mMainView,SLOT(eventDeleted())); | 283 | mMainView,SLOT(eventDeleted())); |
283 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), | 284 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), |
284 | mMainView,SLOT(schedule_cancel(Incidence *))); | 285 | mMainView,SLOT(schedule_cancel(Incidence *))); |
285 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), | 286 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), |
286 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 287 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
287 | connect( eventEditor, SIGNAL( showAgendaView( bool)), | 288 | connect( eventEditor, SIGNAL( showAgendaView( bool)), |
288 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 289 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
289 | 290 | ||
290 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 291 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
291 | // eventEditor,SLOT(updateCategoryConfig())); | 292 | // eventEditor,SLOT(updateCategoryConfig())); |
292 | // connect(eventEditor,SIGNAL(editCategories()), | 293 | // connect(eventEditor,SIGNAL(editCategories()), |
293 | // mCategoryEditDialog,SLOT(show())); | 294 | // mCategoryEditDialog,SLOT(show())); |
294 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), | 295 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), |
295 | mMainView,SLOT(dialogClosing(Incidence*))); | 296 | mMainView,SLOT(dialogClosing(Incidence*))); |
296 | 297 | ||
297 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); | 298 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); |
298 | 299 | ||
299 | #ifndef DESKTOP_VERSION | 300 | #ifndef DESKTOP_VERSION |
300 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); | 301 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); |
301 | #endif | 302 | #endif |
302 | return eventEditor; | 303 | return eventEditor; |
303 | } | 304 | } |
304 | 305 | ||
305 | KOTodoEditor *KODialogManager::getTodoEditor() | 306 | KOTodoEditor *KODialogManager::getTodoEditor() |
306 | { | 307 | { |
307 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), | 308 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), |
308 | mMainView ); | 309 | mMainView ); |
309 | 310 | ||
310 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 311 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
311 | // todoEditor,SLOT(updateCategoryConfig())); | 312 | // todoEditor,SLOT(updateCategoryConfig())); |
312 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); | 313 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); |
313 | 314 | ||
314 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), | 315 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), |
315 | mMainView,SLOT(todoAdded(Todo *))); | 316 | mMainView,SLOT(todoAdded(Todo *))); |
316 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), | 317 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), |
317 | mMainView,SLOT(todoChanged(Todo *))); | 318 | mMainView,SLOT(todoChanged(Todo *))); |
318 | connect(todoEditor,SIGNAL(todoDeleted()), | 319 | connect(todoEditor,SIGNAL(todoDeleted()), |
319 | mMainView,SLOT(todoDeleted())); | 320 | mMainView,SLOT(todoDeleted())); |
320 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), | 321 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), |
321 | mMainView,SLOT(dialogClosing(Incidence*))); | 322 | mMainView,SLOT(dialogClosing(Incidence*))); |
322 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), | 323 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), |
323 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 324 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
324 | connect( todoEditor, SIGNAL( showAgendaView( bool)), | 325 | connect( todoEditor, SIGNAL( showAgendaView( bool)), |
325 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 326 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
326 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), | 327 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), |
327 | // mMainView,SLOT(schedule_cancel(Incidence *))); | 328 | // mMainView,SLOT(schedule_cancel(Incidence *))); |
328 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); | 329 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); |
329 | #ifndef DESKTOP_VERSION | 330 | #ifndef DESKTOP_VERSION |
330 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); | 331 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); |
331 | #endif | 332 | #endif |
332 | return todoEditor; | 333 | return todoEditor; |
333 | } | 334 | } |
334 | 335 | ||
335 | void KODialogManager::updateSearchDialog() | 336 | void KODialogManager::updateSearchDialog() |
336 | { | 337 | { |
337 | if (mSearchDialog) mSearchDialog->updateView(); | 338 | if (mSearchDialog) mSearchDialog->updateView(); |
338 | } | 339 | } |
339 | 340 | ||
340 | void KODialogManager::setDocumentId( const QString &id ) | 341 | void KODialogManager::setDocumentId( const QString &id ) |
341 | { | 342 | { |
342 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); | 343 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); |
343 | } | 344 | } |
344 | 345 | ||