summaryrefslogtreecommitdiffabout
path: root/korganizer/kdatenavigator.cpp
authorzautrix <zautrix>2005-03-19 22:56:08 (UTC)
committer zautrix <zautrix>2005-03-19 22:56:08 (UTC)
commit84c18843bbd1203878367572d3a6800a0586c7f1 (patch) (side-by-side diff)
tree9f58b7356ea700d47e6ec84fb4a462a666a24049 /korganizer/kdatenavigator.cpp
parent39b719bdc75d95913c3aaf9a03aaa57b1161cc61 (diff)
downloadkdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.zip
kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.tar.gz
kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.tar.bz2
mochn fix
Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index ab9a40f..b097dc1 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -70,124 +70,125 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
// get the day of the week on the first day
QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
m_fstDayOfWk = dayone.dayOfWeek();
int i;
// Set up the heading fields.
for( i = 0; i < 7; i++ ) {
headings[i] = new QLabel("",this);
//headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
headings[i]->setAlignment(AlignCenter);
topLayout->addWidget(headings[i],1,i+1);
}
// Create the weeknumber labels
for( i = 0; i < 6; i++ ) {
weeknos[i] = new QLabel(this);
weeknos[i]->setAlignment(AlignCenter);
//weeknos[i]->setFont(QFont("Arial", 10));
if(!m_bShowWeekNums) {
weeknos[i]->hide();
}
weeknos[i]->installEventFilter(this);
topLayout->addWidget(weeknos[i],i+2,0);
}
daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
daymatrix->setLineWidth(1);
connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
SIGNAL( datesSelected( const KCal::DateList & ) ) );
connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
SIGNAL( eventDropped( Event * ) ) );
topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
// read settings from configuration file.
updateConfig();
enableRollover(FollowMonth);
- //setFixedSize ( sizeHint() );
+ mySizeHint = sizeHint();
}
void KDateNavigator::slotMonthSelected( int m )
{
if ( m_MthYr.month() <= mMonthSignalOffset)
m += 12;
int mo = m - mMonthSignalOffset;
emit monthSelected( m - mMonthSignalOffset );
}
void KDateNavigator::setCalendar( Calendar *cal )
{
daymatrix->setCalendar( cal );
}
-void KDateNavigator::setBaseDate( const QDate &date )
+void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true
{
m_MthYr = date;
updateDates();
updateView();
KCal::DateList dates;
dates.append( date );
mNavigatorBar->selectDates( dates );
daymatrix->clearSelection();
- daymatrix->repaint();
+ if ( doRepaint )
+ daymatrix->repaint();
}
void KDateNavigator::enableRollover(RolloverType r)
{
switch(r)
{
case None :
if (updateTimer)
{
updateTimer->stop();
delete updateTimer;
updateTimer=0L;
}
break;
case FollowDay :
case FollowMonth :
if (!updateTimer)
{
updateTimer = new QTimer(this);
QObject::connect(updateTimer,SIGNAL(timeout()),
this,SLOT(possiblyPastMidnight()));
}
updateTimer->start(0,true);
lastDayChecked = QDate::currentDate();
}
updateRollover=r;
}
KDateNavigator::~KDateNavigator()
{
}
void KDateNavigator::passedMidnight()
{
QDate today = QDate::currentDate();
bool emitMonth = false;
if (today.month() != lastDayChecked.month())
{
if (updateRollover==FollowMonth &&
daymatrix->isEndOfMonth()) {
goNextMonth();
emitMonth=true;
}
}
daymatrix->recalculateToday();