-rw-r--r-- | korganizer/koviewmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 8aa0697..ca3de59 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -177,97 +177,97 @@ void KOViewManager::writeSettings(KConfig *config) | |||
177 | mTimeSpanView->writeSettings(config); | 177 | mTimeSpanView->writeSettings(config); |
178 | } | 178 | } |
179 | if (mListView) { | 179 | if (mListView) { |
180 | mListView->writeSettings(config); | 180 | mListView->writeSettings(config); |
181 | } | 181 | } |
182 | if (mTodoView) { | 182 | if (mTodoView) { |
183 | mTodoView->saveLayout(config,"Todo View"); | 183 | mTodoView->saveLayout(config,"Todo View"); |
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 187 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
188 | { | 188 | { |
189 | 189 | ||
190 | //mFlagShowNextxDays = false; | 190 | //mFlagShowNextxDays = false; |
191 | //if(view == mCurrentView) return; | 191 | //if(view == mCurrentView) return; |
192 | if ( view == 0 ) { | 192 | if ( view == 0 ) { |
193 | view = mCurrentView; | 193 | view = mCurrentView; |
194 | if ( view == 0 ) | 194 | if ( view == 0 ) |
195 | return; | 195 | return; |
196 | } | 196 | } |
197 | bool full = fullScreen; | 197 | bool full = fullScreen; |
198 | if(view == mCurrentView && view != mWhatsNextView ) { | 198 | if(view == mCurrentView && view != mWhatsNextView ) { |
199 | if ( mCurrentAgendaView < 0 ) | 199 | if ( mCurrentAgendaView < 0 ) |
200 | return; | 200 | return; |
201 | full = mMainView->leftFrame()->isVisible(); | 201 | full = mMainView->leftFrame()->isVisible(); |
202 | } else { | 202 | } else { |
203 | mCurrentView = view; | 203 | mCurrentView = view; |
204 | // bool full = fullScreen; | 204 | // bool full = fullScreen; |
205 | bool isFull = !mMainView->leftFrame()->isVisible(); | 205 | bool isFull = !mMainView->leftFrame()->isVisible(); |
206 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 206 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
207 | full = true; | 207 | full = true; |
208 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 208 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
209 | full = false; | 209 | full = false; |
210 | } | 210 | } |
211 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 211 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
212 | //raiseCurrentView( full ); | 212 | //raiseCurrentView( full ); |
213 | mMainView->processIncidenceSelection( 0 ); | 213 | mMainView->processIncidenceSelection( 0 ); |
214 | //mMainView->updateView(); | 214 | //mMainView->updateView(); |
215 | raiseCurrentView( full, true ); | 215 | raiseCurrentView( full, true ); |
216 | mMainView->adaptNavigationUnits(); | 216 | mMainView->adaptNavigationUnits(); |
217 | } | 217 | } |
218 | 218 | ||
219 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 219 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
220 | { | 220 | { |
221 | mCurrentAgendaView = 0; | 221 | mCurrentAgendaView = 0; |
222 | int wid = mMainView->width() ; | 222 | int wid = mMainView->width() ; |
223 | int hei = mMainView->height(); | 223 | int hei = mMainView->height(); |
224 | if ( mCurrentView == mMonthView ) { | 224 | if ( mCurrentView == mMonthView ) { |
225 | if ( !KOPrefs::instance()->mMonthViewWeek ) { | 225 | if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { |
226 | mMainView->navigatorBar()->show(); | 226 | mMainView->navigatorBar()->show(); |
227 | hei -= mMainView->navigatorBar()->sizeHint().height(); | 227 | hei -= mMainView->navigatorBar()->sizeHint().height(); |
228 | } | 228 | } |
229 | //mMainView->navigatorBar()->hide(); | 229 | //mMainView->navigatorBar()->hide(); |
230 | } else { | 230 | } else { |
231 | mMainView->navigatorBar()->hide(); | 231 | mMainView->navigatorBar()->hide(); |
232 | } | 232 | } |
233 | if ( fullScreen ) { | 233 | if ( fullScreen ) { |
234 | mMainView->leftFrame()->hide(); | 234 | mMainView->leftFrame()->hide(); |
235 | } else { | 235 | } else { |
236 | mMainView->leftFrame()->show(); | 236 | mMainView->leftFrame()->show(); |
237 | if ( KOPrefs::instance()->mVerticalScreen ) | 237 | if ( KOPrefs::instance()->mVerticalScreen ) |
238 | hei -= mMainView->leftFrame()->height(); | 238 | hei -= mMainView->leftFrame()->height(); |
239 | else | 239 | else |
240 | wid -= mMainView->leftFrame()->width(); | 240 | wid -= mMainView->leftFrame()->width(); |
241 | } | 241 | } |
242 | emit signalFullScreen( !fullScreen ); | 242 | emit signalFullScreen( !fullScreen ); |
243 | if ( callUpdateView ) | 243 | if ( callUpdateView ) |
244 | mMainView->updateView(); | 244 | mMainView->updateView(); |
245 | 245 | ||
246 | if ( globalFlagBlockAgenda == 5 ) { | 246 | if ( globalFlagBlockAgenda == 5 ) { |
247 | globalFlagBlockAgenda = 4; | 247 | globalFlagBlockAgenda = 4; |
248 | globalFlagBlockAgendaItemPaint = 1; | 248 | globalFlagBlockAgendaItemPaint = 1; |
249 | } | 249 | } |
250 | mMainView->viewStack()->raiseWidget(mCurrentView); | 250 | mMainView->viewStack()->raiseWidget(mCurrentView); |
251 | if ( globalFlagBlockAgenda == 4 ) { | 251 | if ( globalFlagBlockAgenda == 4 ) { |
252 | if ( mCurrentView == mAgendaView ) { | 252 | if ( mCurrentView == mAgendaView ) { |
253 | //globalFlagBlockAgenda =1 ; | 253 | //globalFlagBlockAgenda =1 ; |
254 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 254 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
255 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 255 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
256 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 256 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
257 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 257 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
258 | qApp->processEvents(); | 258 | qApp->processEvents(); |
259 | //qDebug("qApp->processEvents() "); | 259 | //qDebug("qApp->processEvents() "); |
260 | globalFlagBlockAgenda = 0; | 260 | globalFlagBlockAgenda = 0; |
261 | mAgendaView->repaintAgenda(); | 261 | mAgendaView->repaintAgenda(); |
262 | 262 | ||
263 | } | 263 | } |
264 | globalFlagBlockAgenda = 0; | 264 | globalFlagBlockAgenda = 0; |
265 | } | 265 | } |
266 | emit signalAgendaView( mCurrentView == mAgendaView ); | 266 | emit signalAgendaView( mCurrentView == mAgendaView ); |
267 | //qDebug("raiseCurrentView ende "); | 267 | //qDebug("raiseCurrentView ende "); |
268 | 268 | ||
269 | } | 269 | } |
270 | 270 | ||
271 | void KOViewManager::updateView() | 271 | void KOViewManager::updateView() |
272 | { | 272 | { |
273 | // qDebug("KOViewManager::updateView() "); | 273 | // qDebug("KOViewManager::updateView() "); |
@@ -473,97 +473,97 @@ void KOViewManager::showWeekView() | |||
473 | 473 | ||
474 | void KOViewManager::showNextXView() | 474 | void KOViewManager::showNextXView() |
475 | { | 475 | { |
476 | 476 | ||
477 | globalFlagBlockAgenda = 1; | 477 | globalFlagBlockAgenda = 1; |
478 | if ( mCurrentAgendaView != 3 ) | 478 | if ( mCurrentAgendaView != 3 ) |
479 | mCurrentAgendaView = -1; | 479 | mCurrentAgendaView = -1; |
480 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 480 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
481 | globalFlagBlockAgenda = 2; | 481 | globalFlagBlockAgenda = 2; |
482 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 482 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
483 | KOPrefs::instance()->mNextXDays ); | 483 | KOPrefs::instance()->mNextXDays ); |
484 | mFlagShowNextxDays = true; | 484 | mFlagShowNextxDays = true; |
485 | mCurrentAgendaView = 3 ; | 485 | mCurrentAgendaView = 3 ; |
486 | } | 486 | } |
487 | bool KOViewManager::showsNextDays() | 487 | bool KOViewManager::showsNextDays() |
488 | { | 488 | { |
489 | return mFlagShowNextxDays; | 489 | return mFlagShowNextxDays; |
490 | } | 490 | } |
491 | void KOViewManager::showMonthView() | 491 | void KOViewManager::showMonthView() |
492 | { | 492 | { |
493 | if (!mMonthView) { | 493 | if (!mMonthView) { |
494 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 494 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
495 | 495 | ||
496 | addView(mMonthView); | 496 | addView(mMonthView); |
497 | // mMonthView->show(); | 497 | // mMonthView->show(); |
498 | // SIGNALS/SLOTS FOR MONTH VIEW | 498 | // SIGNALS/SLOTS FOR MONTH VIEW |
499 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), | 499 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), |
500 | mMainView, SLOT(newEvent(QDateTime))); | 500 | mMainView, SLOT(newEvent(QDateTime))); |
501 | 501 | ||
502 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), | 502 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), |
503 | mMainView, SLOT(showIncidence(Incidence *))); | 503 | mMainView, SLOT(showIncidence(Incidence *))); |
504 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), | 504 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), |
505 | mMainView, SLOT(editIncidence(Incidence *))); | 505 | mMainView, SLOT(editIncidence(Incidence *))); |
506 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 506 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
507 | mMainView, SLOT(deleteIncidence(Incidence *))); | 507 | mMainView, SLOT(deleteIncidence(Incidence *))); |
508 | 508 | ||
509 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 509 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
510 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 510 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
511 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 511 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
512 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 512 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
513 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 513 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
514 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 514 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
515 | 515 | ||
516 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 516 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
517 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 517 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
518 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 518 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
519 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 519 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
520 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 520 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
521 | mMainView, SLOT ( selectWeekNum( int ) ) ); | 521 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
522 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 522 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
523 | mMainView, SLOT ( showDay( QDate ) ) ); | 523 | mMainView, SLOT ( showDay( QDate ) ) ); |
524 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 524 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
525 | connect( mMonthView, SIGNAL(nextMonth() ), | 525 | connect( mMonthView, SIGNAL(nextMonth() ), |
526 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); | 526 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); |
527 | connect( mMonthView, SIGNAL(prevMonth() ), | 527 | connect( mMonthView, SIGNAL(prevMonth() ), |
528 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | 528 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); |
529 | connect( mMonthView, SIGNAL( showNavigator(bool) ), | 529 | connect( mMonthView, SIGNAL( showNavigator(bool) ), |
530 | mMainView, SLOT ( showNavigatorBar(bool) ) ); | 530 | mMainView, SLOT ( showNavigatorBar(bool) ) ); |
531 | } | 531 | } |
532 | 532 | ||
533 | globalFlagBlockAgenda = 1; | 533 | globalFlagBlockAgenda = 1; |
534 | //mFlagShowNextxDays = false; | 534 | //mFlagShowNextxDays = false; |
535 | // if(mMonthView == mCurrentView) return; | 535 | // if(mMonthView == mCurrentView) return; |
536 | if ( KOPrefs::instance()->mMonthViewWeek ) | 536 | if ( KOPrefs::instance()->mMonthViewWeek ) |
537 | mMainView->dateNavigator()->selectWeek(); | 537 | mMainView->dateNavigator()->selectWeek(); |
538 | else | 538 | else |
539 | mMainView->dateNavigator()->selectMonth(); | 539 | mMainView->dateNavigator()->selectMonth(); |
540 | 540 | ||
541 | showView(mMonthView, true ); | 541 | showView(mMonthView, true ); |
542 | 542 | ||
543 | } | 543 | } |
544 | 544 | ||
545 | void KOViewManager::showTodoView() | 545 | void KOViewManager::showTodoView() |
546 | { | 546 | { |
547 | //mFlagShowNextxDays = false; | 547 | //mFlagShowNextxDays = false; |
548 | if ( !mTodoView ) { | 548 | if ( !mTodoView ) { |
549 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 549 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
550 | "KOViewManager::TodoView" ); | 550 | "KOViewManager::TodoView" ); |
551 | 551 | ||
552 | addView( mTodoView ); | 552 | addView( mTodoView ); |
553 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 553 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
554 | 554 | ||
555 | // SIGNALS/SLOTS FOR TODO VIEW | 555 | // SIGNALS/SLOTS FOR TODO VIEW |
556 | connect( mTodoView, SIGNAL( newTodoSignal() ), | 556 | connect( mTodoView, SIGNAL( newTodoSignal() ), |
557 | mMainView, SLOT( newTodo() ) ); | 557 | mMainView, SLOT( newTodo() ) ); |
558 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), | 558 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), |
559 | mMainView, SLOT( newSubTodo( Todo *) ) ); | 559 | mMainView, SLOT( newSubTodo( Todo *) ) ); |
560 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), | 560 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), |
561 | mMainView, SLOT( showTodo( Todo * ) ) ); | 561 | mMainView, SLOT( showTodo( Todo * ) ) ); |
562 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), | 562 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), |
563 | mMainView, SLOT( editTodo( Todo * ) ) ); | 563 | mMainView, SLOT( editTodo( Todo * ) ) ); |
564 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), | 564 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), |
565 | mMainView, SLOT( deleteTodo( Todo * ) ) ); | 565 | mMainView, SLOT( deleteTodo( Todo * ) ) ); |
566 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), | 566 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), |
567 | mMainView, SLOT( purgeCompleted() ) ); | 567 | mMainView, SLOT( purgeCompleted() ) ); |
568 | 568 | ||
569 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), | 569 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), |