Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 90be237..b0f26d1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -85,93 +85,95 @@ KOrg::BaseView *KOViewManager::currentView() | |||
85 | 85 | ||
86 | void KOViewManager::readSettings(KConfig *config) | 86 | void KOViewManager::readSettings(KConfig *config) |
87 | { | 87 | { |
88 | config->setGroup("General"); | 88 | config->setGroup("General"); |
89 | QString view = config->readEntry("Current View"); | 89 | QString view = config->readEntry("Current View"); |
90 | if (view == "WhatsNext") showWhatsNextView(); | 90 | if (view == "WhatsNext") showWhatsNextView(); |
91 | else if (view == "Month") showMonthView(); | 91 | else if (view == "Month") showMonthView(); |
92 | else if (view == "List") showListView(); | 92 | else if (view == "List") showListView(); |
93 | else if (view == "Journal") showJournalView(); | 93 | else if (view == "Journal") showJournalView(); |
94 | else if (view == "TimeSpan") showTimeSpanView(); | 94 | else if (view == "TimeSpan") showTimeSpanView(); |
95 | else if (view == "Todo") showTodoView(); | 95 | else if (view == "Todo") showTodoView(); |
96 | else { | 96 | else { |
97 | showAgendaView(); | 97 | showAgendaView(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | void KOViewManager::showDateView( int view, QDate date) | 101 | void KOViewManager::showDateView( int view, QDate date) |
102 | { | 102 | { |
103 | static int lastMode = 0; | 103 | static int lastMode = 0; |
104 | static int lastCount = 0; | 104 | static int lastCount = 0; |
105 | static bool lastNDMode = false; | 105 | static bool lastNDMode = false; |
106 | static QDate lastDate; | 106 | static QDate lastDate; |
107 | //qDebug("date %d %s", view, date.toString().latin1()); | 107 | //qDebug("date %d %s", view, date.toString().latin1()); |
108 | 108 | ||
109 | if (view != 9) | ||
110 | lastMode = 0; | ||
109 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); | 111 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); |
110 | bool savemFlagShowNextxDays = mFlagShowNextxDays; | 112 | bool savemFlagShowNextxDays = mFlagShowNextxDays; |
111 | mFlagShowNextxDays = false; | 113 | mFlagShowNextxDays = false; |
112 | if ( view == 3 ) { | 114 | if ( view == 3 ) { |
113 | //mCurrentAgendaView = 1 ; | 115 | //mCurrentAgendaView = 1 ; |
114 | lastDate = mMainView->dateNavigator()->selectedDates().first(); | 116 | lastDate = mMainView->dateNavigator()->selectedDates().first(); |
115 | lastCount = mMainView->dateNavigator()->selectedDates().count(); | 117 | lastCount = mMainView->dateNavigator()->selectedDates().count(); |
116 | lastNDMode = savemFlagShowNextxDays; | 118 | lastNDMode = savemFlagShowNextxDays; |
117 | mMainView->showDay( date ); | 119 | mMainView->showDay( date ); |
120 | lastMode = 1; | ||
118 | } else if (view == 4 ) { | 121 | } else if (view == 4 ) { |
119 | mCurrentAgendaView = 7 ; | 122 | mCurrentAgendaView = 7 ; |
120 | mMainView->dateNavigator()->selectDates( date, 7 ); | 123 | mMainView->dateNavigator()->selectDates( date, 7 ); |
121 | } else if (view == 5 ) { | 124 | } else if (view == 5 ) { |
122 | mCurrentAgendaView = 14 ; | 125 | mCurrentAgendaView = 14 ; |
123 | mMainView->dateNavigator()->selectDates( date, 14); | 126 | mMainView->dateNavigator()->selectDates( date, 14); |
124 | } else if (view == 6 ) { | 127 | } else if (view == 6 ) { |
125 | //mMainView->dateNavigator()->selectDates( date, 7 ); | 128 | //mMainView->dateNavigator()->selectDates( date, 7 ); |
126 | showMonthView(); | 129 | showMonthView(); |
127 | } else if (view == 7 ) { | 130 | } else if (view == 7 ) { |
128 | mMainView->dateNavigator()->selectDate( date ); | 131 | mMainView->dateNavigator()->selectDate( date ); |
129 | showJournalView(); | 132 | showJournalView(); |
130 | } else if (view == 8 ) { | 133 | } else if (view == 8 ) { |
131 | globalFlagBlockAgenda = 1; | 134 | globalFlagBlockAgenda = 1; |
132 | if ( mCurrentAgendaView != 3 ) | 135 | if ( mCurrentAgendaView != 3 ) |
133 | mCurrentAgendaView = -1; | 136 | mCurrentAgendaView = -1; |
134 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 137 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
135 | globalFlagBlockAgenda = 2; | 138 | globalFlagBlockAgenda = 2; |
136 | mMainView->dateNavigator()->selectDates( date , | 139 | mMainView->dateNavigator()->selectDates( date , |
137 | KOPrefs::instance()->mNextXDays ); | 140 | KOPrefs::instance()->mNextXDays ); |
138 | mFlagShowNextxDays = true; | 141 | mFlagShowNextxDays = true; |
139 | mCurrentAgendaView = 3 ; | 142 | mCurrentAgendaView = 3 ; |
140 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) | 143 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) |
141 | if ( lastMode ) { | 144 | if ( lastMode ) { |
142 | mCurrentAgendaView = lastCount ; | 145 | mCurrentAgendaView = lastCount ; |
143 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); | 146 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); |
144 | mFlagShowNextxDays = lastNDMode; | 147 | mFlagShowNextxDays = lastNDMode; |
145 | if ( mFlagShowNextxDays ) { | 148 | if ( mFlagShowNextxDays ) { |
146 | mCurrentAgendaView = 3 ; | 149 | mCurrentAgendaView = 3 ; |
147 | } | 150 | } |
148 | } else | 151 | } else |
149 | showWeekView(); | 152 | showWeekView(); |
150 | } else if (view == 10) { | 153 | } else if (view == 10) { |
151 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); | 154 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); |
152 | } | 155 | } |
153 | lastMode = view; | ||
154 | } | 156 | } |
155 | 157 | ||
156 | 158 | ||
157 | 159 | ||
158 | void KOViewManager::writeSettings(KConfig *config) | 160 | void KOViewManager::writeSettings(KConfig *config) |
159 | { | 161 | { |
160 | config->setGroup("General"); | 162 | config->setGroup("General"); |
161 | 163 | ||
162 | QString view; | 164 | QString view; |
163 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; | 165 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; |
164 | else if (mCurrentView == mMonthView) view = "Month"; | 166 | else if (mCurrentView == mMonthView) view = "Month"; |
165 | else if (mCurrentView == mListView) view = "List"; | 167 | else if (mCurrentView == mListView) view = "List"; |
166 | else if (mCurrentView == mJournalView) view = "Journal"; | 168 | else if (mCurrentView == mJournalView) view = "Journal"; |
167 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; | 169 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; |
168 | else if (mCurrentView == mTodoView) view = "Todo"; | 170 | else if (mCurrentView == mTodoView) view = "Todo"; |
169 | else view = "Agenda"; | 171 | else view = "Agenda"; |
170 | 172 | ||
171 | config->writeEntry("Current View",view); | 173 | config->writeEntry("Current View",view); |
172 | 174 | ||
173 | if (mAgendaView) { | 175 | if (mAgendaView) { |
174 | mAgendaView->writeSettings(config); | 176 | mAgendaView->writeSettings(config); |
175 | } | 177 | } |
176 | if (mTimeSpanView) { | 178 | if (mTimeSpanView) { |
177 | mTimeSpanView->writeSettings(config); | 179 | mTimeSpanView->writeSettings(config); |