summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Unidiff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 7b307f7..bd191d8 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -459,24 +459,25 @@ void KOViewManager::showListView()
459 // bool temp = mFlagShowNextxDays; 459 // bool temp = mFlagShowNextxDays;
460 //globalFlagBlockPainting = true; 460 //globalFlagBlockPainting = true;
461 globalFlagBlockAgenda = 1; 461 globalFlagBlockAgenda = 1;
462 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 462 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
463 mMainView->setBlockShowDates( true ); 463 mMainView->setBlockShowDates( true );
464 mMainView->dateNavigator()->selectMonth(); 464 mMainView->dateNavigator()->selectMonth();
465 mMainView->setBlockShowDates( false ); 465 mMainView->setBlockShowDates( false );
466 } 466 }
467 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; 467 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
468 showView(mListView, KOPrefs::instance()->mFullViewTodo); 468 showView(mListView, KOPrefs::instance()->mFullViewTodo);
469 //mFlagShowNextxDays = temp; 469 //mFlagShowNextxDays = temp;
470 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; 470 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
471 mMainView->setScrollBarStep( 7 );
471} 472}
472 473
473void KOViewManager::showAgendaView( bool fullScreen ) 474void KOViewManager::showAgendaView( bool fullScreen )
474{ 475{
475 476
476 mMainView->dialogManager()->hideSearchDialog(); 477 mMainView->dialogManager()->hideSearchDialog();
477 // qDebug("KOViewManager::showAgendaView "); 478 // qDebug("KOViewManager::showAgendaView ");
478 bool full; 479 bool full;
479 full = fullScreen; 480 full = fullScreen;
480 if (!mAgendaView) { 481 if (!mAgendaView) {
481 full = false; 482 full = false;
482 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 483 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
@@ -526,91 +527,96 @@ void KOViewManager::showAgendaView( bool fullScreen )
526 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 527 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
527 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 528 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
528 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 529 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
529 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), 530 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
530 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); 531 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
531 mAgendaView->readSettings(); 532 mAgendaView->readSettings();
532 mAgendaView->updateConfig(); 533 mAgendaView->updateConfig();
533 } 534 }
534 535
535 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; 536 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
536 showView( mAgendaView, full); 537 showView( mAgendaView, full);
537 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; 538 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
539 mMainView->setScrollBarStep( 1 );
538} 540}
539 541
540void KOViewManager::showDayView() 542void KOViewManager::showDayView()
541{ 543{
542 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 544 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
543 mFlagShowNextxDays = false; 545 mFlagShowNextxDays = false;
544 globalFlagBlockLabel = 1; 546 globalFlagBlockLabel = 1;
545 globalFlagBlockAgenda = 1; 547 globalFlagBlockAgenda = 1;
546 if ( mCurrentAgendaView != 1 ) 548 if ( mCurrentAgendaView != 1 )
547 mCurrentAgendaView = -1; 549 mCurrentAgendaView = -1;
548 showAgendaView(); 550 showAgendaView();
549 qApp->processEvents(); 551 qApp->processEvents();
550 globalFlagBlockAgenda = 2; 552 globalFlagBlockAgenda = 2;
551 globalFlagBlockLabel = 0; 553 globalFlagBlockLabel = 0;
552 mMainView->dateNavigator()->selectDates( 1 ); 554 mMainView->dateNavigator()->selectDates( 1 );
553 mCurrentAgendaView = 1 ; 555 mCurrentAgendaView = 1 ;
556 mMainView->setScrollBarStep( 1 );
554 557
555} 558}
556 559
557void KOViewManager::showWorkWeekView() 560void KOViewManager::showWorkWeekView()
558{ 561{
559 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 562 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
560 mFlagShowNextxDays = false; 563 mFlagShowNextxDays = false;
561 globalFlagBlockAgenda = 1; 564 globalFlagBlockAgenda = 1;
562 globalFlagBlockLabel = 1; 565 globalFlagBlockLabel = 1;
563 if ( mCurrentAgendaView != 5 ) 566 if ( mCurrentAgendaView != 5 )
564 mCurrentAgendaView = -1; 567 mCurrentAgendaView = -1;
565 showAgendaView(); 568 showAgendaView();
566 qApp->processEvents(); 569 qApp->processEvents();
567 globalFlagBlockAgenda = 2; 570 globalFlagBlockAgenda = 2;
568 globalFlagBlockLabel = 0; 571 globalFlagBlockLabel = 0;
569 mMainView->dateNavigator()->selectWorkWeek(); 572 mMainView->dateNavigator()->selectWorkWeek();
570 mCurrentAgendaView = 5 ; 573 mCurrentAgendaView = 5 ;
574 mMainView->setScrollBarStep( 1 );
571 575
572} 576}
573 577
574void KOViewManager::showWeekView() 578void KOViewManager::showWeekView()
575{ 579{
576 580
577 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 581 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
578 mFlagShowNextxDays = false; 582 mFlagShowNextxDays = false;
579 globalFlagBlockAgenda = 1; 583 globalFlagBlockAgenda = 1;
580 globalFlagBlockLabel = 1; 584 globalFlagBlockLabel = 1;
581 if ( mCurrentAgendaView != 7 ) 585 if ( mCurrentAgendaView != 7 )
582 mCurrentAgendaView = -1; 586 mCurrentAgendaView = -1;
583 showAgendaView(); 587 showAgendaView();
584 qApp->processEvents(); 588 qApp->processEvents();
585 globalFlagBlockAgenda = 2; 589 globalFlagBlockAgenda = 2;
586 globalFlagBlockLabel = 0; 590 globalFlagBlockLabel = 0;
587 mMainView->dateNavigator()->selectWeek(); 591 mMainView->dateNavigator()->selectWeek();
588 mCurrentAgendaView = 7 ; 592 mCurrentAgendaView = 7 ;
593 mMainView->setScrollBarStep( 1 );
589} 594}
590 595
591void KOViewManager::showNextXView() 596void KOViewManager::showNextXView()
592{ 597{
593 598
594 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; 599 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
595 globalFlagBlockAgenda = 1; 600 globalFlagBlockAgenda = 1;
596 if ( mCurrentAgendaView != 3 ) 601 if ( mCurrentAgendaView != 3 )
597 mCurrentAgendaView = -1; 602 mCurrentAgendaView = -1;
598 showAgendaView(KOPrefs::instance()->mFullViewMonth); 603 showAgendaView(KOPrefs::instance()->mFullViewMonth);
599 globalFlagBlockAgenda = 2; 604 globalFlagBlockAgenda = 2;
600 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 605 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
601 KOPrefs::instance()->mNextXDays ); 606 KOPrefs::instance()->mNextXDays );
602 mFlagShowNextxDays = true; 607 mFlagShowNextxDays = true;
603 mCurrentAgendaView = 3 ; 608 mCurrentAgendaView = 3 ;
604 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; 609 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
610 mMainView->setScrollBarStep( KOPrefs::instance()->mNextXDays );
605} 611}
606bool KOViewManager::showsNextDays() 612bool KOViewManager::showsNextDays()
607{ 613{
608 return mFlagShowNextxDays; 614 return mFlagShowNextxDays;
609} 615}
610void KOViewManager::createMonthView() 616void KOViewManager::createMonthView()
611{ 617{
612if (!mMonthView) { 618if (!mMonthView) {
613 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 619 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
614 620
615 addView(mMonthView); 621 addView(mMonthView);
616 // mMonthView->show(); 622 // mMonthView->show();
@@ -686,24 +692,25 @@ void KOViewManager::showMonthViewWeek()
686 full = mMainView->leftFrame()->isVisible(); 692 full = mMainView->leftFrame()->isVisible();
687 if ( !KOPrefs::instance()->mMonthViewWeek ) { 693 if ( !KOPrefs::instance()->mMonthViewWeek ) {
688 mMonthView->switchView(); 694 mMonthView->switchView();
689 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 695 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
690 full = false; 696 full = false;
691 else 697 else
692 full = true; 698 full = true;
693 } 699 }
694 mMainView->dateNavigator()->selectWeek(); 700 mMainView->dateNavigator()->selectWeek();
695 showView(mMonthView, full ); 701 showView(mMonthView, full );
696 mMonthView->setKeyBFocus(); 702 mMonthView->setKeyBFocus();
697 KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; 703 KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ;
704 mMainView->setScrollBarStep( 7 );
698} 705}
699 706
700void KOViewManager::showMonth( const QDate & date ) 707void KOViewManager::showMonth( const QDate & date )
701{ 708{
702 mMainView->dateNavigator()->blockSignals( true ); 709 mMainView->dateNavigator()->blockSignals( true );
703 mMainView->dateNavigator()->selectDate( date ); 710 mMainView->dateNavigator()->selectDate( date );
704 mMainView->dateNavigator()->blockSignals( false ); 711 mMainView->dateNavigator()->blockSignals( false );
705 showMonthView(); 712 showMonthView();
706} 713}
707void KOViewManager::showMonthView() 714void KOViewManager::showMonthView()
708 { 715 {
709 716
@@ -718,24 +725,25 @@ void KOViewManager::showMonthView()
718 if ( KOPrefs::instance()->mMonthViewWeek ) { 725 if ( KOPrefs::instance()->mMonthViewWeek ) {
719 mMonthView->switchView(); 726 mMonthView->switchView();
720 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 727 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
721 full = false; 728 full = false;
722 else 729 else
723 full = true; 730 full = true;
724 } 731 }
725 mMainView->dateNavigator()->selectMonth(); 732 mMainView->dateNavigator()->selectMonth();
726 733
727 showView(mMonthView, full ); 734 showView(mMonthView, full );
728 mMonthView->setKeyBFocus(); 735 mMonthView->setKeyBFocus();
729 KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; 736 KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ;
737 mMainView->setScrollBarStep( 7 );
730 738
731} 739}
732 740
733void KOViewManager::showTodoView() 741void KOViewManager::showTodoView()
734{ 742{
735 //mFlagShowNextxDays = false; 743 //mFlagShowNextxDays = false;
736 if ( !mTodoView ) { 744 if ( !mTodoView ) {
737 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 745 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
738 "KOViewManager::TodoView" ); 746 "KOViewManager::TodoView" );
739 747
740 addView( mTodoView ); 748 addView( mTodoView );
741 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 749 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
@@ -775,43 +783,45 @@ void KOViewManager::showTodoView()
775 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 783 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
776 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 784 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
777 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 785 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
778 KConfig *config = KOGlobals::config(); 786 KConfig *config = KOGlobals::config();
779 mTodoView->restoreLayout(config,"Todo View"); 787 mTodoView->restoreLayout(config,"Todo View");
780 mTodoView->setNavigator( mMainView->dateNavigator() ); 788 mTodoView->setNavigator( mMainView->dateNavigator() );
781 } 789 }
782 790
783 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; 791 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
784 globalFlagBlockAgenda = 1; 792 globalFlagBlockAgenda = 1;
785 showView( mTodoView, true ); 793 showView( mTodoView, true );
786 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; 794 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
795 mMainView->setScrollBarStep( 7 );
787 796
788} 797}
789 798
790void KOViewManager::showJournalView() 799void KOViewManager::showJournalView()
791{ 800{
792 //mFlagShowNextxDays = false; 801 //mFlagShowNextxDays = false;
793 if (!mJournalView) { 802 if (!mJournalView) {
794 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), 803 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
795 "KOViewManager::JournalView"); 804 "KOViewManager::JournalView");
796 connect( mMainView, SIGNAL( configChanged() ), mJournalView, 805 connect( mMainView, SIGNAL( configChanged() ), mJournalView,
797 SLOT( updateConfig() ) ); 806 SLOT( updateConfig() ) );
798 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); 807 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
799 addView(mJournalView); 808 addView(mJournalView);
800 } 809 }
801 810
802 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; 811 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
803 showView(mJournalView); 812 showView(mJournalView);
804 mMainView->dateNavigator()->selectDates( 1 ); 813 mMainView->dateNavigator()->selectDates( 1 );
805 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; 814 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
815 mMainView->setScrollBarStep( 1 );
806} 816}
807 817
808void KOViewManager::showTimeSpanView() 818void KOViewManager::showTimeSpanView()
809{ 819{
810 //mFlagShowNextxDays = false; 820 //mFlagShowNextxDays = false;
811 if (!mTimeSpanView) { 821 if (!mTimeSpanView) {
812 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), 822 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
813 "KOViewManager::TimeSpanView"); 823 "KOViewManager::TimeSpanView");
814 addView(mTimeSpanView); 824 addView(mTimeSpanView);
815 825
816 mTimeSpanView->readSettings(); 826 mTimeSpanView->readSettings();
817 } 827 }