author | zautrix <zautrix> | 2005-03-22 16:21:03 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 16:21:03 (UTC) |
commit | ab8db23d665b276caa28471bb4db37e6b0de44ef (patch) (side-by-side diff) | |
tree | 4697da2d9426f155237614368f993328560d0b21 /korganizer/datenavigatorcontainer.cpp | |
parent | f36f0308a955f869f18c88ab359f9d605e838f1c (diff) | |
download | kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.zip kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.tar.gz kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.tar.bz2 |
fix
Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 9720146..ba97fa6 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -49,2 +49,5 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, mLastDisplayedDN = 0; + mUpdateTimer; + mUpdateTimer = new QTimer( this ); + connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); } @@ -137,5 +140,20 @@ void DateNavigatorContainer::setCalendar( Calendar *cal ) } +void DateNavigatorContainer::checkUpdateDayMatrixDates() +{ + QDate last = lastAvailableDate(); + QDate first = firstAvailableDate(); + + QDate selFirst = mFirstSelectedDate; + QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); + if ( selFirst >= first && selLast <= last ) { + updateDayMatrixDates(); + } + else { + updateDayMatrixDates(); + emit monthSelected( mFirstSelectedDate.month() ); + } +} void DateNavigatorContainer::updateDayMatrixDates() { - + mUpdateTimer->stop(); QDate fDate = mFirstSelectedDate; @@ -220,16 +238,2 @@ void DateNavigatorContainer::selectDates( const DateList &dateList ) QDate lDate = dateList.last(); - if ( mLastDisplayedDN <= 2 ) { - mNavigatorView->selectDates( dateList ); - KDateNavigator *view = mExtraViews.at( 0 ); - QDate bDate = fDate.addDays( fDate.daysInMonth () - fDate.day() +1 ); - view->setBaseDate( bDate, false ); - view->dayMatrix()->setSelectedDaysFrom(fDate , lDate); - if ( mLastDisplayedDN == 2 ) { - view = mExtraViews.at( 1 ); - bDate = bDate.addDays( bDate.daysInMonth () - bDate.day() +1 ); - view->setBaseDate( bDate, false ); - view->dayMatrix()->setSelectedDaysFrom(fDate , lDate); - } - return; - } //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() ); @@ -374,2 +378,3 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) } + mUpdateTimer->start( 250 ); //updateDayMatrixDates(); |