Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kdatenavigator.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index e76a85a..ab9a40f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -57,7 +57,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
57 | qDebug("KDateNavigator::invalid startdate "); | 57 | qDebug("KDateNavigator::invalid startdate "); |
58 | startDate = QDate::currentDate(); | 58 | startDate = QDate::currentDate(); |
59 | } | 59 | } |
60 | 60 | mMonthSignalOffset = 0; | |
61 | mSelectedDates.append(startDate); | 61 | mSelectedDates.append(startDate); |
62 | m_MthYr = startDate; | 62 | m_MthYr = startDate; |
63 | m_bShowWeekNums = true; | 63 | m_bShowWeekNums = true; |
@@ -70,7 +70,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
70 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); | 70 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); |
71 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); | 71 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); |
72 | connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); | 72 | connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); |
73 | connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SIGNAL( monthSelected( int ) ) ); | 73 | connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); |
74 | 74 | ||
75 | // get the day of the week on the first day | 75 | // get the day of the week on the first day |
76 | QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); | 76 | QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); |
@@ -117,6 +117,14 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
117 | enableRollover(FollowMonth); | 117 | enableRollover(FollowMonth); |
118 | //setFixedSize ( sizeHint() ); | 118 | //setFixedSize ( sizeHint() ); |
119 | } | 119 | } |
120 | void KDateNavigator::slotMonthSelected( int m ) | ||
121 | { | ||
122 | if ( m_MthYr.month() <= mMonthSignalOffset) | ||
123 | m += 12; | ||
124 | int mo = m - mMonthSignalOffset; | ||
125 | emit monthSelected( m - mMonthSignalOffset ); | ||
126 | |||
127 | } | ||
120 | void KDateNavigator::setCalendar( Calendar *cal ) | 128 | void KDateNavigator::setCalendar( Calendar *cal ) |
121 | { | 129 | { |
122 | daymatrix->setCalendar( cal ); | 130 | daymatrix->setCalendar( cal ); |