summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/datenavigatorcontainer.cpp42
-rw-r--r--korganizer/datenavigatorcontainer.h2
-rw-r--r--korganizer/kdatenavigator.cpp3
4 files changed, 33 insertions, 16 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9a4e719..6ed6a1c 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1915,20 +1915,20 @@ void CalendarView::readSettings()
1915 sizes << resetval; 1915 sizes << resetval;
1916 if ( maxVal < resetval + resetval) 1916 if ( maxVal < resetval + resetval)
1917 resetval = maxVal - resetval; 1917 resetval = maxVal - resetval;
1918 sizes << resetval; 1918 sizes << resetval;
1919 } 1919 }
1920 mMainFrame->setSizes(sizes); 1920 mMainFrame->setSizes(sizes);
1921
1922 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 1921 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1923 else if ( dateCount == 7 ) mNavigator->selectWeek(); 1922 else if ( dateCount == 7 ) mNavigator->selectWeek();
1924 else mNavigator->selectDates( dateCount ); 1923 else mNavigator->selectDates( dateCount );
1925 // mViewManager->readSettings( config ); 1924 // mViewManager->readSettings( config );
1926 updateConfig(); 1925 updateConfig();
1927 globalFlagBlockAgenda = 2; 1926 globalFlagBlockAgenda = 2;
1928 mViewManager->readSettings( config ); 1927 mViewManager->readSettings( config );
1928 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
1929} 1929}
1930 1930
1931 1931
1932void CalendarView::writeSettings() 1932void CalendarView::writeSettings()
1933{ 1933{
1934 // kdDebug() << "CalendarView::writeSettings" << endl; 1934 // kdDebug() << "CalendarView::writeSettings" << endl;
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 2290c53..11dc592 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -37,16 +37,17 @@
37 37
38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, 38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
39 const char *name ) 39 const char *name )
40 : QWidget( parent, name ), mCalendar( 0 ), 40 : QWidget( parent, name ), mCalendar( 0 ),
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 41 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 42{
43 mResizeEnabled = false;
43 mExtraViews.setAutoDelete( true ); 44 mExtraViews.setAutoDelete( true );
44 45
45 mNavigatorView = new KDateNavigator( this, name ); 46 mNavigatorView = new KDateNavigator( this, name );
46 47 mNavigatorView->hide();
47 connectNavigatorView( mNavigatorView ); 48 connectNavigatorView( mNavigatorView );
48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 49 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
49 mLastDisplayedDN = 0; 50 mLastDisplayedDN = 0;
50 mUpdateTimer; 51 mUpdateTimer;
51 mUpdateTimer = new QTimer( this ); 52 mUpdateTimer = new QTimer( this );
52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); 53 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
@@ -215,22 +216,15 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates()
215 while ( count > ( mExtraViews.count() + 1 ) ) { 216 while ( count > ( mExtraViews.count() + 1 ) ) {
216 KDateNavigator *n = new KDateNavigator( this ); 217 KDateNavigator *n = new KDateNavigator( this );
217 n->setMonthSignalOffset ( mExtraViews.count()+1 ); 218 n->setMonthSignalOffset ( mExtraViews.count()+1 );
218 mExtraViews.append( n ); 219 mExtraViews.append( n );
219 n->setCalendar( mCalendar ); 220 n->setCalendar( mCalendar );
220 connectNavigatorView( n ); 221 connectNavigatorView( n );
221 n->show(); 222 // n->show();
222 }
223 int iii = 0;
224 while ( iii < ( mExtraViews.count() ) ) {
225 if ( iii < count-1 )
226 mExtraViews.at( iii )->show();
227 else
228 mExtraViews.at( iii )->hide();
229 ++iii;
230 } 223 }
224
231 225
232 setBaseDates(); 226 setBaseDates();
233 if ( fontchange ) { 227 if ( fontchange ) {
234 //mNavigatorView->changeFont( fo ); 228 //mNavigatorView->changeFont( fo );
235 uint i; 229 uint i;
236 for( i = 0; i < mExtraViews.count(); ++i ) { 230 for( i = 0; i < mExtraViews.count(); ++i ) {
@@ -263,12 +257,22 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates()
263 if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); 257 if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true );
264 else bar->showButtons( false, false ); 258 else bar->showButtons( false, false );
265 } 259 }
266 view->setGeometry( x * twidth, 260 view->setGeometry( x * twidth,
267 y * theight, twidth, theight ); 261 y * theight, twidth, theight );
268 } 262 }
263 int iii = 0;
264 int ccc = mHorizontalCount * mVerticalCount;
265 mNavigatorView->show();
266 while ( iii < ( mExtraViews.count() ) ) {
267 if ( iii < ccc-1 )
268 mExtraViews.at( iii )->show();
269 else
270 mExtraViews.at( iii )->hide();
271 ++iii;
272 }
269 } 273 }
270 274
271 QDate last = lastAvailableDate(); 275 QDate last = lastAvailableDate();
272 QDate first = firstAvailableDate(); 276 QDate first = firstAvailableDate();
273 277
274 QDate selFirst = mFirstSelectedDate; 278 QDate selFirst = mFirstSelectedDate;
@@ -390,20 +394,30 @@ void DateNavigatorContainer::setBaseDates()
390 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 394 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
391 KDateNavigator *n = mExtraViews.at( i ); 395 KDateNavigator *n = mExtraViews.at( i );
392 baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); 396 baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 );
393 n->setBaseDate( baseDate, doRepaint ); 397 n->setBaseDate( baseDate, doRepaint );
394 } 398 }
395} 399}
396 400void DateNavigatorContainer::setResizeEnabled()
401{
402 mResizeEnabled = true;
403 //qDebug("DateNavigatorContainer::setResizeEnabled ");
404 checkUpdateDayMatrixDates();
405}
397void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) 406void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
398{ 407{
399 408
400 409 //qDebug("DateNavigatorContainer::resizeEvent %d %d ", width(), height());
401 //qDebug("COUNT %d ", mExtraViews.count()); 410 //qDebug("COUNT %d ", mExtraViews.count());
402 411 if ( ! mResizeEnabled ) {
403 mUpdateTimer->start( 250 ); 412 //qDebug("NOT ResizeEnabled");
413 return;
414 }
415 else
416 mUpdateTimer->start( 250 );
417
404 //updateDayMatrixDates(); 418 //updateDayMatrixDates();
405} 419}
406 420
407QSize DateNavigatorContainer::minimumSizeHint() const 421QSize DateNavigatorContainer::minimumSizeHint() const
408{ 422{
409 return mNavigatorView->minimumSizeHint(); 423 return mNavigatorView->minimumSizeHint();
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index d2f397d..ac9745d 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -60,12 +60,13 @@ class DateNavigatorContainer: public QWidget
60 void updateToday(); 60 void updateToday();
61 void slotMonthSelected( int month ); 61 void slotMonthSelected( int month );
62 void slotgoNextMonth(); 62 void slotgoNextMonth();
63 void slotgoPrevMonth(); 63 void slotgoPrevMonth();
64 void slotgoNextYear(); 64 void slotgoNextYear();
65 void slotgoPrevYear(); 65 void slotgoPrevYear();
66 void setResizeEnabled();
66 67
67 signals: 68 signals:
68 void datesSelected( const KCal::DateList & ); 69 void datesSelected( const KCal::DateList & );
69 void incidenceDropped( Incidence *, const QDate & ); 70 void incidenceDropped( Incidence *, const QDate & );
70 void incidenceDroppedMove( Incidence *, const QDate & ); 71 void incidenceDroppedMove( Incidence *, const QDate & );
71 void weekClicked( const QDate &); 72 void weekClicked( const QDate &);
@@ -86,12 +87,13 @@ class DateNavigatorContainer: public QWidget
86 void resizeEvent( QResizeEvent * ); 87 void resizeEvent( QResizeEvent * );
87 88
88 void setBaseDates(); 89 void setBaseDates();
89 void connectNavigatorView( KDateNavigator *v ); 90 void connectNavigatorView( KDateNavigator *v );
90 91
91 private: 92 private:
93 bool mResizeEnabled;
92 QTimer* mUpdateTimer; 94 QTimer* mUpdateTimer;
93 int mLastDisplayedDN; 95 int mLastDisplayedDN;
94 QDate mFirstSelectedDate; 96 QDate mFirstSelectedDate;
95 int mSelectedDateCount; 97 int mSelectedDateCount;
96 KDateNavigator *mNavigatorView; 98 KDateNavigator *mNavigatorView;
97 99
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 0cb767f..5eccfd6 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -116,13 +116,13 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
116 // read settings from configuration file. 116 // read settings from configuration file.
117 updateConfig(); 117 updateConfig();
118 enableRollover(FollowMonth); 118 enableRollover(FollowMonth);
119 mySizeHint = sizeHintTwoButtons(); 119 mySizeHint = sizeHintTwoButtons();
120 myFullSizeHint = sizeHintTwoButtons( 4 ); 120 myFullSizeHint = sizeHintTwoButtons( 4 );
121 mFontChanged = false; 121 mFontChanged = false;
122 resize ( 3,3 ); 122 //resize ( 3,3 );
123 123
124} 124}
125void KDateNavigator::changeFont ( QFont fo ) 125void KDateNavigator::changeFont ( QFont fo )
126{ 126{
127 setFont( fo ); 127 setFont( fo );
128 mNavigatorBar->resetFont( fo ); 128 mNavigatorBar->resetFont( fo );
@@ -368,12 +368,13 @@ void KDateNavigator::updateConfig()
368 updateDates(); 368 updateDates();
369 updateView(); 369 updateView();
370} 370}
371 371
372void KDateNavigator::setShowWeekNums(bool enabled) 372void KDateNavigator::setShowWeekNums(bool enabled)
373{ 373{
374 qDebug("KDateNavigator::setShowWeekNums***************************** ");
374 m_bShowWeekNums = enabled; 375 m_bShowWeekNums = enabled;
375 for(int i=0; i<6; i++) { 376 for(int i=0; i<6; i++) {
376 if(enabled) 377 if(enabled)
377 weeknos[i]->show(); 378 weeknos[i]->show();
378 else 379 else
379 weeknos[i]->hide(); 380 weeknos[i]->hide();