-rw-r--r-- | korganizer/kdatenavigator.cpp | 16 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 83a57ca..1474e4b 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -70,32 +70,33 @@ 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); + headings[i]->installEventFilter(this); 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); } @@ -426,23 +427,38 @@ void KDateNavigator::wheelEvent (QWheelEvent *e) else emit goNext(); e->accept(); } bool KDateNavigator::eventFilter (QObject *o,QEvent *e) { if (e->type() == QEvent::MouseButtonPress) { int i; for(i=0;i<6;++i) { 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; } } //#include "kdatenavigator.moc" diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index a9f5a41..cc0ce9b 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -408,73 +408,76 @@ void KOViewManager::showAgendaView( bool fullScreen ) connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); mAgendaView->readSettings(); mAgendaView->updateConfig(); } showView( mAgendaView, full); } void KOViewManager::showDayView() { + mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); mFlagShowNextxDays = false; globalFlagBlockLabel = 1; globalFlagBlockAgenda = 1; if ( mCurrentAgendaView != 1 ) mCurrentAgendaView = -1; showAgendaView(); qApp->processEvents(); globalFlagBlockAgenda = 2; globalFlagBlockLabel = 0; mMainView->dateNavigator()->selectDates( 1 ); mCurrentAgendaView = 1 ; } void KOViewManager::showWorkWeekView() { + mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); mFlagShowNextxDays = false; globalFlagBlockAgenda = 1; globalFlagBlockLabel = 1; if ( mCurrentAgendaView != 5 ) mCurrentAgendaView = -1; showAgendaView(); qApp->processEvents(); globalFlagBlockAgenda = 2; globalFlagBlockLabel = 0; mMainView->dateNavigator()->selectWorkWeek(); mCurrentAgendaView = 5 ; } void KOViewManager::showWeekView() { /* globalFlagBlockAgenda = 2; qDebug("4globalFlagBlockAgenda = 2; "); //globalFlagBlockPainting = true; mMainView->dateNavigator()->selectWeek(); showAgendaView(); */ + mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); mFlagShowNextxDays = false; globalFlagBlockAgenda = 1; globalFlagBlockLabel = 1; if ( mCurrentAgendaView != 7 ) mCurrentAgendaView = -1; showAgendaView(); qApp->processEvents(); globalFlagBlockAgenda = 2; globalFlagBlockLabel = 0; mMainView->dateNavigator()->selectWeek(); mCurrentAgendaView = 7 ; } void KOViewManager::showNextXView() { |