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 @@ -172,103 +172,88 @@ void KOViewManager::writeSettings(KConfig *config) if (mAgendaView) { mAgendaView->writeSettings(config); } if (mTimeSpanView) { mTimeSpanView->writeSettings(config); } if (mListView) { mListView->writeSettings(config); } if (mTodoView) { mTodoView->saveLayout(config,"Todo View"); } } void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) { //mFlagShowNextxDays = false; //if(view == mCurrentView) return; if ( view == 0 ) { view = mCurrentView; if ( view == 0 ) return; } bool full = fullScreen; if(view == mCurrentView && view != mWhatsNextView ) { if ( mCurrentAgendaView < 0 ) return; full = mMainView->leftFrame()->isVisible(); } else { if ( view == mMonthView && mMonthView) - mMonthView->skipResize = true ; + ;//mMonthView->skipResize = true ; mCurrentView = view; // bool full = fullScreen; bool isFull = !mMainView->leftFrame()->isVisible(); if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) full = true; if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) full = false; } if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); //raiseCurrentView( full ); mMainView->processIncidenceSelection( 0 ); //mMainView->updateView(); raiseCurrentView( full, true ); mMainView->adaptNavigationUnits(); } void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) { mCurrentAgendaView = 0; - int wid = mMainView->width() ; - int hei = mMainView->height(); - if ( mCurrentView == mMonthView ) { - if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { - mMainView->navigatorBar()->show(); - hei -= mMainView->navigatorBar()->sizeHint().height(); - } - //mMainView->navigatorBar()->hide(); - } else { - mMainView->navigatorBar()->hide(); - } if ( fullScreen ) { mMainView->leftFrame()->hide(); } else { mMainView->leftFrame()->show(); - if ( KOPrefs::instance()->mVerticalScreen ) - hei -= mMainView->leftFrame()->height(); - else - wid -= mMainView->leftFrame()->width(); } emit signalFullScreen( !fullScreen ); if ( callUpdateView ) mMainView->updateView(); if ( globalFlagBlockAgenda == 5 ) { globalFlagBlockAgenda = 4; globalFlagBlockAgendaItemPaint = 1; } mMainView->viewStack()->raiseWidget(mCurrentView); if ( globalFlagBlockAgenda == 4 ) { if ( mCurrentView == mAgendaView ) { //globalFlagBlockAgenda =1 ; if ( KOPrefs::instance()->mSetTimeToDayStartAt ) mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); else if ( KOPrefs::instance()->mCenterOnCurrentTime ) mAgendaView->setStartHour( QTime::currentTime ().hour() ); qApp->processEvents(); //qDebug("qApp->processEvents() "); globalFlagBlockAgenda = 0; mAgendaView->repaintAgenda(); } globalFlagBlockAgenda = 0; } emit signalAgendaView( mCurrentView == mAgendaView ); //qDebug("raiseCurrentView ende "); } void KOViewManager::updateView() { @@ -498,69 +483,85 @@ void KOViewManager::showMonthView() mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); addView(mMonthView); // mMonthView->show(); // SIGNALS/SLOTS FOR MONTH VIEW connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), mMainView, SLOT(newEvent(QDateTime))); connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), mMainView, SLOT(showIncidence(Incidence *))); connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), mMainView, SLOT(editIncidence(Incidence *))); connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), mMainView, SLOT(deleteIncidence(Incidence *))); connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( selectWeekNum( int ) ), mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); connect( mMonthView, SIGNAL(nextMonth() ), - mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); + mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); connect( mMonthView, SIGNAL(prevMonth() ), - mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); - connect( mMonthView, SIGNAL( showNavigator(bool) ), - mMainView, SLOT ( showNavigatorBar(bool) ) ); + mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), + mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), + mMainView->dateNavigator(), SLOT( selectNextYear() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), + mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), + mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( selectWeek( int ) ), + mMainView->dateNavigator(), SLOT( selectWeek( int ) ) ); + + connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), + mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); + + + connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), + mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); + } globalFlagBlockAgenda = 1; //mFlagShowNextxDays = false; // if(mMonthView == mCurrentView) return; if ( KOPrefs::instance()->mMonthViewWeek ) mMainView->dateNavigator()->selectWeek(); else mMainView->dateNavigator()->selectMonth(); showView(mMonthView, true ); } void KOViewManager::showTodoView() { //mFlagShowNextxDays = false; if ( !mTodoView ) { mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), "KOViewManager::TodoView" ); addView( mTodoView ); // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); // SIGNALS/SLOTS FOR TODO VIEW connect( mTodoView, SIGNAL( newTodoSignal() ), mMainView, SLOT( newTodo() ) ); connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), mMainView, SLOT( newSubTodo( Todo *) ) ); connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), mMainView, SLOT( showTodo( Todo * ) ) ); connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), |