-rw-r--r-- | korganizer/calendarview.cpp | 5 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 163 | ||||
-rw-r--r-- | korganizer/komonthview.h | 4 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 16 |
7 files changed, 174 insertions, 17 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index cca73f2..be78057 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -3845,24 +3845,29 @@ void CalendarView::purgeCompleted() } } void CalendarView::slotCalendarChanged() { ; } NavigatorBar *CalendarView::navigatorBar() { return mNavigatorBar; } +void CalendarView::showNavigatorBar( bool b) +{ + if ( b ) mNavigatorBar->show(); + else mNavigatorBar->hide(); +} void CalendarView::keyPressEvent ( QKeyEvent *e) { //qDebug(" alendarView::keyPressEvent "); e->ignore(); } bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) { diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 7c59a8d..6ea8287 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -165,24 +165,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser /** Emitted, when the number of outgoing messages has changed. */ void numOutgoingChanged(int); /** Send status message, which can e.g. be displayed in the status bar. */ void statusMessage(const QString &); void calendarViewExpanded( bool ); void updateSearchDialog(); public slots: + void showNavigatorBar(bool); void showOpenError(); void watchSavedFile(); void recheckTimerAlarm(); void checkNextTimerAlarm(); void addAlarm(const QDateTime &qdt, const QString ¬i ); void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); void removeAlarm(const QDateTime &qdt, const QString ¬i ); /** options dialog made a changed to the configuration. we catch this * and notify all widgets which need to update their configuration. */ void updateConfig(); diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 6411156..9888566 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -456,24 +456,31 @@ void MonthViewCell::insertEvent(Event *event) int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); if ( event->recursOn( mDate.addDays( -days)) ) prefix ="<-" ; } } else { if (mDate == event->dtStart().date()) { prefix ="->" ; } else if (mDate == event->dtEnd().date()) { prefix ="<-" ; } } + if ( !event->doesFloat() ) { + if ( mDate == event->dtStart().date () ) + prefix += KGlobal::locale()->formatTime(event->dtStart().time())+" "; + else if ( mDate == event->dtEnd().date () ) + prefix += KGlobal::locale()->formatTime(event->dtEnd().time())+" "; + + } text = prefix + event->summary(); mToolTip += text; } else { if (event->doesFloat()) { text = event->summary(); mToolTip += text; } else { text = KGlobal::locale()->formatTime(event->dtStart().time()); text += " " + event->summary(); mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } @@ -558,30 +565,30 @@ void MonthViewCell::insertTodo(Todo *todo) pal = mStandardPalette ; } item->setPalette( pal ); mItemList->insertItem( item ); mToolTip += text+"\n"; } void MonthViewCell::finishUpdateCell() { #ifdef DESKTOP_VERSION if (mToolTip != "") QToolTip::add(this,mToolTip,toolTipGroup(),""); #endif - + mItemList->sort(); //setMyPalette(); setMyPalette(); QString text; bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; - if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { + if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; mLabel->resize( mLabelBigSize ); text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); } else { mLabel->resize( mLabelSize ); text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); } mLabel->setText( text ); resizeEvent( 0 ); } void MonthViewCell::updateCell() @@ -679,28 +686,28 @@ void MonthViewCell::select() ;// updateCell(); } void MonthViewCell::resizeEvent ( QResizeEvent * ) { if ( !mMonthView->isUpdatePossible() ) return; #ifndef DESKTOP_VERSION if ( !isVisible() ){ return; } #endif - int size = height() - mLabel->height(); + int size = height() - mLabel->height() - 2; if ( size > 0 ) mItemList->verticalScrollBar()->setMaximumHeight( size ); - size = width() - mLabel->width(); + size = width() - mLabel->width() -2; if ( size > 0 ) mItemList->horizontalScrollBar()->setMaximumWidth( size ); mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); } void MonthViewCell::defaultAction( QListBoxItem *item ) { if ( !item ) return; MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); Incidence *incidence = eventItem->incidence(); @@ -723,25 +730,25 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) emit newEventSignal( dt ); return; } /* if ( lastClicked ) if ( ! item ) { if ( lastClicked->listBox() != item->listBox() ) lastClicked->listBox()->clearSelection(); } */ mMonthView->setSelectedCell( this ); - if( KOPrefs::instance()->mEnableMonthScroll ) enableScrollBars( true ); + if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); select(); } void MonthViewCell::contextMenu( QListBoxItem *item ) { if ( !item ) return; MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); Incidence *incidence = eventItem->incidence(); if ( incidence ) mMonthView->showContextMenu( incidence ); } @@ -754,25 +761,28 @@ void MonthViewCell::selection( QListBoxItem *item ) // ******************************************************************************* // ******************************************************************************* // ******************************************************************************* KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) : KOEventView( calendar, parent, name ), mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) { - + mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); + mShowWeekView = KOPrefs::instance()->mMonthViewWeek; + if ( mShowWeekView ) + mWeekStartsMonday = true; updatePossible = false; mCells.setAutoDelete( true ); mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; // mDayLayout = new QGridLayout( this ); // create the day of the week labels (Sun, Mon, etc) and add them to // the layout. mDayLabels.resize( mDaysPerWeek ); QFont bfont = font(); if ( QApplication::desktop()->width() < 650 ) { bfont.setPointSize( bfont.pointSize() - 2 ); } bfont.setBold( true ); @@ -808,34 +818,44 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) MonthViewCell *cell = new MonthViewCell( this ); mCells.insert( row * mDaysPerWeek + col, cell ); connect( cell, SIGNAL( defaultAction( Incidence * ) ), SLOT( defaultAction( Incidence * ) ) ); connect( cell, SIGNAL( newEventSignal( QDateTime ) ), SIGNAL( newEventSignal( QDateTime ) ) ); connect( cell, SIGNAL( showDaySignal( QDate ) ), SIGNAL( showDaySignal( QDate ) ) ); } } + connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), + SLOT( switchView() ) ); mContextMenu = eventPopup(); // updateConfig(); //useless here emit incidenceSelected( 0 ); } KOMonthView::~KOMonthView() { delete mContextMenu; } +void KOMonthView::switchView() +{ + mShowWeekView = !mShowWeekView; + KOPrefs::instance()->mMonthViewWeek = mShowWeekView; + emit showNavigator( !mShowWeekView ); + computeLayout(); + updateConfig(); +} int KOMonthView::maxDatesHint() { return mNumCells; } int KOMonthView::currentDateCount() { return mNumCells; } QPtrList<Incidence> KOMonthView::selectedIncidences() @@ -866,24 +886,26 @@ void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td) { #ifndef KORG_NOPRINTER calPrinter->preview(CalPrinter::Month, fd, td); #endif } void KOMonthView::updateConfig() { mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); + if ( mShowWeekView ) + mWeekStartsMonday = true; QFontMetrics fontmetric(mDayLabels[0]->font()); mWidthLongDayLabel = 0; for (int i = 0; i < 7; i++) { int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; } bool temp = mShowSatSunComp ; mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) computeLayout(); updateDayLabels(); @@ -971,33 +993,35 @@ void KOMonthView::changeEventDisplay(Event *, int) updateView(); } void KOMonthView::updateView() { if ( !updatePossible ) return; //QTime ti; //ti.start(); #if 1 int i; - for( i = 0; i < mCells.count(); ++i ) { + int timeSpan = mCells.size()-1; + if ( KOPrefs::instance()->mMonthViewWeek ) + timeSpan = 6; + for( i = 0; i < timeSpan + 1; ++i ) { mCells[i]->startUpdateCell(); } QPtrList<Event> events = calendar()->events(); Event *event; QDateTime dt; bool ok; - int timeSpan = mCells.size()-1; QDate endDate = mStartDate.addDays( timeSpan ); for( event = events.first(); event; event = events.next() ) { // for event if ( event->doesRecur() ) { bool last; QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); QDateTime incidenceEnd; int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); bool invalid = false; while( true ) { if ( incidenceStart.isValid() ) { incidenceEnd = incidenceStart.addDays( eventlen ); int st = incidenceStart.date().daysTo( endDate ); @@ -1044,31 +1068,31 @@ void KOMonthView::updateView() mCells[iii]->insertEvent( event ); } } } } // insert due todos QPtrList<Todo> todos = calendar()->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); if ( todo->hasDueDate() ) { int day = mStartDate.daysTo( todo->dtDue().date() ); - if ( day >= 0 && day < mCells.size() ) { + if ( day >= 0 && day < timeSpan + 1) { mCells[day]->insertTodo( todo ); } } } - for( i = 0; i < mCells.count(); ++i ) { + for( i = 0; i < timeSpan+1; ++i ) { mCells[i]->finishUpdateCell(); } processSelectionChange(); mCells[0]->setFocus(); #else // old code //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); int i; for( i = 0; i < mCells.count(); ++i ) { mCells[i]->updateCell(); @@ -1079,31 +1103,144 @@ void KOMonthView::updateView() // qDebug("---------------------------------------------------------------------+ "); mCells[0]->setFocus(); #endif //qDebug("update time %d ", ti.elapsed()); } void KOMonthView::resizeEvent(QResizeEvent * e) { computeLayout(); mCells[0]->setFocus(); } +void KOMonthView::computeLayoutWeek() +{ + + int daysToShow; + bool combinedSatSun = false; + if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { + daysToShow = 6; + combinedSatSun = true; + } + int tWid = topLevelWidget()->size().width(); + int tHei = topLevelWidget()->size().height(); + + int wid = size().width();//e + int hei = size().height()-1; + + if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) + return; + + if ( wid < hei ) + daysToShow = 2; + else + daysToShow = 3; + mShowSatSunComp = true; + combinedSatSun = true; + + //qDebug("KOMonthView::computeLayout()------------------------------------ "); + QFontMetrics fm ( mWeekLabels[0]->font() ); + int weeklabelwid = fm.width( "888" ); + wid -= weeklabelwid; + + int colWid = wid / daysToShow; + int lastCol = wid - ( colWid*6 ); + int dayLabelHei = mDayLabels[0]->sizeHint().height(); + int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); + int colModulo = wid % daysToShow; + int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; + //qDebug("rowmod %d ", rowModulo); + int i; + int x,y,w,h; + x= 0; + y= 0; + w = colWid; + h = dayLabelHei ; + for ( i = 0; i < 7; i++) { + if ( i && !( i % daysToShow) && i < 6) { + y += hei/(5-daysToShow); + x = 0; + } + if ( i == daysToShow-colModulo ) + ++w; + if ( i >= 5 ) { + mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); + x -= w/2 ; + } + else + mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); + x += w; + } + x= 0; + y= dayLabelHei; + w = colWid; + h = cellHei; + for ( i = 0; i < mCells.count(); ++i) { + if ( i > 6 ) { + mCells[i]->hide(); + continue; + } + + w = colWid; + if ( ((i) % daysToShow) >= daysToShow-colModulo ) { + ++w; + } + if ( i == (daysToShow-1-rowModulo)*7) + ++h; + + if ( i >= 5 ) { + if ( i ==5 ) { + mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); + x -= w ;y += h/2; + } else { + mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); + y -= h/2; + } + } else + mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); + + + x += w; + if ( x + w/2 > wid ) { + x = 0; + y += h+dayLabelHei ; + } + } + y= dayLabelHei; + h = cellHei ; + mWeekLabels[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); + for ( i = 1; i < 6; i++) { + mWeekLabels[i]->hide(); + } + mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); + // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); + //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); + mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; + updateDayLabels(); + bool forceUpdate = !updatePossible; + updatePossible = true; + mWeekLabels[mNumWeeks]->setText( i18n("M")); + if ( forceUpdate ) + updateView(); +} void KOMonthView::computeLayout() { // select the appropriate heading string size. E.g. "Wednesday" or "Wed". // note this only changes the text if the requested size crosses the // threshold between big enough to support the full name and not big // enough. - + if ( mShowWeekView ){ + computeLayoutWeek(); + return; + } int daysToShow = 7; bool combinedSatSun = false; if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { daysToShow = 6; combinedSatSun = true; } int tWid = topLevelWidget()->size().width(); int tHei = topLevelWidget()->size().height(); int wid = size().width();//e int hei = size().height()-1; @@ -1137,25 +1274,25 @@ void KOMonthView::computeLayout() } else mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); } else mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); x += w; } x= 0; y= dayLabelHei; w = colWid; h = cellHei ; for ( i = 0; i < mCells.count(); ++i) { - + mCells[i]->show(); w = colWid; if ( ((i) % 7) >= 7-colModulo ) { ++w; } if ( i == (6-rowModulo)*7) ++h; if ( combinedSatSun ) { if ( (i)%7 >= daysToShow-1 ) { if ( (i)%7 == daysToShow-1 ) { mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); x -= w ;y += h/2; } else { @@ -1168,36 +1305,38 @@ void KOMonthView::computeLayout() } else mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); x += w; if ( x + w/2 > wid ) { x = 0; y += h; } } y= dayLabelHei; h = cellHei ; for ( i = 0; i < 6; i++) { + mWeekLabels[i]->show(); if ( i == (6-rowModulo)) ++h; mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); y += h; } mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; updateDayLabels(); bool forceUpdate = !updatePossible; updatePossible = true; + mWeekLabels[mNumWeeks]->setText( i18n("W")); if ( forceUpdate ) updateView(); } void KOMonthView::showContextMenu( Incidence *incidence ) { mContextMenu->showIncidencePopup(incidence); /* if( incidence && incidence->type() == "Event" ) { Event *event = static_cast<Event *>(incidence); mContextMenu->showEventPopup(event); } else { diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index b84065e..0bc3743 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -231,43 +231,47 @@ class KOMonthView: public KOEventView virtual void showDates(const QDate &start, const QDate &end); virtual void showEvents(QPtrList<Event> eventList); void changeEventDisplay(Event *, int); void clearSelection(); void showContextMenu( Incidence * ); void setSelectedCell( MonthViewCell * ); protected slots: + void switchView(); void processSelectionChange(); signals: void nextMonth(); void prevMonth(); + void showNavigator( bool ); void selectWeekNum ( int ); void showDaySignal( QDate ); protected: void resizeEvent(QResizeEvent *); void viewChanged(); void updateDayLabels(); private: + bool mShowWeekView; bool updatePossible; int mDaysPerWeek; int mNumWeeks; int mNumCells; bool mWeekStartsMonday; bool mShowSatSunComp; void computeLayout(); + void computeLayoutWeek(); QPtrVector<MonthViewCell> mCells; QPtrVector<QLabel> mDayLabels; QPtrVector<KOWeekButton> mWeekLabels; bool mShortDayLabels; int mWidthLongDayLabel; QDate mStartDate; MonthViewCell *mSelectedCell; diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 0548f14..2fb7c36 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -198,24 +198,25 @@ KOPrefs::KOPrefs() : addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); + addItemBool("MonthViewWeek",&mMonthViewWeek,false); addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); addItemBool("UseAppColors",&mUseAppColors,false); KPrefs::setCurrentGroup("Views"); addItemBool("Show Date Navigator",&mShowDateNavigator,true); addItemInt("Hour Size",&mHourSize,8); addItemBool("Show Daily Recurrences",&mDailyRecur,true); addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 8b849fa..6541af2 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -124,24 +124,25 @@ class KOPrefs : public KPimPrefs QColor mHighlightColor; QColor mEventColor; QColor mTodoDoneColor; QColor mAgendaBgColor; QColor mWorkingHoursColor; QColor mTodoDueTodayColor; QColor mTodoOverdueColor; QColor mMonthViewEvenColor; QColor mMonthViewOddColor; QColor mMonthViewHolidayColor; bool mMonthViewUsesDayColors; bool mMonthViewSatSunTog; + bool mMonthViewWeek; QColor mAppColor1; QColor mAppColor2; bool mUseAppColors; int mDayBegins; int mHourSize; int mAllDaySize; bool mShowFullMenu; bool mDailyRecur; bool mWeeklyRecur; bool mMonthDailyRecur; bool mMonthWeeklyRecur; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 7e126d9..6afd203 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -215,27 +215,29 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) //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 ) { - mMainView->navigatorBar()->show(); - hei -= mMainView->navigatorBar()->sizeHint().height(); + if ( mCurrentView == mMonthView ) { + if ( !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(); @@ -518,31 +520,35 @@ void KOViewManager::showMonthView() mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( selectWeekNum( int ) ), mMainView, SLOT ( selectWeekNum( 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() ) ); connect( mMonthView, SIGNAL(prevMonth() ), mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); - mMonthView->updateConfig(); + connect( mMonthView, SIGNAL( showNavigator(bool) ), + mMainView, SLOT ( showNavigatorBar(bool) ) ); } globalFlagBlockAgenda = 1; //mFlagShowNextxDays = false; // if(mMonthView == mCurrentView) return; - mMainView->dateNavigator()->selectMonth(); + 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" ); |