Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 94d74f1..c6e76c4 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -163,118 +163,119 @@ void KOViewManager::showDateView( int view, QDate date) | |||
163 | } else | 163 | } else |
164 | showWeekView(); | 164 | showWeekView(); |
165 | } else if (view == 10) { | 165 | } else if (view == 10) { |
166 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); | 166 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | 170 | ||
171 | 171 | ||
172 | void KOViewManager::writeSettings(KConfig *config) | 172 | void KOViewManager::writeSettings(KConfig *config) |
173 | { | 173 | { |
174 | config->setGroup("General"); | 174 | config->setGroup("General"); |
175 | 175 | ||
176 | QString view; | 176 | QString view; |
177 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; | 177 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; |
178 | else if (mCurrentView == mMonthView) view = "Month"; | 178 | else if (mCurrentView == mMonthView) view = "Month"; |
179 | else if (mCurrentView == mListView) view = "List"; | 179 | else if (mCurrentView == mListView) view = "List"; |
180 | else if (mCurrentView == mJournalView) view = "Journal"; | 180 | else if (mCurrentView == mJournalView) view = "Journal"; |
181 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; | 181 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; |
182 | else if (mCurrentView == mTodoView) view = "Todo"; | 182 | else if (mCurrentView == mTodoView) view = "Todo"; |
183 | else view = "Agenda"; | 183 | else view = "Agenda"; |
184 | 184 | ||
185 | config->writeEntry("Current View",view); | 185 | config->writeEntry("Current View",view); |
186 | 186 | ||
187 | if (mAgendaView) { | 187 | if (mAgendaView) { |
188 | mAgendaView->writeSettings(config); | 188 | mAgendaView->writeSettings(config); |
189 | } | 189 | } |
190 | if (mTimeSpanView) { | 190 | if (mTimeSpanView) { |
191 | mTimeSpanView->writeSettings(config); | 191 | mTimeSpanView->writeSettings(config); |
192 | } | 192 | } |
193 | if (mListView) { | 193 | if (mListView) { |
194 | mListView->writeSettings(config); | 194 | mListView->writeSettings(config); |
195 | } | 195 | } |
196 | if (mTodoView) { | 196 | if (mTodoView) { |
197 | mTodoView->saveLayout(config,"Todo View"); | 197 | mTodoView->saveLayout(config,"Todo View"); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 201 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
202 | { | 202 | { |
203 | 203 | ||
204 | //mFlagShowNextxDays = false; | 204 | //mFlagShowNextxDays = false; |
205 | //if(view == mCurrentView) return; | 205 | //if(view == mCurrentView) return; |
206 | if ( view == 0 ) { | 206 | if ( view == 0 ) { |
207 | view = mCurrentView; | 207 | view = mCurrentView; |
208 | if ( view == 0 ) | 208 | if ( view == 0 ) |
209 | return; | 209 | return; |
210 | } | 210 | } |
211 | bool callupdate = !(view == mCurrentView); | ||
211 | bool full = fullScreen; | 212 | bool full = fullScreen; |
212 | if(view == mCurrentView && view != mWhatsNextView ) { | 213 | if(view == mCurrentView && view != mWhatsNextView ) { |
213 | if ( mCurrentAgendaView < 0 ) | 214 | if ( mCurrentAgendaView < 0 ) |
214 | return; | 215 | return; |
215 | if ( view != mMonthView ) | 216 | if ( view != mMonthView ) |
216 | full = mMainView->leftFrame()->isVisible(); | 217 | full = mMainView->leftFrame()->isVisible(); |
217 | } else { | 218 | } else { |
218 | if ( view == mMonthView && mMonthView) | 219 | if ( view == mMonthView && mMonthView) |
219 | ;//mMonthView->skipResize = true ; | 220 | ;//mMonthView->skipResize = true ; |
220 | mCurrentView = view; | 221 | mCurrentView = view; |
221 | // bool full = fullScreen; | 222 | // bool full = fullScreen; |
222 | bool isFull = !mMainView->leftFrame()->isVisible(); | 223 | bool isFull = !mMainView->leftFrame()->isVisible(); |
223 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 224 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
224 | full = true; | 225 | full = true; |
225 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 226 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
226 | full = false; | 227 | full = false; |
227 | } | 228 | } |
228 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 229 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
229 | //raiseCurrentView( full ); | 230 | //raiseCurrentView( full ); |
230 | mMainView->processIncidenceSelection( 0 ); | 231 | mMainView->processIncidenceSelection( 0 ); |
231 | //mMainView->updateView(); | 232 | //mMainView->updateView(); |
232 | raiseCurrentView( full, true ); | 233 | raiseCurrentView( full, callupdate ); |
233 | mMainView->adaptNavigationUnits(); | 234 | mMainView->adaptNavigationUnits(); |
234 | } | 235 | } |
235 | 236 | ||
236 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 237 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
237 | { | 238 | { |
238 | mCurrentAgendaView = 0; | 239 | mCurrentAgendaView = 0; |
239 | if ( fullScreen ) { | 240 | if ( fullScreen ) { |
240 | mMainView->leftFrame()->hide(); | 241 | mMainView->leftFrame()->hide(); |
241 | } else { | 242 | } else { |
242 | mMainView->leftFrame()->show(); | 243 | mMainView->leftFrame()->show(); |
243 | } | 244 | } |
244 | //if ( mCurrentView == mMonthView ) qApp->processEvents(); | 245 | //if ( mCurrentView == mMonthView ) qApp->processEvents(); |
245 | emit signalFullScreen( !fullScreen ); | 246 | emit signalFullScreen( !fullScreen ); |
246 | if ( callUpdateView ) | 247 | if ( callUpdateView ) |
247 | mMainView->updateView(); | 248 | mMainView->updateView(); |
248 | 249 | ||
249 | if ( globalFlagBlockAgenda == 5 ) { | 250 | if ( globalFlagBlockAgenda == 5 ) { |
250 | globalFlagBlockAgenda = 4; | 251 | globalFlagBlockAgenda = 4; |
251 | globalFlagBlockAgendaItemPaint = 1; | 252 | globalFlagBlockAgendaItemPaint = 1; |
252 | } | 253 | } |
253 | mMainView->viewStack()->raiseWidget(mCurrentView); | 254 | mMainView->viewStack()->raiseWidget(mCurrentView); |
254 | if ( globalFlagBlockAgenda == 4 ) { | 255 | if ( globalFlagBlockAgenda == 4 ) { |
255 | if ( mCurrentView == mAgendaView ) { | 256 | if ( mCurrentView == mAgendaView ) { |
256 | //globalFlagBlockAgenda =1 ; | 257 | //globalFlagBlockAgenda =1 ; |
257 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 258 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
258 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 259 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
259 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 260 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
260 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 261 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
261 | qApp->processEvents(); | 262 | qApp->processEvents(); |
262 | //qDebug("qApp->processEvents() "); | 263 | //qDebug("qApp->processEvents() "); |
263 | globalFlagBlockAgenda = 0; | 264 | globalFlagBlockAgenda = 0; |
264 | mAgendaView->repaintAgenda(); | 265 | mAgendaView->repaintAgenda(); |
265 | 266 | ||
266 | } | 267 | } |
267 | globalFlagBlockAgenda = 0; | 268 | globalFlagBlockAgenda = 0; |
268 | } | 269 | } |
269 | emit signalAgendaView( mCurrentView == mAgendaView ); | 270 | emit signalAgendaView( mCurrentView == mAgendaView ); |
270 | //qDebug("raiseCurrentView ende "); | 271 | //qDebug("raiseCurrentView ende "); |
271 | 272 | ||
272 | } | 273 | } |
273 | 274 | ||
274 | void KOViewManager::updateView() | 275 | void KOViewManager::updateView() |
275 | { | 276 | { |
276 | // qDebug("KOViewManager::updateView() "); | 277 | // qDebug("KOViewManager::updateView() "); |
277 | // if we are updating mTodoView, we get endless recursion | 278 | // if we are updating mTodoView, we get endless recursion |
278 | if ( mTodoView == mCurrentView ) | 279 | if ( mTodoView == mCurrentView ) |
279 | return; | 280 | return; |
280 | if ( mCurrentView ) mCurrentView->updateView(); | 281 | if ( mCurrentView ) mCurrentView->updateView(); |