summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp120
-rw-r--r--korganizer/koviewmanager.h3
2 files changed, 76 insertions, 47 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 548ffd3..f97aa98 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -63,3 +63,3 @@ KOViewManager::KOViewManager( CalendarView *mainView ) :
mCurrentView = 0;
-
+ flagResetViewChangeDate = 0;
mWhatsNextView = 0;
@@ -202,66 +202,91 @@ void KOViewManager::showNextView()
{
+ static int selecteddatescount = 0;
+ static QDate selecteddate = QDate ( 2000, 1, 1 );
+ static QDate baseCycleDate = QDate ( 2000, 1, 1 );
+ int newCount = mMainView->dateNavigator()->selectedDates().count();
+ if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) {
+ flagResetViewChangeDate = 1;
+ }
+ if ( selecteddate != mMainView->dateNavigator()->selectedDates().first() )
+ flagResetViewChangeDate = 1;
+ if ( flagResetViewChangeDate > 0 ) {
+ baseCycleDate = mMainView->dateNavigator()->selectedDates().first();
+ //qDebug("newCycle ");
+ }
if (mCurrentView == mWhatsNextView) goto NEXT_X;
-
if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL;
-
if (mCurrentView == mJournalView ) goto DAY_1;
-
if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
-
if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
-
if (mCurrentView == mAgendaView ) goto DAY_6;
-
if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
-
if (mCurrentView == mMonthView ) goto LIST;
-
if (mCurrentView == mListView ) goto TODO;
-
- // if (mCurrentView == mTodoView ) goto LIST;
-
-
+ // if (mCurrentView == mTodoView ) goto NEXT;
NEXT:
- if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
+ if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;}
NEXT_X:
- if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
+ if ( KOPrefs::instance()->mShowIconNextDays ) {
+ globalFlagBlockAgenda = 1;
+ if ( mCurrentAgendaView != 3 )
+ mCurrentAgendaView = -1;
+ showAgendaView(KOPrefs::instance()->mFullViewMonth);
+ globalFlagBlockAgenda = 2;
+ mMainView->dateNavigator()->selectDates( baseCycleDate ,
+ KOPrefs::instance()->mNextXDays );
+ mFlagShowNextxDays = true;
+ mCurrentAgendaView = 3 ;
+ goto ENTE ;
+ }
JOURNAL:
- if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
+ if ( KOPrefs::instance()->mShowIconJournal ) {
+ resetDateSilent( baseCycleDate , 1 );
+ showJournalView() ;goto ENTE ;}
DAY_1:
- if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
+ if ( KOPrefs::instance()->mShowIconDay1 ) {
+ resetDateSilent( baseCycleDate , 2 );
+ showDayView() ;goto ENTE ;}
DAY_5:
- if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
+ if ( KOPrefs::instance()->mShowIconDay5 ) {
+ resetDateSilent( baseCycleDate , 2 );
+ showWorkWeekView() ;goto ENTE ;}
DAY_7:
- if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
+ if ( KOPrefs::instance()->mShowIconDay7 ) {
+ resetDateSilent( baseCycleDate , 2 );
+ showWeekView();goto ENTE ;}
DAY_6:
- if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
+ if ( KOPrefs::instance()->mShowIconDay6 ) {
+ resetDateSilent( baseCycleDate , 2 );
+ showMonthViewWeek();goto ENTE ;}
MONTH:
- if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
+ if ( KOPrefs::instance()->mShowIconMonth ) {
+ resetDateSilent( baseCycleDate , 2 );
+ showMonthView();goto ENTE ;}
LIST:
- if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
+ if ( KOPrefs::instance()->mShowIconList ) {
+ resetDateSilent( baseCycleDate , 2 );
+ showListView() ;goto ENTE ;}
TODO:
- if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
-
- if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
-
- if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
-
- if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
-
- if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
-
- if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
-
- if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
-
- if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
-
- if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
-
- if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
-
- //if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
-
-
-
+ if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;goto ENTE ;}
+ if ( KOPrefs::instance()->mShowIconNext ) { goto NEXT ;}
+ if ( KOPrefs::instance()->mShowIconNextDays ) { goto NEXT_X ;}
+ if ( KOPrefs::instance()->mShowIconJournal ) { goto JOURNAL;}
+ if ( KOPrefs::instance()->mShowIconDay1 ) { goto DAY_1 ;}
+ if ( KOPrefs::instance()->mShowIconDay5 ) { goto DAY_5 ;}
+ if ( KOPrefs::instance()->mShowIconDay7 ) { goto DAY_7 ;}
+ if ( KOPrefs::instance()->mShowIconDay6 ) { goto DAY_6 ;}
+ if ( KOPrefs::instance()->mShowIconMonth ) {goto MONTH ;}
+ if ( KOPrefs::instance()->mShowIconList ) { goto LIST ;}
+ //if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;goto ENTE ;}
+ ENTE:
+ flagResetViewChangeDate = 0;
+ selecteddatescount = mMainView->dateNavigator()->selectedDates().count();
+ selecteddate = mMainView->dateNavigator()->selectedDates().first();
+
+}
+void KOViewManager::resetDateSilent( QDate date , int days )
+{
+ mMainView->dateNavigator()->blockSignals( true );
+ mMainView->dateNavigator()->selectDates( date , days );
+ mMainView->dateNavigator()->blockSignals( false );
}
@@ -269,3 +294,4 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
{
-
+ if ( flagResetViewChangeDate < 10 )
+ ++flagResetViewChangeDate;
//mFlagShowNextxDays = false;
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 1d565a6..8dc03e0 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -103,2 +103,5 @@ class KOViewManager : public QObject
private:
+ void resetDateSilent( QDate date , int days );
+ int flagResetViewChangeDate;
+ QDate currentViewChangeDate;
void createMonthView();