summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 8752636..53cd011 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -167,193 +167,193 @@ void KOViewManager::showDateView( int view, QDate date)
167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
168 } 168 }
169} 169}
170 170
171 171
172 172
173void KOViewManager::writeSettings(KConfig *config) 173void KOViewManager::writeSettings(KConfig *config)
174{ 174{
175 config->setGroup("General"); 175 config->setGroup("General");
176 176
177 QString view; 177 QString view;
178 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 178 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
179 else if (mCurrentView == mMonthView) view = "Month"; 179 else if (mCurrentView == mMonthView) view = "Month";
180 else if (mCurrentView == mListView) view = "List"; 180 else if (mCurrentView == mListView) view = "List";
181 else if (mCurrentView == mJournalView) view = "Journal"; 181 else if (mCurrentView == mJournalView) view = "Journal";
182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
183 else if (mCurrentView == mTodoView) view = "Todo"; 183 else if (mCurrentView == mTodoView) view = "Todo";
184 else view = "Agenda"; 184 else view = "Agenda";
185 185
186 config->writeEntry("Current View",view); 186 config->writeEntry("Current View",view);
187 187
188 if (mAgendaView) { 188 if (mAgendaView) {
189 mAgendaView->writeSettings(config); 189 mAgendaView->writeSettings(config);
190 } 190 }
191 if (mTimeSpanView) { 191 if (mTimeSpanView) {
192 mTimeSpanView->writeSettings(config); 192 mTimeSpanView->writeSettings(config);
193 } 193 }
194 if (mListView) { 194 if (mListView) {
195 mListView->writeSettings(config); 195 mListView->writeSettings(config);
196 } 196 }
197 if (mTodoView) { 197 if (mTodoView) {
198 mTodoView->saveLayout(config,"Todo View"); 198 mTodoView->saveLayout(config,"Todo View");
199 } 199 }
200} 200}
201void KOViewManager::showNextView() 201void KOViewManager::showNextView()
202{ 202{
203 if (mCurrentView == mWhatsNextView) goto NEXT_X; 203 if (mCurrentView == mWhatsNextView) goto NEXT_X;
204 204
205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL; 205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL;
206 206
207 if (mCurrentView == mJournalView ) goto DAY_1; 207 if (mCurrentView == mJournalView ) goto DAY_1;
208 208
209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; 209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
210 210
211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; 211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
212 212
213 if (mCurrentView == mAgendaView ) goto DAY_6; 213 if (mCurrentView == mAgendaView ) goto DAY_6;
214 214
215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; 215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
216 216
217 if (mCurrentView == mMonthView ) goto LIST; 217 if (mCurrentView == mMonthView ) goto LIST;
218 218
219 if (mCurrentView == mListView ) goto TODO; 219 if (mCurrentView == mListView ) goto TODO;
220 220
221 // if (mCurrentView == mTodoView ) goto LIST; 221 // if (mCurrentView == mTodoView ) goto LIST;
222 222
223 223
224 NEXT: 224 NEXT:
225 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 225 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
226 NEXT_X: 226 NEXT_X:
227 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 227 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
228 JOURNAL: 228 JOURNAL:
229 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 229 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
230 DAY_1: 230 DAY_1:
231 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 231 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
232 DAY_5: 232 DAY_5:
233 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 233 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
234 DAY_7: 234 DAY_7:
235 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 235 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
236 DAY_6: 236 DAY_6:
237 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 237 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
238 MONTH: 238 MONTH:
239 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 239 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
240 LIST: 240 LIST:
241 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 241 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
242 TODO: 242 TODO:
243 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 243 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
244 244
245 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 245 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
246 246
247 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 247 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
248 248
249 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 249 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
250 250
251 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 251 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
252 252
253 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 253 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
254 254
255 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 255 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
256 256
257 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 257 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
258 258
259 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 259 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
260 260
261 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 261 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
262 262
263 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 263 //if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
264 264
265 265
266 266
267} 267}
268void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 268void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
269{ 269{
270 270
271 //mFlagShowNextxDays = false; 271 //mFlagShowNextxDays = false;
272 //if(view == mCurrentView) return; 272 //if(view == mCurrentView) return;
273 if ( view == 0 ) { 273 if ( view == 0 ) {
274 view = mCurrentView; 274 view = mCurrentView;
275 if ( view == 0 ) 275 if ( view == 0 )
276 return; 276 return;
277 } 277 }
278 bool callupdate = !(view == mCurrentView); 278 bool callupdate = !(view == mCurrentView);
279 bool full = fullScreen; 279 bool full = fullScreen;
280 if(view == mCurrentView && view != mWhatsNextView ) { 280 if(view == mCurrentView && view != mWhatsNextView ) {
281 if ( mCurrentAgendaView < 0 ) 281 if ( mCurrentAgendaView < 0 )
282 return; 282 return;
283 if ( view != mMonthView ) 283 if ( view != mMonthView )
284 full = mMainView->leftFrame()->isVisible(); 284 full = mMainView->leftFrame()->isVisible();
285 } else { 285 } else {
286 if ( view == mMonthView && mMonthView) 286 if ( view == mMonthView && mMonthView)
287 ;//mMonthView->skipResize = true ; 287 ;//mMonthView->skipResize = true ;
288 mCurrentView = view; 288 mCurrentView = view;
289 // bool full = fullScreen; 289 // bool full = fullScreen;
290 bool isFull = !mMainView->leftFrame()->isVisible(); 290 bool isFull = !mMainView->leftFrame()->isVisible();
291 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 291 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
292 full = true; 292 full = true;
293 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 293 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
294 full = false; 294 full = false;
295 } 295 }
296 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 296 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
297 //raiseCurrentView( full ); 297 //raiseCurrentView( full );
298 mMainView->processIncidenceSelection( 0 ); 298 mMainView->processIncidenceSelection( 0 );
299 //mMainView->updateView(); 299 //mMainView->updateView();
300 raiseCurrentView( full, callupdate ); 300 raiseCurrentView( full, callupdate );
301 mMainView->adaptNavigationUnits(); 301 mMainView->adaptNavigationUnits();
302} 302}
303 303
304void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 304void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
305{ 305{
306 mCurrentAgendaView = 0; 306 mCurrentAgendaView = 0;
307 if ( fullScreen ) { 307 if ( fullScreen ) {
308 mMainView->leftFrame()->hide(); 308 mMainView->leftFrame()->hide();
309 } else { 309 } else {
310 mMainView->leftFrame()->show(); 310 mMainView->leftFrame()->show();
311 } 311 }
312 //if ( mCurrentView == mMonthView ) qApp->processEvents(); 312 //if ( mCurrentView == mMonthView ) qApp->processEvents();
313 emit signalFullScreen( !fullScreen ); 313 emit signalFullScreen( !fullScreen );
314 if ( callUpdateView ) 314 if ( callUpdateView )
315 mMainView->updateView(); 315 mMainView->updateView();
316 316
317 if ( globalFlagBlockAgenda == 5 ) { 317 if ( globalFlagBlockAgenda == 5 ) {
318 globalFlagBlockAgenda = 4; 318 globalFlagBlockAgenda = 4;
319 globalFlagBlockAgendaItemPaint = 1; 319 globalFlagBlockAgendaItemPaint = 1;
320 } 320 }
321 mMainView->viewStack()->raiseWidget(mCurrentView); 321 mMainView->viewStack()->raiseWidget(mCurrentView);
322 if ( globalFlagBlockAgenda == 4 ) { 322 if ( globalFlagBlockAgenda == 4 ) {
323 if ( mCurrentView == mAgendaView ) { 323 if ( mCurrentView == mAgendaView ) {
324 //globalFlagBlockAgenda =1 ; 324 //globalFlagBlockAgenda =1 ;
325 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 325 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
326 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 326 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
327 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 327 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
328 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 328 mAgendaView->setStartHour( QTime::currentTime ().hour() );
329 qApp->processEvents(); 329 qApp->processEvents();
330 //qDebug("qApp->processEvents() "); 330 //qDebug("qApp->processEvents() ");
331 globalFlagBlockAgenda = 0; 331 globalFlagBlockAgenda = 0;
332 mAgendaView->repaintAgenda(); 332 mAgendaView->repaintAgenda();
333 333
334 } 334 }
335 globalFlagBlockAgenda = 0; 335 globalFlagBlockAgenda = 0;
336 } 336 }
337 emit signalAgendaView( mCurrentView == mAgendaView ); 337 emit signalAgendaView( mCurrentView == mAgendaView );
338 //qDebug("raiseCurrentView ende "); 338 //qDebug("raiseCurrentView ende ");
339 339
340} 340}
341 341
342void KOViewManager::updateView() 342void KOViewManager::updateView()
343{ 343{
344 // qDebug("KOViewManager::updateView() "); 344 // qDebug("KOViewManager::updateView() ");
345 // if we are updating mTodoView, we get endless recursion 345 // if we are updating mTodoView, we get endless recursion
346 if ( mTodoView == mCurrentView ) 346 if ( mTodoView == mCurrentView )
347 return; 347 return;
348 if ( mCurrentView ) mCurrentView->updateView(); 348 if ( mCurrentView ) mCurrentView->updateView();
349 349
350} 350}
351 351
352void KOViewManager::updateView(const QDate &start, const QDate &end) 352void KOViewManager::updateView(const QDate &start, const QDate &end)
353{ 353{
354 // kdDebug() << "KOViewManager::updateView()" << endl; 354 // kdDebug() << "KOViewManager::updateView()" << endl;
355 355
356 if (mCurrentView) mCurrentView->showDates(start, end); 356 if (mCurrentView) mCurrentView->showDates(start, end);
357 357
358 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); 358 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView();
359} 359}