summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Unidiff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp62
1 files changed, 51 insertions, 11 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index f8f6c1d..e22f096 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -89,5 +89,10 @@ void KOViewManager::readSettings(KConfig *config)
89 QString view = config->readEntry("Current View"); 89 QString view = config->readEntry("Current View");
90 if (view == "WhatsNext") showWhatsNextView(); 90 if (view == "WhatsNext") showWhatsNextView();
91 else if (view == "Month") showMonthView(); 91 else if (view == "Month") {
92 if ( KOPrefs::instance()->mMonthViewWeek )
93 showMonthView();
94 else
95 showMonthViewWeek();
96 }
92 else if (view == "List") showListView(); 97 else if (view == "List") showListView();
93 else if (view == "Journal") showJournalView(); 98 else if (view == "Journal") showJournalView();
@@ -208,5 +213,6 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
208 if ( mCurrentAgendaView < 0 ) 213 if ( mCurrentAgendaView < 0 )
209 return; 214 return;
210 full = mMainView->leftFrame()->isVisible(); 215 if ( view != mMonthView )
216 full = mMainView->leftFrame()->isVisible();
211 } else { 217 } else {
212 if ( view == mMonthView && mMonthView) 218 if ( view == mMonthView && mMonthView)
@@ -487,7 +493,7 @@ bool KOViewManager::showsNextDays()
487 return mFlagShowNextxDays; 493 return mFlagShowNextxDays;
488} 494}
489void KOViewManager::showMonthView() 495void KOViewManager::createMonthView()
490 { 496{
491 if (!mMonthView) { 497if (!mMonthView) {
492 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 498 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
493 499
@@ -518,4 +524,6 @@ void KOViewManager::showMonthView()
518 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 524 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
519 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); 525 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) );
526 connect( mMonthView, SIGNAL( selectMonth() ),
527 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
520 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 528 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
521 mMainView, SLOT ( showDay( QDate ) ) ); 529 mMainView, SLOT ( showDay( QDate ) ) );
@@ -533,4 +541,8 @@ void KOViewManager::showMonthView()
533 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), 541 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
534 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 542 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
543 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
544 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
545 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
546 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
535 547
536 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 548 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
@@ -542,14 +554,42 @@ void KOViewManager::showMonthView()
542 554
543 } 555 }
556}
557void KOViewManager::showMonthViewWeek()
558{
559 createMonthView();
560 bool full = true;
561 if ( mCurrentView == mMonthView)
562 full = mMainView->leftFrame()->isVisible();
563 if ( !KOPrefs::instance()->mMonthViewWeek ) {
564 mMonthView->switchView();
565 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
566 full = false;
567 else
568 full = true;
569 }
570 mMainView->dateNavigator()->selectWeek();
571 showView(mMonthView, full );
572}
544 573
574void KOViewManager::showMonthView()
575 {
576
577 createMonthView();
545 globalFlagBlockAgenda = 1; 578 globalFlagBlockAgenda = 1;
546 //mFlagShowNextxDays = false; 579 //mFlagShowNextxDays = false;
547 // if(mMonthView == mCurrentView) return; 580 bool full = true;
548 if ( KOPrefs::instance()->mMonthViewWeek ) 581 if ( mCurrentView == mMonthView)
549 mMainView->dateNavigator()->selectWeek(); 582 full = mMainView->leftFrame()->isVisible();
550 else 583 // if(mMonthView == mCurrentView) return;
551 mMainView->dateNavigator()->selectMonth(); 584 if ( KOPrefs::instance()->mMonthViewWeek ) {
585 mMonthView->switchView();
586 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
587 full = false;
588 else
589 full = true;
590 }
591 mMainView->dateNavigator()->selectMonth();
552 592
553 showView(mMonthView, true ); 593 showView(mMonthView, full );
554 594
555} 595}