summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Side-by-side diff
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
@@ -90,3 +90,8 @@ void KOViewManager::readSettings(KConfig *config)
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();
@@ -209,3 +214,4 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
return;
- full = mMainView->leftFrame()->isVisible();
+ if ( view != mMonthView )
+ full = mMainView->leftFrame()->isVisible();
} else {
@@ -488,5 +494,5 @@ bool KOViewManager::showsNextDays()
}
-void KOViewManager::showMonthView()
- {
- if (!mMonthView) {
+void KOViewManager::createMonthView()
+{
+if (!mMonthView) {
mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
@@ -519,2 +525,4 @@ void KOViewManager::showMonthView()
mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) );
+ connect( mMonthView, SIGNAL( selectMonth() ),
+ mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
@@ -534,2 +542,6 @@ void KOViewManager::showMonthView()
mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
+ mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
+ mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
@@ -543,12 +555,40 @@ void KOViewManager::showMonthView()
}
+}
+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 );