-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 20 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 7 | ||||
-rw-r--r-- | korganizer/kdatenavigator.h | 5 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 2 |
5 files changed, 24 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 29c530b..9acbbb1 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1853,13 +1853,12 @@ void CalendarView::readSettings() | |||
1853 | if ( maxVal < resetval + resetval) | 1853 | if ( maxVal < resetval + resetval) |
1854 | resetval = maxVal - resetval; | 1854 | resetval = maxVal - resetval; |
1855 | sizes << resetval; | 1855 | sizes << resetval; |
1856 | sizes << 100; | 1856 | sizes << 100; |
1857 | } | 1857 | } |
1858 | mLeftFrame->setSizes(sizes); | 1858 | mLeftFrame->setSizes(sizes); |
1859 | qDebug("sizes count %d ", sizes.count()); | ||
1860 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1859 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1861 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1860 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1862 | else mNavigator->selectDates( dateCount ); | 1861 | else mNavigator->selectDates( dateCount ); |
1863 | // mViewManager->readSettings( config ); | 1862 | // mViewManager->readSettings( config ); |
1864 | updateConfig(); | 1863 | updateConfig(); |
1865 | globalFlagBlockAgenda = 2; | 1864 | globalFlagBlockAgenda = 2; |
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 3f6e29b..d09f484 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -124,49 +124,59 @@ void DateNavigatorContainer::updateConfig() | |||
124 | } | 124 | } |
125 | 125 | ||
126 | void DateNavigatorContainer::selectDates( const DateList &dateList ) | 126 | void DateNavigatorContainer::selectDates( const DateList &dateList ) |
127 | { | 127 | { |
128 | mNavigatorView->selectDates( dateList ); | 128 | mNavigatorView->selectDates( dateList ); |
129 | setBaseDates(); | 129 | setBaseDates(); |
130 | if ( mExtraViews.count() ) { | ||
131 | KDateNavigator *view = mExtraViews.at( 0 ); | ||
132 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | ||
133 | view->dayMatrix()->repaint(); | ||
134 | } | ||
130 | } | 135 | } |
131 | 136 | ||
132 | void DateNavigatorContainer::setBaseDates() | 137 | void DateNavigatorContainer::setBaseDates() |
133 | { | 138 | { |
134 | KCal::DateList dateList = mNavigatorView->selectedDates(); | 139 | KCal::DateList dateList = mNavigatorView->selectedDates(); |
135 | if ( dateList.isEmpty() ) { | 140 | if ( dateList.isEmpty() ) { |
136 | kdError() << "DateNavigatorContainer::selectDates() empty list." << endl; | 141 | kdError() << "DateNavigatorContainer::selectDates() empty list." << endl; |
137 | } | 142 | } |
138 | QDate baseDate = dateList.first(); | 143 | QDate baseDate = dateList.first(); |
139 | KDateNavigator *n; | 144 | KDateNavigator *n; |
145 | bool doRepaint = false; // skip first repaint | ||
140 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { | 146 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { |
141 | baseDate = baseDate.addDays( baseDate.daysInMonth () ); | 147 | baseDate = baseDate.addDays( baseDate.daysInMonth () ); |
142 | n->setBaseDate( baseDate ); | 148 | n->setBaseDate( baseDate, doRepaint ); |
149 | doRepaint = true; | ||
143 | } | 150 | } |
144 | } | 151 | } |
145 | 152 | ||
146 | void DateNavigatorContainer::resizeEvent( QResizeEvent * ) | 153 | void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) |
147 | { | 154 | { |
148 | #if 0 | 155 | #if 0 |
149 | kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; | 156 | kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; |
150 | kdDebug(5850) << " CURRENT SIZE: " << size() << endl; | 157 | kdDebug(5850) << " CURRENT SIZE: " << size() << endl; |
151 | kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; | 158 | kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; |
152 | kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; | 159 | kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; |
153 | kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; | 160 | kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; |
154 | #endif | 161 | #endif |
155 | 162 | QSize minSize = mNavigatorView->yourSizeHint(); | |
156 | QSize minSize = mNavigatorView->minimumSizeHint(); | ||
157 | 163 | ||
158 | // kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; | 164 | // kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; |
159 | 165 | ||
160 | int verticalCount = size().height() / minSize.height(); | 166 | int verticalCount = size().height() / minSize.height(); |
161 | int horizontalCount = size().width() / minSize.width(); | 167 | int horizontalCount = size().width() / minSize.width(); |
168 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); | ||
162 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); | 169 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); |
163 | if ( horizontalCount != mHorizontalCount || | 170 | if ( horizontalCount != mHorizontalCount || |
164 | verticalCount != mVerticalCount ) { | 171 | verticalCount != mVerticalCount ) { |
165 | uint count = horizontalCount * verticalCount; | 172 | uint count = horizontalCount * verticalCount; |
166 | if ( count == 0 ) return; | 173 | if ( count == 0 ) { |
174 | mNavigatorView->resize( minSize ); | ||
175 | return; | ||
176 | } | ||
167 | 177 | ||
168 | while ( count > ( mExtraViews.count() + 1 ) ) { | 178 | while ( count > ( mExtraViews.count() + 1 ) ) { |
169 | KDateNavigator *n = new KDateNavigator( this ); | 179 | KDateNavigator *n = new KDateNavigator( this ); |
170 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); | 180 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); |
171 | mExtraViews.append( n ); | 181 | mExtraViews.append( n ); |
172 | n->setCalendar( mCalendar ); | 182 | n->setCalendar( mCalendar ); |
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index ab9a40f..b097dc1 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -112,13 +112,13 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
112 | 112 | ||
113 | topLayout->addMultiCellWidget(daymatrix,2,7,1,7); | 113 | topLayout->addMultiCellWidget(daymatrix,2,7,1,7); |
114 | 114 | ||
115 | // read settings from configuration file. | 115 | // read settings from configuration file. |
116 | updateConfig(); | 116 | updateConfig(); |
117 | enableRollover(FollowMonth); | 117 | enableRollover(FollowMonth); |
118 | //setFixedSize ( sizeHint() ); | 118 | mySizeHint = sizeHint(); |
119 | } | 119 | } |
120 | void KDateNavigator::slotMonthSelected( int m ) | 120 | void KDateNavigator::slotMonthSelected( int m ) |
121 | { | 121 | { |
122 | if ( m_MthYr.month() <= mMonthSignalOffset) | 122 | if ( m_MthYr.month() <= mMonthSignalOffset) |
123 | m += 12; | 123 | m += 12; |
124 | int mo = m - mMonthSignalOffset; | 124 | int mo = m - mMonthSignalOffset; |
@@ -127,25 +127,26 @@ void KDateNavigator::slotMonthSelected( int m ) | |||
127 | } | 127 | } |
128 | void KDateNavigator::setCalendar( Calendar *cal ) | 128 | void KDateNavigator::setCalendar( Calendar *cal ) |
129 | { | 129 | { |
130 | daymatrix->setCalendar( cal ); | 130 | daymatrix->setCalendar( cal ); |
131 | } | 131 | } |
132 | 132 | ||
133 | void KDateNavigator::setBaseDate( const QDate &date ) | 133 | void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true |
134 | { | 134 | { |
135 | m_MthYr = date; | 135 | m_MthYr = date; |
136 | 136 | ||
137 | updateDates(); | 137 | updateDates(); |
138 | updateView(); | 138 | updateView(); |
139 | 139 | ||
140 | KCal::DateList dates; | 140 | KCal::DateList dates; |
141 | dates.append( date ); | 141 | dates.append( date ); |
142 | mNavigatorBar->selectDates( dates ); | 142 | mNavigatorBar->selectDates( dates ); |
143 | 143 | ||
144 | daymatrix->clearSelection(); | 144 | daymatrix->clearSelection(); |
145 | daymatrix->repaint(); | 145 | if ( doRepaint ) |
146 | daymatrix->repaint(); | ||
146 | } | 147 | } |
147 | 148 | ||
148 | void KDateNavigator::enableRollover(RolloverType r) | 149 | void KDateNavigator::enableRollover(RolloverType r) |
149 | { | 150 | { |
150 | switch(r) | 151 | switch(r) |
151 | { | 152 | { |
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 56822fa..292e71c 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h | |||
@@ -57,16 +57,18 @@ class KDateNavigator: public QFrame | |||
57 | */ | 57 | */ |
58 | enum RolloverType { None, FollowDay, FollowMonth } ; | 58 | enum RolloverType { None, FollowDay, FollowMonth } ; |
59 | void enableRollover( RolloverType ); | 59 | void enableRollover( RolloverType ); |
60 | 60 | ||
61 | void setShowWeekNums( bool enabled ); | 61 | void setShowWeekNums( bool enabled ); |
62 | void setCalendar( Calendar * ); | 62 | void setCalendar( Calendar * ); |
63 | void setBaseDate( const QDate & ); | 63 | void setBaseDate( const QDate & , bool doRepaint = true ); |
64 | KCal::DateList selectedDates() const { return mSelectedDates; } | 64 | KCal::DateList selectedDates() const { return mSelectedDates; } |
65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } | 65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } |
66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;} | 66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;} |
67 | QSize yourSizeHint() { return mySizeHint; } | ||
68 | KODayMatrix *dayMatrix() { return daymatrix ;} | ||
67 | public slots: | 69 | public slots: |
68 | void selectDates( const KCal::DateList & ); | 70 | void selectDates( const KCal::DateList & ); |
69 | void updateView(); | 71 | void updateView(); |
70 | void updateConfig(); | 72 | void updateConfig(); |
71 | void updateDayMatrix(); | 73 | void updateDayMatrix(); |
72 | 74 | ||
@@ -111,12 +113,13 @@ class KDateNavigator: public QFrame | |||
111 | 113 | ||
112 | void wheelEvent (QWheelEvent *); | 114 | void wheelEvent (QWheelEvent *); |
113 | 115 | ||
114 | bool eventFilter (QObject *,QEvent *); | 116 | bool eventFilter (QObject *,QEvent *); |
115 | 117 | ||
116 | private: | 118 | private: |
119 | QSize mySizeHint; | ||
117 | int mMonthSignalOffset; | 120 | int mMonthSignalOffset; |
118 | NavigatorBar *mNavigatorBar; | 121 | NavigatorBar *mNavigatorBar; |
119 | 122 | ||
120 | QFrame *headingSep; | 123 | QFrame *headingSep; |
121 | QFrame *weeknumSep; | 124 | QFrame *weeknumSep; |
122 | QLabel *headings[7]; | 125 | QLabel *headings[7]; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index a886f4a..17a8546 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -198,13 +198,13 @@ void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) | |||
198 | { | 198 | { |
199 | mSelStart = startdate.daysTo(start); | 199 | mSelStart = startdate.daysTo(start); |
200 | mSelEnd = startdate.daysTo(end); | 200 | mSelEnd = startdate.daysTo(end); |
201 | } | 201 | } |
202 | void KODayMatrix::clearSelection() | 202 | void KODayMatrix::clearSelection() |
203 | { | 203 | { |
204 | mSelEnd = mSelStart = NOSELECTION; | 204 | mSelEnd = mSelStart = NOSELECTION; |
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||
208 | void KODayMatrix::recalculateToday() | 208 | void KODayMatrix::recalculateToday() |
209 | { | 209 | { |
210 | today = -1; | 210 | today = -1; |