summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp16
-rw-r--r--korganizer/koviewmanager.cpp5
2 files changed, 20 insertions, 1 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 83a57ca..1474e4b 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -80,12 +80,13 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
// 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);
+ headings[i]->installEventFilter(this);
topLayout->addWidget(headings[i],1,i+1);
}
// Create the weeknumber labels
for( i = 0; i < 6; i++ ) {
@@ -436,12 +437,27 @@ bool KDateNavigator::eventFilter (QObject *o,QEvent *e)
if (o == weeknos[i]) {
QDate weekstart = daymatrix->getDate(i*7);
emit weekClicked(weekstart);
break;
}
}
+ for(i=0;i<7;++i) {
+ if (o == headings[i]) {
+ KCal::DateList selDays;
+ QDate date = daymatrix->getDate(14);
+ int dio = date.daysInMonth();
+ int j;
+ int ye = date.year();
+ int mo = date.month();
+ for ( j = 1; j <= dio; ++j ) {
+ selDays.append( QDate( ye, mo, j ) );
+ }
+ emit datesSelected( selDays );
+ break;
+ }
+ }
return true;
} else {
return false;
}
}
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a9f5a41..cc0ce9b 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -417,13 +417,14 @@ void KOViewManager::showAgendaView( bool fullScreen )
showView( mAgendaView, full);
}
void KOViewManager::showDayView()
-{
+{
+ mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockLabel = 1;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 1 )
mCurrentAgendaView = -1;
showAgendaView();
@@ -434,12 +435,13 @@ void KOViewManager::showDayView()
mCurrentAgendaView = 1 ;
}
void KOViewManager::showWorkWeekView()
{
+ mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockAgenda = 1;
globalFlagBlockLabel = 1;
if ( mCurrentAgendaView != 5 )
mCurrentAgendaView = -1;
showAgendaView();
@@ -459,12 +461,13 @@ void KOViewManager::showWeekView()
//globalFlagBlockPainting = true;
mMainView->dateNavigator()->selectWeek();
showAgendaView();
*/
+ mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockAgenda = 1;
globalFlagBlockLabel = 1;
if ( mCurrentAgendaView != 7 )
mCurrentAgendaView = -1;
showAgendaView();