summaryrefslogtreecommitdiffabout
path: root/korganizer/datenavigatorcontainer.cpp
authorzautrix <zautrix>2005-03-22 16:21:03 (UTC)
committer zautrix <zautrix>2005-03-22 16:21:03 (UTC)
commitab8db23d665b276caa28471bb4db37e6b0de44ef (patch) (side-by-side diff)
tree4697da2d9426f155237614368f993328560d0b21 /korganizer/datenavigatorcontainer.cpp
parentf36f0308a955f869f18c88ab359f9d605e838f1c (diff)
downloadkdepimpi-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.cpp35
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
@@ -47,6 +47,9 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
connectNavigatorView( mNavigatorView );
//setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
mLastDisplayedDN = 0;
+ mUpdateTimer;
+ mUpdateTimer = new QTimer( this );
+ connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
}
DateNavigatorContainer::~DateNavigatorContainer()
@@ -135,9 +138,24 @@ void DateNavigatorContainer::setCalendar( Calendar *cal )
n->setCalendar( 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;
QDate lDate = fDate.addDays( mSelectedDateCount - 1 );
mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate );
@@ -218,20 +236,6 @@ void DateNavigatorContainer::selectDates( const DateList &dateList )
}
QDate fDate = dateList.first();
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() );
//qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() );
if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) {
@@ -372,6 +376,7 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
view->setGeometry( x * width,
y * height, width, height );
}
+ mUpdateTimer->start( 250 );
//updateDayMatrixDates();
}