summaryrefslogtreecommitdiffabout
Side-by-side diff
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
@@ -1909,32 +1909,32 @@ void CalendarView::readSettings()
sizes.clear();
if ( !KOPrefs::instance()->mVerticalScreen ) {
maxVal = QApplication::desktop()->width() -10;
} else {
maxVal = QApplication::desktop()->height()-10;
}
sizes << resetval;
if ( maxVal < resetval + resetval)
resetval = maxVal - resetval;
sizes << resetval;
}
mMainFrame->setSizes(sizes);
-
if ( dateCount == 5 ) mNavigator->selectWorkWeek();
else if ( dateCount == 7 ) mNavigator->selectWeek();
else mNavigator->selectDates( dateCount );
// mViewManager->readSettings( config );
updateConfig();
globalFlagBlockAgenda = 2;
mViewManager->readSettings( config );
+ QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
}
void CalendarView::writeSettings()
{
// kdDebug() << "CalendarView::writeSettings" << endl;
KConfig *config = KOGlobals::config();
mViewManager->writeSettings( config );
mTodoList->saveLayout(config,QString("Todo Layout"));
mDialogManager->writeSettings( config );
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 2290c53..11dc592 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -31,28 +31,29 @@
#include "kdatenavigator.h"
#include <kcalendarsystem.h>
#include "datenavigatorcontainer.h"
#include "koprefs.h"
DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
const char *name )
: QWidget( parent, name ), mCalendar( 0 ),
mHorizontalCount( 1 ), mVerticalCount( 1 )
{
+ mResizeEnabled = false;
mExtraViews.setAutoDelete( true );
mNavigatorView = new KDateNavigator( this, name );
-
+ mNavigatorView->hide();
connectNavigatorView( mNavigatorView );
//setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
mLastDisplayedDN = 0;
mUpdateTimer;
mUpdateTimer = new QTimer( this );
connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
mFirstSelectedDate = QDate::currentDate();
mSelectedDateCount = 1;
}
DateNavigatorContainer::~DateNavigatorContainer()
{
@@ -209,34 +210,27 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates()
mNavigatorView->changeFont( fo );
mNavigatorView->unsetFontChanged();
}
}
mLastDisplayedDN = horizontalCount*verticalCount-1;
while ( count > ( mExtraViews.count() + 1 ) ) {
KDateNavigator *n = new KDateNavigator( this );
n->setMonthSignalOffset ( mExtraViews.count()+1 );
mExtraViews.append( n );
n->setCalendar( mCalendar );
connectNavigatorView( n );
- n->show();
- }
- int iii = 0;
- while ( iii < ( mExtraViews.count() ) ) {
- if ( iii < count-1 )
- mExtraViews.at( iii )->show();
- else
- mExtraViews.at( iii )->hide();
- ++iii;
+ // n->show();
}
+
setBaseDates();
if ( fontchange ) {
//mNavigatorView->changeFont( fo );
uint i;
for( i = 0; i < mExtraViews.count(); ++i ) {
KDateNavigator *view = mExtraViews.at( i );
view->changeFont( fo );
}
}
mHorizontalCount = horizontalCount;
mVerticalCount = verticalCount;
@@ -257,24 +251,34 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates()
int y = ( i + 1 ) / mHorizontalCount;
KDateNavigator *view = mExtraViews.at( i );
bar = view->navigatorBar();
if ( y > 0 ) bar->showButtons( false, false );
else {
if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true );
else bar->showButtons( false, false );
}
view->setGeometry( x * twidth,
y * theight, twidth, theight );
}
+ int iii = 0;
+ int ccc = mHorizontalCount * mVerticalCount;
+ mNavigatorView->show();
+ while ( iii < ( mExtraViews.count() ) ) {
+ if ( iii < ccc-1 )
+ mExtraViews.at( iii )->show();
+ else
+ mExtraViews.at( iii )->hide();
+ ++iii;
+ }
}
QDate last = lastAvailableDate();
QDate first = firstAvailableDate();
QDate selFirst = mFirstSelectedDate;
QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
if ( selFirst >= first && selLast <= last ) {
updateDayMatrixDates();
}
else {
updateDayMatrixDates();
@@ -384,32 +388,42 @@ void DateNavigatorContainer::selectDates( const DateList &dateList )
}
void DateNavigatorContainer::setBaseDates()
{
QDate baseDate = mNavigatorView->baseDate();
bool doRepaint = true;
for( uint i = 0; i < mLastDisplayedDN; ++i ) {
KDateNavigator *n = mExtraViews.at( i );
baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 );
n->setBaseDate( baseDate, doRepaint );
}
}
-
+void DateNavigatorContainer::setResizeEnabled()
+{
+ mResizeEnabled = true;
+ //qDebug("DateNavigatorContainer::setResizeEnabled ");
+ checkUpdateDayMatrixDates();
+}
void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
{
-
+ //qDebug("DateNavigatorContainer::resizeEvent %d %d ", width(), height());
//qDebug("COUNT %d ", mExtraViews.count());
-
- mUpdateTimer->start( 250 );
+ if ( ! mResizeEnabled ) {
+ //qDebug("NOT ResizeEnabled");
+ return;
+ }
+ else
+ mUpdateTimer->start( 250 );
+
//updateDayMatrixDates();
}
QSize DateNavigatorContainer::minimumSizeHint() const
{
return mNavigatorView->minimumSizeHint();
}
QSize DateNavigatorContainer::sizeHint() const
{
return mNavigatorView->yourSizeHint();
}
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index d2f397d..ac9745d 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -54,24 +54,25 @@ class DateNavigatorContainer: public QWidget
void selectDates( const KCal::DateList & );
void updateView();
void updateConfig();
void updateDayMatrix();
void updateDayMatrixDates();
void checkUpdateDayMatrixDates();
void updateToday();
void slotMonthSelected( int month );
void slotgoNextMonth();
void slotgoPrevMonth();
void slotgoNextYear();
void slotgoPrevYear();
+ void setResizeEnabled();
signals:
void datesSelected( const KCal::DateList & );
void incidenceDropped( Incidence *, const QDate & );
void incidenceDroppedMove( Incidence *, const QDate & );
void weekClicked( const QDate &);
void goPrevious();
void goNext();
void goNextMonth();
void goPrevMonth();
@@ -80,24 +81,25 @@ class DateNavigatorContainer: public QWidget
void monthSelected( int month );
protected:
void computeMonthSelected( int month , bool forceEmit );
void jumpMonth( int month );
void resizeEvent( QResizeEvent * );
void setBaseDates();
void connectNavigatorView( KDateNavigator *v );
private:
+ bool mResizeEnabled;
QTimer* mUpdateTimer;
int mLastDisplayedDN;
QDate mFirstSelectedDate;
int mSelectedDateCount;
KDateNavigator *mNavigatorView;
KCal::Calendar *mCalendar;
QPtrList<KDateNavigator> mExtraViews;
int mHorizontalCount;
int mVerticalCount;
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 0cb767f..5eccfd6 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -110,25 +110,25 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
SIGNAL( eventDropped( Event * ) ) );
topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
// read settings from configuration file.
updateConfig();
enableRollover(FollowMonth);
mySizeHint = sizeHintTwoButtons();
myFullSizeHint = sizeHintTwoButtons( 4 );
mFontChanged = false;
- resize ( 3,3 );
+ //resize ( 3,3 );
}
void KDateNavigator::changeFont ( QFont fo )
{
setFont( fo );
mNavigatorBar->resetFont( fo );
}
QFont KDateNavigator::yourFontHint( QSize si , bool *b)
{
QFont fo = KOPrefs::instance()->mDateNavigatorFont;
*b = false;
int fontPoint = fo.pointSize();
@@ -362,24 +362,25 @@ void KDateNavigator::updateConfig()
}
QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day,
true );
if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 );
headings[i]->setText( dayName );
}
updateDates();
updateView();
}
void KDateNavigator::setShowWeekNums(bool enabled)
{
+ qDebug("KDateNavigator::setShowWeekNums***************************** ");
m_bShowWeekNums = enabled;
for(int i=0; i<6; i++) {
if(enabled)
weeknos[i]->show();
else
weeknos[i]->hide();
}
resize(size());
}
void KDateNavigator::selectDates(const DateList& dateList)
{