-rw-r--r-- | korganizer/koviewmanager.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 188ad23..7e126d9 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -97,22 +97,24 @@ void KOViewManager::readSettings(KConfig *config) | |||
97 | showAgendaView(); | 97 | showAgendaView(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | |||
102 | void KOViewManager::showDateView( int view, QDate date) | 101 | void KOViewManager::showDateView( int view, QDate date) |
103 | { | 102 | { |
104 | 103 | static int lastMode = 0; | |
104 | static int lastCount = 0; | ||
105 | static bool lastNDMode = false; | ||
106 | static QDate lastDate; | ||
105 | //qDebug("date %d %s", view, date.toString().latin1()); | 107 | //qDebug("date %d %s", view, date.toString().latin1()); |
106 | #if 0 | 108 | |
107 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); | 109 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); |
108 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); | 110 | bool savemFlagShowNextxDays = mFlagShowNextxDays; |
109 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); | 111 | mFlagShowNextxDays = false; |
110 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); | ||
111 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); | ||
112 | #endif | ||
113 | if ( view == 3 ) { | 112 | if ( view == 3 ) { |
114 | //mCurrentAgendaView = 1 ; | 113 | //mCurrentAgendaView = 1 ; |
114 | lastDate = mMainView->dateNavigator()->selectedDates().first(); | ||
115 | lastCount = mMainView->dateNavigator()->selectedDates().count(); | ||
116 | lastNDMode = savemFlagShowNextxDays; | ||
115 | mMainView->showDay( date ); | 117 | mMainView->showDay( date ); |
116 | } else if (view == 4 ) { | 118 | } else if (view == 4 ) { |
117 | mCurrentAgendaView = 7 ; | 119 | mCurrentAgendaView = 7 ; |
118 | mMainView->dateNavigator()->selectDates( date, 7 ); | 120 | mMainView->dateNavigator()->selectDates( date, 7 ); |
@@ -137,21 +139,22 @@ void KOViewManager::showDateView( int view, QDate date) | |||
137 | mMainView->dateNavigator()->selectDates( date , | 139 | mMainView->dateNavigator()->selectDates( date , |
138 | KOPrefs::instance()->mNextXDays ); | 140 | KOPrefs::instance()->mNextXDays ); |
139 | mFlagShowNextxDays = true; | 141 | mFlagShowNextxDays = true; |
140 | mCurrentAgendaView = 3 ; | 142 | mCurrentAgendaView = 3 ; |
141 | } if (view == 9) { | 143 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) |
144 | if ( lastMode ) { | ||
145 | mCurrentAgendaView = lastCount ; | ||
146 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); | ||
147 | mFlagShowNextxDays = lastNDMode; | ||
148 | if ( mFlagShowNextxDays ) { | ||
149 | mCurrentAgendaView = 3 ; | ||
150 | } | ||
151 | } else | ||
142 | showWeekView(); | 152 | showWeekView(); |
143 | } else if (view == 10) { | 153 | } else if (view == 10) { |
144 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); | 154 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); |
145 | } | 155 | } |
146 | 156 | lastMode = view; | |
147 | #if 0 | ||
148 | dateNavigator()->blockSignals( true ); | ||
149 | dateNavigator()->selectDate( d ); | ||
150 | dateNavigator()->blockSignals( false ); | ||
151 | mViewManager->showDayView(); | ||
152 | #endif | ||
153 | |||
154 | } | 157 | } |
155 | 158 | ||
156 | 159 | ||
157 | 160 | ||