Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 62 |
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 @@ -88,7 +88,12 @@ void KOViewManager::readSettings(KConfig *config) config->setGroup("General"); QString view = config->readEntry("Current View"); if (view == "WhatsNext") showWhatsNextView(); - else if (view == "Month") showMonthView(); + else if (view == "Month") { + if ( KOPrefs::instance()->mMonthViewWeek ) + showMonthView(); + else + showMonthViewWeek(); + } else if (view == "List") showListView(); else if (view == "Journal") showJournalView(); else if (view == "TimeSpan") showTimeSpanView(); @@ -207,7 +212,8 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) if(view == mCurrentView && view != mWhatsNextView ) { if ( mCurrentAgendaView < 0 ) return; - full = mMainView->leftFrame()->isVisible(); + if ( view != mMonthView ) + full = mMainView->leftFrame()->isVisible(); } else { if ( view == mMonthView && mMonthView) ;//mMonthView->skipResize = true ; @@ -486,9 +492,9 @@ bool KOViewManager::showsNextDays() { return mFlagShowNextxDays; } -void KOViewManager::showMonthView() - { - if (!mMonthView) { +void KOViewManager::createMonthView() +{ +if (!mMonthView) { mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); addView(mMonthView); @@ -517,6 +523,8 @@ void KOViewManager::showMonthView() mMainView, SLOT ( beamIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( selectWeekNum( int ) ), mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); + connect( mMonthView, SIGNAL( selectMonth() ), + mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); @@ -532,6 +540,10 @@ void KOViewManager::showMonthView() mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), + mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), + mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); @@ -541,16 +553,44 @@ void KOViewManager::showMonthView() mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); } +} +void KOViewManager::showMonthViewWeek() +{ + createMonthView(); + bool full = true; + if ( mCurrentView == mMonthView) + full = mMainView->leftFrame()->isVisible(); + if ( !KOPrefs::instance()->mMonthViewWeek ) { + mMonthView->switchView(); + if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) + full = false; + else + full = true; + } + mMainView->dateNavigator()->selectWeek(); + showView(mMonthView, full ); +} +void KOViewManager::showMonthView() + { + + createMonthView(); globalFlagBlockAgenda = 1; //mFlagShowNextxDays = false; - // if(mMonthView == mCurrentView) return; - if ( KOPrefs::instance()->mMonthViewWeek ) - mMainView->dateNavigator()->selectWeek(); - else - mMainView->dateNavigator()->selectMonth(); + bool full = true; + if ( mCurrentView == mMonthView) + full = mMainView->leftFrame()->isVisible(); + // if(mMonthView == mCurrentView) return; + if ( KOPrefs::instance()->mMonthViewWeek ) { + mMonthView->switchView(); + if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) + full = false; + else + full = true; + } + mMainView->dateNavigator()->selectMonth(); - showView(mMonthView, true ); + showView(mMonthView, full ); } |