summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp50
1 files changed, 45 insertions, 5 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)
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();
@@ -208,4 +213,5 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
if ( mCurrentAgendaView < 0 )
return;
+ if ( view != mMonthView )
full = mMainView->leftFrame()->isVisible();
} else {
@@ -487,5 +493,5 @@ bool KOViewManager::showsNextDays()
return mFlagShowNextxDays;
}
-void KOViewManager::showMonthView()
+void KOViewManager::createMonthView()
{
if (!mMonthView) {
@@ -518,4 +524,6 @@ void KOViewManager::showMonthView()
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 ) ) );
@@ -533,4 +541,8 @@ void KOViewManager::showMonthView()
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 & ) ),
@@ -542,14 +554,42 @@ 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;
+ bool full = true;
+ if ( mCurrentView == mMonthView)
+ full = mMainView->leftFrame()->isVisible();
// if(mMonthView == mCurrentView) return;
- if ( KOPrefs::instance()->mMonthViewWeek )
- mMainView->dateNavigator()->selectWeek();
+ 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 );
}