summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
authorzautrix <zautrix>2005-04-19 19:32:54 (UTC)
committer zautrix <zautrix>2005-04-19 19:32:54 (UTC)
commitcdcb0e0d0163695c56cf7cf9bd3f046ac63173ee (patch) (unidiff)
tree70cb7e2db9d7075a7c7e7c38adbad0c50e5d8dc4 /korganizer/koviewmanager.cpp
parentb36bdf88fbf3cc78e4bf072b5eb3ec16bd8ec235 (diff)
downloadkdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.zip
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.gz
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.bz2
fixes
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp9
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
@@ -308,24 +308,25 @@ void KOViewManager::showView(KOrg::BaseView *view, bool 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
322void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 323void 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 );
@@ -388,24 +389,25 @@ void KOViewManager::updateWNview()
388void KOViewManager::showWhatsNextView() 389void 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
405void KOViewManager::slotprintWNV() 407void KOViewManager::slotprintWNV()
406{ 408{
407 if (!mWhatsNextView) 409 if (!mWhatsNextView)
408 showWhatsNextView(); 410 showWhatsNextView();
409 emit printWNV(); 411 emit printWNV();
410 412
411} 413}
@@ -434,24 +436,25 @@ void KOViewManager::showListView()
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
451void KOViewManager::showAgendaView( bool fullScreen ) 454void 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;
@@ -501,24 +504,25 @@ void KOViewManager::showAgendaView( bool fullScreen )
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
517void KOViewManager::showDayView() 521void 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;
@@ -559,24 +563,25 @@ void KOViewManager::showWeekView()
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
568void KOViewManager::showNextXView() 572void 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}
582bool KOViewManager::showsNextDays() 587bool KOViewManager::showsNextDays()
@@ -646,24 +651,25 @@ if (!mMonthView) {
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}
655void KOViewManager::showMonthViewWeek() 660void 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();
@@ -674,24 +680,25 @@ void KOViewManager::showMonthViewWeek()
674 680
675void KOViewManager::showMonth( const QDate & date ) 681void 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}
682void KOViewManager::showMonthView() 688void 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;
@@ -745,42 +752,44 @@ void KOViewManager::showTodoView()
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
763void KOViewManager::showJournalView() 771void 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
780void KOViewManager::showTimeSpanView() 789void 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);