-rw-r--r-- | korganizer/koviewmanager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 3aa9b6c..2e5a943 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -288,64 +288,65 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | |||
288 | ++flagResetViewChangeDate; | 288 | ++flagResetViewChangeDate; |
289 | //mFlagShowNextxDays = false; | 289 | //mFlagShowNextxDays = false; |
290 | //if(view == mCurrentView) return; | 290 | //if(view == mCurrentView) return; |
291 | if ( view == 0 ) { | 291 | if ( view == 0 ) { |
292 | view = mCurrentView; | 292 | view = mCurrentView; |
293 | if ( view == 0 ) | 293 | if ( view == 0 ) |
294 | return; | 294 | return; |
295 | } | 295 | } |
296 | bool callupdate = !(view == mCurrentView); | 296 | bool callupdate = !(view == mCurrentView); |
297 | bool full = fullScreen; | 297 | bool full = fullScreen; |
298 | if(view == mCurrentView && view != mWhatsNextView ) { | 298 | if(view == mCurrentView && view != mWhatsNextView ) { |
299 | if ( mCurrentAgendaView < 0 ) | 299 | if ( mCurrentAgendaView < 0 ) |
300 | return; | 300 | return; |
301 | if ( view != mMonthView ) | 301 | if ( view != mMonthView ) |
302 | full = mMainView->leftFrame()->isVisible(); | 302 | full = mMainView->leftFrame()->isVisible(); |
303 | } else { | 303 | } else { |
304 | if ( view == mMonthView && mMonthView) | 304 | if ( view == mMonthView && mMonthView) |
305 | ;//mMonthView->skipResize = true ; | 305 | ;//mMonthView->skipResize = true ; |
306 | mCurrentView = view; | 306 | mCurrentView = view; |
307 | // bool full = fullScreen; | 307 | // bool full = fullScreen; |
308 | bool isFull = !mMainView->leftFrame()->isVisible(); | 308 | bool isFull = !mMainView->leftFrame()->isVisible(); |
309 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 309 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
310 | full = true; | 310 | full = true; |
311 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 311 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
312 | full = false; | 312 | full = false; |
313 | } | 313 | } |
314 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 314 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
315 | //raiseCurrentView( full ); | 315 | //raiseCurrentView( full ); |
316 | mMainView->processIncidenceSelection( 0 ); | 316 | mMainView->processIncidenceSelection( 0 ); |
317 | //mMainView->updateView(); | 317 | //mMainView->updateView(); |
318 | raiseCurrentView( full, callupdate ); | 318 | raiseCurrentView( full, callupdate ); |
319 | mMainView->adaptNavigationUnits(); | 319 | mMainView->adaptNavigationUnits(); |
320 | mMainView->updateUnmanagedViews(); | ||
320 | } | 321 | } |
321 | 322 | ||
322 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 323 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
323 | { | 324 | { |
324 | mCurrentAgendaView = 0; | 325 | mCurrentAgendaView = 0; |
325 | if ( fullScreen ) { | 326 | if ( fullScreen ) { |
326 | mMainView->leftFrame()->hide(); | 327 | mMainView->leftFrame()->hide(); |
327 | } else { | 328 | } else { |
328 | mMainView->leftFrame()->show(); | 329 | mMainView->leftFrame()->show(); |
329 | } | 330 | } |
330 | //if ( mCurrentView == mMonthView ) qApp->processEvents(); | 331 | //if ( mCurrentView == mMonthView ) qApp->processEvents(); |
331 | emit signalFullScreen( !fullScreen ); | 332 | emit signalFullScreen( !fullScreen ); |
332 | if ( callUpdateView ) | 333 | if ( callUpdateView ) |
333 | mMainView->updateView(); | 334 | mMainView->updateView(); |
334 | 335 | ||
335 | if ( globalFlagBlockAgenda == 5 ) { | 336 | if ( globalFlagBlockAgenda == 5 ) { |
336 | globalFlagBlockAgenda = 4; | 337 | globalFlagBlockAgenda = 4; |
337 | globalFlagBlockAgendaItemPaint = 1; | 338 | globalFlagBlockAgendaItemPaint = 1; |
338 | } | 339 | } |
339 | mMainView->viewStack()->raiseWidget(mCurrentView); | 340 | mMainView->viewStack()->raiseWidget(mCurrentView); |
340 | if ( globalFlagBlockAgenda == 4 ) { | 341 | if ( globalFlagBlockAgenda == 4 ) { |
341 | if ( mCurrentView == mAgendaView ) { | 342 | if ( mCurrentView == mAgendaView ) { |
342 | //globalFlagBlockAgenda =1 ; | 343 | //globalFlagBlockAgenda =1 ; |
343 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 344 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
344 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 345 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
345 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 346 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
346 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 347 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
347 | qApp->processEvents(); | 348 | qApp->processEvents(); |
348 | //qDebug("qApp->processEvents() "); | 349 | //qDebug("qApp->processEvents() "); |
349 | globalFlagBlockAgenda = 0; | 350 | globalFlagBlockAgenda = 0; |
350 | mAgendaView->repaintAgenda(); | 351 | mAgendaView->repaintAgenda(); |
351 | 352 | ||
@@ -368,110 +369,112 @@ void KOViewManager::updateView() | |||
368 | } | 369 | } |
369 | 370 | ||
370 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 371 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
371 | { | 372 | { |
372 | // kdDebug() << "KOViewManager::updateView()" << endl; | 373 | // kdDebug() << "KOViewManager::updateView()" << endl; |
373 | 374 | ||
374 | if (mCurrentView) mCurrentView->showDates(start, end); | 375 | if (mCurrentView) mCurrentView->showDates(start, end); |
375 | 376 | ||
376 | if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); | 377 | if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); |
377 | } | 378 | } |
378 | 379 | ||
379 | 380 | ||
380 | void KOViewManager::updateWNview() | 381 | void KOViewManager::updateWNview() |
381 | { | 382 | { |
382 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 383 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
383 | mWhatsNextView->updateView(); | 384 | mWhatsNextView->updateView(); |
384 | if ( mCurrentView == mMonthView && mMonthView ) | 385 | if ( mCurrentView == mMonthView && mMonthView ) |
385 | mMonthView->updateView(); | 386 | mMonthView->updateView(); |
386 | 387 | ||
387 | } | 388 | } |
388 | void KOViewManager::showWhatsNextView() | 389 | void KOViewManager::showWhatsNextView() |
389 | { | 390 | { |
390 | if (!mWhatsNextView) { | 391 | if (!mWhatsNextView) { |
391 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 392 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
392 | "KOViewManager::WhatsNextView"); | 393 | "KOViewManager::WhatsNextView"); |
393 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 394 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
394 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 395 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
395 | addView(mWhatsNextView); | 396 | addView(mWhatsNextView); |
396 | connect(this, SIGNAL( printWNV() ), | 397 | connect(this, SIGNAL( printWNV() ), |
397 | mWhatsNextView, SLOT( printMe() ) ); | 398 | mWhatsNextView, SLOT( printMe() ) ); |
398 | } | 399 | } |
399 | globalFlagBlockAgenda = 1; | 400 | globalFlagBlockAgenda = 1; |
401 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | ||
400 | showView(mWhatsNextView, true ); | 402 | showView(mWhatsNextView, true ); |
401 | //mWhatsNextView->updateView(); | 403 | //mWhatsNextView->updateView(); |
402 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | 404 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; |
403 | } | 405 | } |
404 | 406 | ||
405 | void KOViewManager::slotprintWNV() | 407 | void KOViewManager::slotprintWNV() |
406 | { | 408 | { |
407 | if (!mWhatsNextView) | 409 | if (!mWhatsNextView) |
408 | showWhatsNextView(); | 410 | showWhatsNextView(); |
409 | emit printWNV(); | 411 | emit printWNV(); |
410 | 412 | ||
411 | } | 413 | } |
412 | void KOViewManager::showListView() | 414 | void KOViewManager::showListView() |
413 | { | 415 | { |
414 | if (!mListView) { | 416 | if (!mListView) { |
415 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 417 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
416 | addView(mListView); | 418 | addView(mListView); |
417 | 419 | ||
418 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 420 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
419 | mMainView, SLOT(showIncidence(Incidence *))); | 421 | mMainView, SLOT(showIncidence(Incidence *))); |
420 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 422 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
421 | mMainView, SLOT(editIncidence(Incidence *))); | 423 | mMainView, SLOT(editIncidence(Incidence *))); |
422 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 424 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
423 | mMainView, SLOT(deleteIncidence(Incidence *))); | 425 | mMainView, SLOT(deleteIncidence(Incidence *))); |
424 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 426 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
425 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 427 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
426 | connect( mListView, SIGNAL( signalNewEvent() ), | 428 | connect( mListView, SIGNAL( signalNewEvent() ), |
427 | mMainView, SLOT( newEvent() ) ); | 429 | mMainView, SLOT( newEvent() ) ); |
428 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 430 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
429 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 431 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
430 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 432 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
431 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 433 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
432 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 434 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
433 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 435 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
434 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 436 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
435 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 437 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
436 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 438 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
437 | } | 439 | } |
438 | // bool temp = mFlagShowNextxDays; | 440 | // bool temp = mFlagShowNextxDays; |
439 | //globalFlagBlockPainting = true; | 441 | //globalFlagBlockPainting = true; |
440 | globalFlagBlockAgenda = 1; | 442 | globalFlagBlockAgenda = 1; |
441 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 443 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
442 | mMainView->setBlockShowDates( true ); | 444 | mMainView->setBlockShowDates( true ); |
443 | mMainView->dateNavigator()->selectMonth(); | 445 | mMainView->dateNavigator()->selectMonth(); |
444 | mMainView->setBlockShowDates( false ); | 446 | mMainView->setBlockShowDates( false ); |
445 | } | 447 | } |
448 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | ||
446 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 449 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
447 | //mFlagShowNextxDays = temp; | 450 | //mFlagShowNextxDays = temp; |
448 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | 451 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; |
449 | } | 452 | } |
450 | 453 | ||
451 | void KOViewManager::showAgendaView( bool fullScreen ) | 454 | void KOViewManager::showAgendaView( bool fullScreen ) |
452 | { | 455 | { |
453 | 456 | ||
454 | mMainView->dialogManager()->hideSearchDialog(); | 457 | mMainView->dialogManager()->hideSearchDialog(); |
455 | // qDebug("KOViewManager::showAgendaView "); | 458 | // qDebug("KOViewManager::showAgendaView "); |
456 | bool full; | 459 | bool full; |
457 | full = fullScreen; | 460 | full = fullScreen; |
458 | if (!mAgendaView) { | 461 | if (!mAgendaView) { |
459 | full = false; | 462 | full = false; |
460 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 463 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
461 | addView(mAgendaView); | 464 | addView(mAgendaView); |
462 | #ifndef DESKTOP_VERSION | 465 | #ifndef DESKTOP_VERSION |
463 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 466 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
464 | #endif | 467 | #endif |
465 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 468 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
466 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 469 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
467 | 470 | ||
468 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 471 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
469 | 472 | ||
470 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); | 473 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); |
471 | 474 | ||
472 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), | 475 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), |
473 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); | 476 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); |
474 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 477 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
475 | mMainView, SLOT(newEvent(QDateTime))); | 478 | mMainView, SLOT(newEvent(QDateTime))); |
476 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 479 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
477 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 480 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
@@ -481,122 +484,124 @@ void KOViewManager::showAgendaView( bool fullScreen ) | |||
481 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 484 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
482 | mMainView, SLOT(editIncidence(Incidence *))); | 485 | mMainView, SLOT(editIncidence(Incidence *))); |
483 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 486 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
484 | mMainView, SLOT(showIncidence(Incidence *))); | 487 | mMainView, SLOT(showIncidence(Incidence *))); |
485 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 488 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
486 | mMainView, SLOT(deleteIncidence(Incidence *))); | 489 | mMainView, SLOT(deleteIncidence(Incidence *))); |
487 | 490 | ||
488 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 491 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
489 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 492 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
490 | 493 | ||
491 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 494 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
492 | mMainView, SLOT( toggleExpand() ) ); | 495 | mMainView, SLOT( toggleExpand() ) ); |
493 | 496 | ||
494 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 497 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
495 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 498 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
496 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 499 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
497 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 500 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
498 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 501 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
499 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 502 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
500 | SLOT( updateTodo( Todo *, int ) ) ); | 503 | SLOT( updateTodo( Todo *, int ) ) ); |
501 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 504 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
502 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 505 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
503 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 506 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
504 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 507 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
505 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 508 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
506 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 509 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
507 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), | 510 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), |
508 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); | 511 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
509 | mAgendaView->readSettings(); | 512 | mAgendaView->readSettings(); |
510 | mAgendaView->updateConfig(); | 513 | mAgendaView->updateConfig(); |
511 | } | 514 | } |
512 | 515 | ||
516 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; | ||
513 | showView( mAgendaView, full); | 517 | showView( mAgendaView, full); |
514 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; | 518 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; |
515 | } | 519 | } |
516 | 520 | ||
517 | void KOViewManager::showDayView() | 521 | void KOViewManager::showDayView() |
518 | { | 522 | { |
519 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); | 523 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); |
520 | mFlagShowNextxDays = false; | 524 | mFlagShowNextxDays = false; |
521 | globalFlagBlockLabel = 1; | 525 | globalFlagBlockLabel = 1; |
522 | globalFlagBlockAgenda = 1; | 526 | globalFlagBlockAgenda = 1; |
523 | if ( mCurrentAgendaView != 1 ) | 527 | if ( mCurrentAgendaView != 1 ) |
524 | mCurrentAgendaView = -1; | 528 | mCurrentAgendaView = -1; |
525 | showAgendaView(); | 529 | showAgendaView(); |
526 | qApp->processEvents(); | 530 | qApp->processEvents(); |
527 | globalFlagBlockAgenda = 2; | 531 | globalFlagBlockAgenda = 2; |
528 | globalFlagBlockLabel = 0; | 532 | globalFlagBlockLabel = 0; |
529 | mMainView->dateNavigator()->selectDates( 1 ); | 533 | mMainView->dateNavigator()->selectDates( 1 ); |
530 | mCurrentAgendaView = 1 ; | 534 | mCurrentAgendaView = 1 ; |
531 | 535 | ||
532 | } | 536 | } |
533 | 537 | ||
534 | void KOViewManager::showWorkWeekView() | 538 | void KOViewManager::showWorkWeekView() |
535 | { | 539 | { |
536 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); | 540 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); |
537 | mFlagShowNextxDays = false; | 541 | mFlagShowNextxDays = false; |
538 | globalFlagBlockAgenda = 1; | 542 | globalFlagBlockAgenda = 1; |
539 | globalFlagBlockLabel = 1; | 543 | globalFlagBlockLabel = 1; |
540 | if ( mCurrentAgendaView != 5 ) | 544 | if ( mCurrentAgendaView != 5 ) |
541 | mCurrentAgendaView = -1; | 545 | mCurrentAgendaView = -1; |
542 | showAgendaView(); | 546 | showAgendaView(); |
543 | qApp->processEvents(); | 547 | qApp->processEvents(); |
544 | globalFlagBlockAgenda = 2; | 548 | globalFlagBlockAgenda = 2; |
545 | globalFlagBlockLabel = 0; | 549 | globalFlagBlockLabel = 0; |
546 | mMainView->dateNavigator()->selectWorkWeek(); | 550 | mMainView->dateNavigator()->selectWorkWeek(); |
547 | mCurrentAgendaView = 5 ; | 551 | mCurrentAgendaView = 5 ; |
548 | 552 | ||
549 | } | 553 | } |
550 | 554 | ||
551 | void KOViewManager::showWeekView() | 555 | void KOViewManager::showWeekView() |
552 | { | 556 | { |
553 | 557 | ||
554 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); | 558 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); |
555 | mFlagShowNextxDays = false; | 559 | mFlagShowNextxDays = false; |
556 | globalFlagBlockAgenda = 1; | 560 | globalFlagBlockAgenda = 1; |
557 | globalFlagBlockLabel = 1; | 561 | globalFlagBlockLabel = 1; |
558 | if ( mCurrentAgendaView != 7 ) | 562 | if ( mCurrentAgendaView != 7 ) |
559 | mCurrentAgendaView = -1; | 563 | mCurrentAgendaView = -1; |
560 | showAgendaView(); | 564 | showAgendaView(); |
561 | qApp->processEvents(); | 565 | qApp->processEvents(); |
562 | globalFlagBlockAgenda = 2; | 566 | globalFlagBlockAgenda = 2; |
563 | globalFlagBlockLabel = 0; | 567 | globalFlagBlockLabel = 0; |
564 | mMainView->dateNavigator()->selectWeek(); | 568 | mMainView->dateNavigator()->selectWeek(); |
565 | mCurrentAgendaView = 7 ; | 569 | mCurrentAgendaView = 7 ; |
566 | } | 570 | } |
567 | 571 | ||
568 | void KOViewManager::showNextXView() | 572 | void KOViewManager::showNextXView() |
569 | { | 573 | { |
570 | 574 | ||
575 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; | ||
571 | globalFlagBlockAgenda = 1; | 576 | globalFlagBlockAgenda = 1; |
572 | if ( mCurrentAgendaView != 3 ) | 577 | if ( mCurrentAgendaView != 3 ) |
573 | mCurrentAgendaView = -1; | 578 | mCurrentAgendaView = -1; |
574 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 579 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
575 | globalFlagBlockAgenda = 2; | 580 | globalFlagBlockAgenda = 2; |
576 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 581 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
577 | KOPrefs::instance()->mNextXDays ); | 582 | KOPrefs::instance()->mNextXDays ); |
578 | mFlagShowNextxDays = true; | 583 | mFlagShowNextxDays = true; |
579 | mCurrentAgendaView = 3 ; | 584 | mCurrentAgendaView = 3 ; |
580 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; | 585 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; |
581 | } | 586 | } |
582 | bool KOViewManager::showsNextDays() | 587 | bool KOViewManager::showsNextDays() |
583 | { | 588 | { |
584 | return mFlagShowNextxDays; | 589 | return mFlagShowNextxDays; |
585 | } | 590 | } |
586 | void KOViewManager::createMonthView() | 591 | void KOViewManager::createMonthView() |
587 | { | 592 | { |
588 | if (!mMonthView) { | 593 | if (!mMonthView) { |
589 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 594 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
590 | 595 | ||
591 | addView(mMonthView); | 596 | addView(mMonthView); |
592 | // mMonthView->show(); | 597 | // mMonthView->show(); |
593 | // SIGNALS/SLOTS FOR MONTH VIEW | 598 | // SIGNALS/SLOTS FOR MONTH VIEW |
594 | 599 | ||
595 | connect(mMonthView,SIGNAL(showJournalSignal( int, QDate )),SLOT(showDateView( int, QDate ))); | 600 | connect(mMonthView,SIGNAL(showJournalSignal( int, QDate )),SLOT(showDateView( int, QDate ))); |
596 | 601 | ||
597 | connect(mMonthView, SIGNAL(newTodoSignal(QDateTime,bool)), | 602 | connect(mMonthView, SIGNAL(newTodoSignal(QDateTime,bool)), |
598 | mMainView, SLOT(newTodoDateTime(QDateTime, bool))); | 603 | mMainView, SLOT(newTodoDateTime(QDateTime, bool))); |
599 | 604 | ||
600 | 605 | ||
601 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), | 606 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), |
602 | mMainView, SLOT(newEvent(QDateTime))); | 607 | mMainView, SLOT(newEvent(QDateTime))); |
@@ -626,92 +631,94 @@ if (!mMonthView) { | |||
626 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 631 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
627 | mMainView, SLOT ( showDay( QDate ) ) ); | 632 | mMainView, SLOT ( showDay( QDate ) ) ); |
628 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 633 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
629 | connect( mMonthView, SIGNAL(nextMonth() ), | 634 | connect( mMonthView, SIGNAL(nextMonth() ), |
630 | mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); | 635 | mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); |
631 | connect( mMonthView, SIGNAL(prevMonth() ), | 636 | connect( mMonthView, SIGNAL(prevMonth() ), |
632 | mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | 637 | mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); |
633 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), | 638 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), |
634 | mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); | 639 | mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); |
635 | connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), | 640 | connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), |
636 | mMainView->dateNavigator(), SLOT( selectNextYear() ) ); | 641 | mMainView->dateNavigator(), SLOT( selectNextYear() ) ); |
637 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), | 642 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), |
638 | mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); | 643 | mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); |
639 | connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), | 644 | connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), |
640 | mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); | 645 | mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); |
641 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), | 646 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), |
642 | mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); | 647 | mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); |
643 | connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), | 648 | connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), |
644 | mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); | 649 | mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); |
645 | 650 | ||
646 | connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 651 | connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
647 | mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); | 652 | mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); |
648 | 653 | ||
649 | 654 | ||
650 | connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), | 655 | connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), |
651 | mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); | 656 | mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); |
652 | 657 | ||
653 | } | 658 | } |
654 | } | 659 | } |
655 | void KOViewManager::showMonthViewWeek() | 660 | void KOViewManager::showMonthViewWeek() |
656 | { | 661 | { |
657 | createMonthView(); | 662 | createMonthView(); |
663 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; | ||
658 | globalFlagBlockAgenda = 1; | 664 | globalFlagBlockAgenda = 1; |
659 | bool full = true; | 665 | bool full = true; |
660 | if ( mCurrentView == mMonthView) | 666 | if ( mCurrentView == mMonthView) |
661 | full = mMainView->leftFrame()->isVisible(); | 667 | full = mMainView->leftFrame()->isVisible(); |
662 | if ( !KOPrefs::instance()->mMonthViewWeek ) { | 668 | if ( !KOPrefs::instance()->mMonthViewWeek ) { |
663 | mMonthView->switchView(); | 669 | mMonthView->switchView(); |
664 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) | 670 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) |
665 | full = false; | 671 | full = false; |
666 | else | 672 | else |
667 | full = true; | 673 | full = true; |
668 | } | 674 | } |
669 | mMainView->dateNavigator()->selectWeek(); | 675 | mMainView->dateNavigator()->selectWeek(); |
670 | showView(mMonthView, full ); | 676 | showView(mMonthView, full ); |
671 | mMonthView->setKeyBFocus(); | 677 | mMonthView->setKeyBFocus(); |
672 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; | 678 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; |
673 | } | 679 | } |
674 | 680 | ||
675 | void KOViewManager::showMonth( const QDate & date ) | 681 | void KOViewManager::showMonth( const QDate & date ) |
676 | { | 682 | { |
677 | mMainView->dateNavigator()->blockSignals( true ); | 683 | mMainView->dateNavigator()->blockSignals( true ); |
678 | mMainView->dateNavigator()->selectDate( date ); | 684 | mMainView->dateNavigator()->selectDate( date ); |
679 | mMainView->dateNavigator()->blockSignals( false ); | 685 | mMainView->dateNavigator()->blockSignals( false ); |
680 | showMonthView(); | 686 | showMonthView(); |
681 | } | 687 | } |
682 | void KOViewManager::showMonthView() | 688 | void KOViewManager::showMonthView() |
683 | { | 689 | { |
684 | 690 | ||
685 | createMonthView(); | 691 | createMonthView(); |
692 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; | ||
686 | globalFlagBlockAgenda = 1; | 693 | globalFlagBlockAgenda = 1; |
687 | //mFlagShowNextxDays = false; | 694 | //mFlagShowNextxDays = false; |
688 | bool full = true; | 695 | bool full = true; |
689 | if ( mCurrentView == mMonthView) | 696 | if ( mCurrentView == mMonthView) |
690 | full = mMainView->leftFrame()->isVisible(); | 697 | full = mMainView->leftFrame()->isVisible(); |
691 | // if(mMonthView == mCurrentView) return; | 698 | // if(mMonthView == mCurrentView) return; |
692 | if ( KOPrefs::instance()->mMonthViewWeek ) { | 699 | if ( KOPrefs::instance()->mMonthViewWeek ) { |
693 | mMonthView->switchView(); | 700 | mMonthView->switchView(); |
694 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) | 701 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) |
695 | full = false; | 702 | full = false; |
696 | else | 703 | else |
697 | full = true; | 704 | full = true; |
698 | } | 705 | } |
699 | mMainView->dateNavigator()->selectMonth(); | 706 | mMainView->dateNavigator()->selectMonth(); |
700 | 707 | ||
701 | showView(mMonthView, full ); | 708 | showView(mMonthView, full ); |
702 | mMonthView->setKeyBFocus(); | 709 | mMonthView->setKeyBFocus(); |
703 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; | 710 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; |
704 | 711 | ||
705 | } | 712 | } |
706 | 713 | ||
707 | void KOViewManager::showTodoView() | 714 | void KOViewManager::showTodoView() |
708 | { | 715 | { |
709 | //mFlagShowNextxDays = false; | 716 | //mFlagShowNextxDays = false; |
710 | if ( !mTodoView ) { | 717 | if ( !mTodoView ) { |
711 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 718 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
712 | "KOViewManager::TodoView" ); | 719 | "KOViewManager::TodoView" ); |
713 | 720 | ||
714 | addView( mTodoView ); | 721 | addView( mTodoView ); |
715 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 722 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
716 | 723 | ||
717 | // SIGNALS/SLOTS FOR TODO VIEW | 724 | // SIGNALS/SLOTS FOR TODO VIEW |
@@ -725,82 +732,84 @@ void KOViewManager::showTodoView() | |||
725 | mMainView, SLOT( editTodo( Todo * ) ) ); | 732 | mMainView, SLOT( editTodo( Todo * ) ) ); |
726 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), | 733 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), |
727 | mMainView, SLOT( deleteTodo( Todo * ) ) ); | 734 | mMainView, SLOT( deleteTodo( Todo * ) ) ); |
728 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), | 735 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), |
729 | mMainView, SLOT( purgeCompleted() ) ); | 736 | mMainView, SLOT( purgeCompleted() ) ); |
730 | 737 | ||
731 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), | 738 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), |
732 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 739 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
733 | 740 | ||
734 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, | 741 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, |
735 | SLOT( updateConfig() ) ); | 742 | SLOT( updateConfig() ) ); |
736 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, | 743 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, |
737 | SLOT( updateTodo( Todo *, int ) ) ); | 744 | SLOT( updateTodo( Todo *, int ) ) ); |
738 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 745 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
739 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); | 746 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); |
740 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), | 747 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), |
741 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 748 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
742 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), | 749 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), |
743 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 750 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
744 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), | 751 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), |
745 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); | 752 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); |
746 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 753 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
747 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); | 754 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); |
748 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), | 755 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), |
749 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 756 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
750 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), | 757 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), |
751 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 758 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
752 | KConfig *config = KOGlobals::config(); | 759 | KConfig *config = KOGlobals::config(); |
753 | mTodoView->restoreLayout(config,"Todo View"); | 760 | mTodoView->restoreLayout(config,"Todo View"); |
754 | mTodoView->setNavigator( mMainView->dateNavigator() ); | 761 | mTodoView->setNavigator( mMainView->dateNavigator() ); |
755 | } | 762 | } |
756 | 763 | ||
764 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; | ||
757 | globalFlagBlockAgenda = 1; | 765 | globalFlagBlockAgenda = 1; |
758 | showView( mTodoView, true ); | 766 | showView( mTodoView, true ); |
759 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; | 767 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; |
760 | 768 | ||
761 | } | 769 | } |
762 | 770 | ||
763 | void KOViewManager::showJournalView() | 771 | void KOViewManager::showJournalView() |
764 | { | 772 | { |
765 | //mFlagShowNextxDays = false; | 773 | //mFlagShowNextxDays = false; |
766 | if (!mJournalView) { | 774 | if (!mJournalView) { |
767 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), | 775 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), |
768 | "KOViewManager::JournalView"); | 776 | "KOViewManager::JournalView"); |
769 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 777 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
770 | SLOT( updateConfig() ) ); | 778 | SLOT( updateConfig() ) ); |
771 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 779 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
772 | addView(mJournalView); | 780 | addView(mJournalView); |
773 | } | 781 | } |
774 | 782 | ||
783 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; | ||
775 | showView(mJournalView); | 784 | showView(mJournalView); |
776 | mMainView->dateNavigator()->selectDates( 1 ); | 785 | mMainView->dateNavigator()->selectDates( 1 ); |
777 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; | 786 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; |
778 | } | 787 | } |
779 | 788 | ||
780 | void KOViewManager::showTimeSpanView() | 789 | void KOViewManager::showTimeSpanView() |
781 | { | 790 | { |
782 | //mFlagShowNextxDays = false; | 791 | //mFlagShowNextxDays = false; |
783 | if (!mTimeSpanView) { | 792 | if (!mTimeSpanView) { |
784 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 793 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
785 | "KOViewManager::TimeSpanView"); | 794 | "KOViewManager::TimeSpanView"); |
786 | addView(mTimeSpanView); | 795 | addView(mTimeSpanView); |
787 | 796 | ||
788 | mTimeSpanView->readSettings(); | 797 | mTimeSpanView->readSettings(); |
789 | } | 798 | } |
790 | 799 | ||
791 | showView(mTimeSpanView); | 800 | showView(mTimeSpanView); |
792 | } | 801 | } |
793 | 802 | ||
794 | Incidence *KOViewManager::currentSelection() | 803 | Incidence *KOViewManager::currentSelection() |
795 | { | 804 | { |
796 | if (!mCurrentView) return 0; | 805 | if (!mCurrentView) return 0; |
797 | if ( mCurrentView == mListView ) { | 806 | if ( mCurrentView == mListView ) { |
798 | if ( mListView->currentItem() ) | 807 | if ( mListView->currentItem() ) |
799 | return mListView->currentItem(); | 808 | return mListView->currentItem(); |
800 | } | 809 | } |
801 | return mCurrentView->selectedIncidences().first(); | 810 | return mCurrentView->selectedIncidences().first(); |
802 | } | 811 | } |
803 | 812 | ||
804 | QDate KOViewManager::currentSelectionDate() | 813 | QDate KOViewManager::currentSelectionDate() |
805 | { | 814 | { |
806 | QDate qd; | 815 | QDate qd; |