Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba15f7f..b551e2a 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -180,87 +180,72 @@ void KOViewManager::writeSettings(KConfig *config) | |||
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 | if ( view == mMonthView && mMonthView) | 203 | if ( view == mMonthView && mMonthView) |
204 | mMonthView->skipResize = true ; | 204 | ;//mMonthView->skipResize = true ; |
205 | mCurrentView = view; | 205 | mCurrentView = view; |
206 | // bool full = fullScreen; | 206 | // bool full = fullScreen; |
207 | bool isFull = !mMainView->leftFrame()->isVisible(); | 207 | bool isFull = !mMainView->leftFrame()->isVisible(); |
208 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 208 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
209 | full = true; | 209 | full = true; |
210 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 210 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
211 | full = false; | 211 | full = false; |
212 | } | 212 | } |
213 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 213 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
214 | //raiseCurrentView( full ); | 214 | //raiseCurrentView( full ); |
215 | mMainView->processIncidenceSelection( 0 ); | 215 | mMainView->processIncidenceSelection( 0 ); |
216 | //mMainView->updateView(); | 216 | //mMainView->updateView(); |
217 | raiseCurrentView( full, true ); | 217 | raiseCurrentView( full, true ); |
218 | mMainView->adaptNavigationUnits(); | 218 | mMainView->adaptNavigationUnits(); |
219 | } | 219 | } |
220 | 220 | ||
221 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 221 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
222 | { | 222 | { |
223 | mCurrentAgendaView = 0; | 223 | mCurrentAgendaView = 0; |
224 | int wid = mMainView->width() ; | ||
225 | int hei = mMainView->height(); | ||
226 | if ( mCurrentView == mMonthView ) { | ||
227 | if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { | ||
228 | mMainView->navigatorBar()->show(); | ||
229 | hei -= mMainView->navigatorBar()->sizeHint().height(); | ||
230 | } | ||
231 | //mMainView->navigatorBar()->hide(); | ||
232 | } else { | ||
233 | mMainView->navigatorBar()->hide(); | ||
234 | } | ||
235 | if ( fullScreen ) { | 224 | if ( fullScreen ) { |
236 | mMainView->leftFrame()->hide(); | 225 | mMainView->leftFrame()->hide(); |
237 | } else { | 226 | } else { |
238 | mMainView->leftFrame()->show(); | 227 | mMainView->leftFrame()->show(); |
239 | if ( KOPrefs::instance()->mVerticalScreen ) | ||
240 | hei -= mMainView->leftFrame()->height(); | ||
241 | else | ||
242 | wid -= mMainView->leftFrame()->width(); | ||
243 | } | 228 | } |
244 | emit signalFullScreen( !fullScreen ); | 229 | emit signalFullScreen( !fullScreen ); |
245 | if ( callUpdateView ) | 230 | if ( callUpdateView ) |
246 | mMainView->updateView(); | 231 | mMainView->updateView(); |
247 | 232 | ||
248 | if ( globalFlagBlockAgenda == 5 ) { | 233 | if ( globalFlagBlockAgenda == 5 ) { |
249 | globalFlagBlockAgenda = 4; | 234 | globalFlagBlockAgenda = 4; |
250 | globalFlagBlockAgendaItemPaint = 1; | 235 | globalFlagBlockAgendaItemPaint = 1; |
251 | } | 236 | } |
252 | mMainView->viewStack()->raiseWidget(mCurrentView); | 237 | mMainView->viewStack()->raiseWidget(mCurrentView); |
253 | if ( globalFlagBlockAgenda == 4 ) { | 238 | if ( globalFlagBlockAgenda == 4 ) { |
254 | if ( mCurrentView == mAgendaView ) { | 239 | if ( mCurrentView == mAgendaView ) { |
255 | //globalFlagBlockAgenda =1 ; | 240 | //globalFlagBlockAgenda =1 ; |
256 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 241 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
257 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 242 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
258 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 243 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
259 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 244 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
260 | qApp->processEvents(); | 245 | qApp->processEvents(); |
261 | //qDebug("qApp->processEvents() "); | 246 | //qDebug("qApp->processEvents() "); |
262 | globalFlagBlockAgenda = 0; | 247 | globalFlagBlockAgenda = 0; |
263 | mAgendaView->repaintAgenda(); | 248 | mAgendaView->repaintAgenda(); |
264 | 249 | ||
265 | } | 250 | } |
266 | globalFlagBlockAgenda = 0; | 251 | globalFlagBlockAgenda = 0; |
@@ -506,53 +491,69 @@ void KOViewManager::showMonthView() | |||
506 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), | 491 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), |
507 | mMainView, SLOT(showIncidence(Incidence *))); | 492 | mMainView, SLOT(showIncidence(Incidence *))); |
508 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), | 493 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), |
509 | mMainView, SLOT(editIncidence(Incidence *))); | 494 | mMainView, SLOT(editIncidence(Incidence *))); |
510 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 495 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
511 | mMainView, SLOT(deleteIncidence(Incidence *))); | 496 | mMainView, SLOT(deleteIncidence(Incidence *))); |
512 | 497 | ||
513 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 498 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
514 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 499 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
515 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 500 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
516 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 501 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
517 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 502 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
518 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 503 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
519 | 504 | ||
520 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 505 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
521 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 506 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
522 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 507 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
523 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 508 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
524 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 509 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
525 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); | 510 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
526 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 511 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
527 | mMainView, SLOT ( showDay( QDate ) ) ); | 512 | mMainView, SLOT ( showDay( QDate ) ) ); |
528 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 513 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
529 | connect( mMonthView, SIGNAL(nextMonth() ), | 514 | connect( mMonthView, SIGNAL(nextMonth() ), |
530 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); | 515 | mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); |
531 | connect( mMonthView, SIGNAL(prevMonth() ), | 516 | connect( mMonthView, SIGNAL(prevMonth() ), |
532 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | 517 | mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); |
533 | connect( mMonthView, SIGNAL( showNavigator(bool) ), | 518 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), |
534 | mMainView, SLOT ( showNavigatorBar(bool) ) ); | 519 | mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); |
520 | connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), | ||
521 | mMainView->dateNavigator(), SLOT( selectNextYear() ) ); | ||
522 | connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), | ||
523 | mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); | ||
524 | connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), | ||
525 | mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); | ||
526 | connect( mMonthView->navigatorBar(), SIGNAL( selectWeek( int ) ), | ||
527 | mMainView->dateNavigator(), SLOT( selectWeek( int ) ) ); | ||
528 | |||
529 | connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | ||
530 | mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); | ||
531 | |||
532 | |||
533 | connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), | ||
534 | mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); | ||
535 | |||
535 | } | 536 | } |
536 | 537 | ||
537 | globalFlagBlockAgenda = 1; | 538 | globalFlagBlockAgenda = 1; |
538 | //mFlagShowNextxDays = false; | 539 | //mFlagShowNextxDays = false; |
539 | // if(mMonthView == mCurrentView) return; | 540 | // if(mMonthView == mCurrentView) return; |
540 | if ( KOPrefs::instance()->mMonthViewWeek ) | 541 | if ( KOPrefs::instance()->mMonthViewWeek ) |
541 | mMainView->dateNavigator()->selectWeek(); | 542 | mMainView->dateNavigator()->selectWeek(); |
542 | else | 543 | else |
543 | mMainView->dateNavigator()->selectMonth(); | 544 | mMainView->dateNavigator()->selectMonth(); |
544 | 545 | ||
545 | showView(mMonthView, true ); | 546 | showView(mMonthView, true ); |
546 | 547 | ||
547 | } | 548 | } |
548 | 549 | ||
549 | void KOViewManager::showTodoView() | 550 | void KOViewManager::showTodoView() |
550 | { | 551 | { |
551 | //mFlagShowNextxDays = false; | 552 | //mFlagShowNextxDays = false; |
552 | if ( !mTodoView ) { | 553 | if ( !mTodoView ) { |
553 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 554 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
554 | "KOViewManager::TodoView" ); | 555 | "KOViewManager::TodoView" ); |
555 | 556 | ||
556 | addView( mTodoView ); | 557 | addView( mTodoView ); |
557 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 558 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
558 | 559 | ||