Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index e8d5ab1..a88276e 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -214,196 +214,201 @@ void KOViewManager::updateView() | |||
214 | // if we are updating mTodoView, we get endless recursion | 214 | // if we are updating mTodoView, we get endless recursion |
215 | if ( mTodoView == mCurrentView ) | 215 | if ( mTodoView == mCurrentView ) |
216 | return; | 216 | return; |
217 | if ( mCurrentView ) mCurrentView->updateView(); | 217 | if ( mCurrentView ) mCurrentView->updateView(); |
218 | 218 | ||
219 | } | 219 | } |
220 | 220 | ||
221 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 221 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
222 | { | 222 | { |
223 | // kdDebug() << "KOViewManager::updateView()" << endl; | 223 | // kdDebug() << "KOViewManager::updateView()" << endl; |
224 | 224 | ||
225 | if (mCurrentView) mCurrentView->showDates(start, end); | 225 | if (mCurrentView) mCurrentView->showDates(start, end); |
226 | 226 | ||
227 | if (mTodoView) mTodoView->updateView(); | 227 | if (mTodoView) mTodoView->updateView(); |
228 | } | 228 | } |
229 | 229 | ||
230 | 230 | ||
231 | void KOViewManager::updateWNview() | 231 | void KOViewManager::updateWNview() |
232 | { | 232 | { |
233 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 233 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
234 | mWhatsNextView->updateView(); | 234 | mWhatsNextView->updateView(); |
235 | 235 | ||
236 | } | 236 | } |
237 | void KOViewManager::showWhatsNextView() | 237 | void KOViewManager::showWhatsNextView() |
238 | { | 238 | { |
239 | if (!mWhatsNextView) { | 239 | if (!mWhatsNextView) { |
240 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 240 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
241 | "KOViewManager::WhatsNextView"); | 241 | "KOViewManager::WhatsNextView"); |
242 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 242 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
243 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 243 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
244 | addView(mWhatsNextView); | 244 | addView(mWhatsNextView); |
245 | connect(this, SIGNAL( printWNV() ), | 245 | connect(this, SIGNAL( printWNV() ), |
246 | mWhatsNextView, SLOT( printMe() ) ); | 246 | mWhatsNextView, SLOT( printMe() ) ); |
247 | } | 247 | } |
248 | globalFlagBlockAgenda = 1; | 248 | globalFlagBlockAgenda = 1; |
249 | showView(mWhatsNextView, true ); | 249 | showView(mWhatsNextView, true ); |
250 | //mWhatsNextView->updateView(); | 250 | //mWhatsNextView->updateView(); |
251 | 251 | ||
252 | } | 252 | } |
253 | 253 | ||
254 | void KOViewManager::showListView() | 254 | void KOViewManager::showListView() |
255 | { | 255 | { |
256 | if (!mListView) { | 256 | if (!mListView) { |
257 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 257 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
258 | addView(mListView); | 258 | addView(mListView); |
259 | 259 | ||
260 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 260 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
261 | mMainView, SLOT(showIncidence(Incidence *))); | 261 | mMainView, SLOT(showIncidence(Incidence *))); |
262 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 262 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
263 | mMainView, SLOT(editIncidence(Incidence *))); | 263 | mMainView, SLOT(editIncidence(Incidence *))); |
264 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 264 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
265 | mMainView, SLOT(deleteIncidence(Incidence *))); | 265 | mMainView, SLOT(deleteIncidence(Incidence *))); |
266 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 266 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
267 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 267 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
268 | connect( mListView, SIGNAL( signalNewEvent() ), | 268 | connect( mListView, SIGNAL( signalNewEvent() ), |
269 | mMainView, SLOT( newEvent() ) ); | 269 | mMainView, SLOT( newEvent() ) ); |
270 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 270 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
271 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 271 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
272 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 272 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
273 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 273 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
274 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 274 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
275 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 275 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
276 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 276 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
277 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 277 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
278 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 278 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
279 | } | 279 | } |
280 | // bool temp = mFlagShowNextxDays; | 280 | // bool temp = mFlagShowNextxDays; |
281 | //globalFlagBlockPainting = true; | 281 | //globalFlagBlockPainting = true; |
282 | globalFlagBlockAgenda = 1; | 282 | globalFlagBlockAgenda = 1; |
283 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 283 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
284 | mMainView->setBlockShowDates( true ); | 284 | mMainView->setBlockShowDates( true ); |
285 | mMainView->dateNavigator()->selectMonth(); | 285 | mMainView->dateNavigator()->selectMonth(); |
286 | mMainView->setBlockShowDates( false ); | 286 | mMainView->setBlockShowDates( false ); |
287 | } | 287 | } |
288 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 288 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
289 | //mFlagShowNextxDays = temp; | 289 | //mFlagShowNextxDays = temp; |
290 | } | 290 | } |
291 | 291 | ||
292 | void KOViewManager::showAgendaView( bool fullScreen ) | 292 | void KOViewManager::showAgendaView( bool fullScreen ) |
293 | { | 293 | { |
294 | 294 | ||
295 | mMainView->dialogManager()->hideSearchDialog(); | 295 | mMainView->dialogManager()->hideSearchDialog(); |
296 | // qDebug("KOViewManager::showAgendaView "); | 296 | // qDebug("KOViewManager::showAgendaView "); |
297 | bool full; | 297 | bool full; |
298 | full = fullScreen; | 298 | full = fullScreen; |
299 | if (!mAgendaView) { | 299 | if (!mAgendaView) { |
300 | full = false; | 300 | full = false; |
301 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 301 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
302 | addView(mAgendaView); | 302 | addView(mAgendaView); |
303 | #ifndef DESKTOP_VERSION | 303 | #ifndef DESKTOP_VERSION |
304 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 304 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
305 | #endif | 305 | #endif |
306 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 306 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
307 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 307 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
308 | 308 | ||
309 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 309 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
310 | |||
311 | |||
312 | |||
313 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), | ||
314 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); | ||
310 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 315 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
311 | mMainView, SLOT(newEvent(QDateTime))); | 316 | mMainView, SLOT(newEvent(QDateTime))); |
312 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 317 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
313 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 318 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
314 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 319 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
315 | mMainView, SLOT(newEvent(QDate))); | 320 | mMainView, SLOT(newEvent(QDate))); |
316 | 321 | ||
317 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 322 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
318 | mMainView, SLOT(editIncidence(Incidence *))); | 323 | mMainView, SLOT(editIncidence(Incidence *))); |
319 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 324 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
320 | mMainView, SLOT(showIncidence(Incidence *))); | 325 | mMainView, SLOT(showIncidence(Incidence *))); |
321 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 326 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
322 | mMainView, SLOT(deleteIncidence(Incidence *))); | 327 | mMainView, SLOT(deleteIncidence(Incidence *))); |
323 | 328 | ||
324 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 329 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
325 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 330 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
326 | 331 | ||
327 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 332 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
328 | mMainView, SLOT( toggleExpand() ) ); | 333 | mMainView, SLOT( toggleExpand() ) ); |
329 | 334 | ||
330 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), | 335 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), |
331 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); | 336 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); |
332 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 337 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
333 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 338 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
334 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 339 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
335 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 340 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
336 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 341 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
337 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 342 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
338 | SLOT( updateTodo( Todo *, int ) ) ); | 343 | SLOT( updateTodo( Todo *, int ) ) ); |
339 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 344 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
340 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 345 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
341 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 346 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
342 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 347 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
343 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 348 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
344 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 349 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
345 | mAgendaView->readSettings(); | 350 | mAgendaView->readSettings(); |
346 | mAgendaView->updateConfig(); | 351 | mAgendaView->updateConfig(); |
347 | } | 352 | } |
348 | 353 | ||
349 | showView( mAgendaView, full); | 354 | showView( mAgendaView, full); |
350 | 355 | ||
351 | } | 356 | } |
352 | 357 | ||
353 | void KOViewManager::showDayView() | 358 | void KOViewManager::showDayView() |
354 | { | 359 | { |
355 | mFlagShowNextxDays = false; | 360 | mFlagShowNextxDays = false; |
356 | globalFlagBlockLabel = 1; | 361 | globalFlagBlockLabel = 1; |
357 | globalFlagBlockAgenda = 1; | 362 | globalFlagBlockAgenda = 1; |
358 | if ( mCurrentAgendaView != 1 ) | 363 | if ( mCurrentAgendaView != 1 ) |
359 | mCurrentAgendaView = -1; | 364 | mCurrentAgendaView = -1; |
360 | showAgendaView(); | 365 | showAgendaView(); |
361 | qApp->processEvents(); | 366 | qApp->processEvents(); |
362 | globalFlagBlockAgenda = 2; | 367 | globalFlagBlockAgenda = 2; |
363 | globalFlagBlockLabel = 0; | 368 | globalFlagBlockLabel = 0; |
364 | mMainView->dateNavigator()->selectDates( 1 ); | 369 | mMainView->dateNavigator()->selectDates( 1 ); |
365 | mCurrentAgendaView = 1 ; | 370 | mCurrentAgendaView = 1 ; |
366 | 371 | ||
367 | } | 372 | } |
368 | 373 | ||
369 | void KOViewManager::showWorkWeekView() | 374 | void KOViewManager::showWorkWeekView() |
370 | { | 375 | { |
371 | mFlagShowNextxDays = false; | 376 | mFlagShowNextxDays = false; |
372 | globalFlagBlockAgenda = 1; | 377 | globalFlagBlockAgenda = 1; |
373 | globalFlagBlockLabel = 1; | 378 | globalFlagBlockLabel = 1; |
374 | if ( mCurrentAgendaView != 5 ) | 379 | if ( mCurrentAgendaView != 5 ) |
375 | mCurrentAgendaView = -1; | 380 | mCurrentAgendaView = -1; |
376 | showAgendaView(); | 381 | showAgendaView(); |
377 | qApp->processEvents(); | 382 | qApp->processEvents(); |
378 | globalFlagBlockAgenda = 2; | 383 | globalFlagBlockAgenda = 2; |
379 | globalFlagBlockLabel = 0; | 384 | globalFlagBlockLabel = 0; |
380 | mMainView->dateNavigator()->selectWorkWeek(); | 385 | mMainView->dateNavigator()->selectWorkWeek(); |
381 | mCurrentAgendaView = 5 ; | 386 | mCurrentAgendaView = 5 ; |
382 | 387 | ||
383 | } | 388 | } |
384 | 389 | ||
385 | void KOViewManager::showWeekView() | 390 | void KOViewManager::showWeekView() |
386 | { | 391 | { |
387 | /* | 392 | /* |
388 | globalFlagBlockAgenda = 2; | 393 | globalFlagBlockAgenda = 2; |
389 | qDebug("4globalFlagBlockAgenda = 2; "); | 394 | qDebug("4globalFlagBlockAgenda = 2; "); |
390 | //globalFlagBlockPainting = true; | 395 | //globalFlagBlockPainting = true; |
391 | mMainView->dateNavigator()->selectWeek(); | 396 | mMainView->dateNavigator()->selectWeek(); |
392 | showAgendaView(); | 397 | showAgendaView(); |
393 | */ | 398 | */ |
394 | 399 | ||
395 | 400 | ||
396 | mFlagShowNextxDays = false; | 401 | mFlagShowNextxDays = false; |
397 | globalFlagBlockAgenda = 1; | 402 | globalFlagBlockAgenda = 1; |
398 | globalFlagBlockLabel = 1; | 403 | globalFlagBlockLabel = 1; |
399 | if ( mCurrentAgendaView != 7 ) | 404 | if ( mCurrentAgendaView != 7 ) |
400 | mCurrentAgendaView = -1; | 405 | mCurrentAgendaView = -1; |
401 | showAgendaView(); | 406 | showAgendaView(); |
402 | qApp->processEvents(); | 407 | qApp->processEvents(); |
403 | globalFlagBlockAgenda = 2; | 408 | globalFlagBlockAgenda = 2; |
404 | globalFlagBlockLabel = 0; | 409 | globalFlagBlockLabel = 0; |
405 | mMainView->dateNavigator()->selectWeek(); | 410 | mMainView->dateNavigator()->selectWeek(); |
406 | mCurrentAgendaView = 7 ; | 411 | mCurrentAgendaView = 7 ; |
407 | } | 412 | } |
408 | 413 | ||
409 | void KOViewManager::showNextXView() | 414 | void KOViewManager::showNextXView() |