-rw-r--r-- | korganizer/komonthview.cpp | 33 | ||||
-rw-r--r-- | korganizer/komonthview.h | 2 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
4 files changed, 36 insertions, 5 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 437debe..10e4f1d 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -115,7 +115,10 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) scrollBy(-4,0); break; case Key_Up: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+count()-1)%count()); if(!itemVisible(currentItem())) { if((unsigned int) currentItem() == (count()-1)) { @@ -126,7 +129,10 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } break; case Key_Down: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+1)%count()); if(!itemVisible(currentItem())) { if(currentItem() == 0) { @@ -949,6 +955,7 @@ void KOMonthView::changeEventDisplay(Event *, int) void KOMonthView::updateView() { + if ( !updatePossible ) return; //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); @@ -960,6 +967,7 @@ void KOMonthView::updateView() //qDebug("KOMonthView::updateView() "); processSelectionChange(); // qDebug("---------------------------------------------------------------------+ "); + setFocus(); } void KOMonthView::resizeEvent(QResizeEvent * e) @@ -1123,7 +1131,24 @@ void KOMonthView::clearSelection() } void KOMonthView::keyPressEvent ( QKeyEvent * e ) { - + switch(e->key()) { + break; + case Key_Up: + { + emit prevMonth(); + setFocus(); + } + e->accept(); + break; + case Key_Down: + { + emit nextMonth(); + setFocus(); + } + e->accept(); + break; + default: e->ignore(); - + break; + } } diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a965bf3..50903b3 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -237,6 +237,8 @@ class KOMonthView: public KOEventView protected slots: void processSelectionChange(); signals: + void nextMonth(); + void prevMonth(); void selectWeekNum ( int ); void showDaySignal( QDate ); protected: diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 94c459b..e8d5ab1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -457,6 +457,10 @@ void KOViewManager::showMonthView() connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); + connect( mMonthView, SIGNAL(nextMonth() ), + mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); + connect( mMonthView, SIGNAL(prevMonth() ), + mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); mMonthView->updateConfig(); } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 145b36c..950d2ec 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1736,7 +1736,7 @@ void MainWindow::showConfigureAgenda( ) for ( iii = 1;iii<= 10 ;++iii ){ configureAgendaMenu->setItemChecked( (iii+1)*2, false ); } - configureAgendaMenu->setItemChecked( KOPrefs::instance()->mHourSize, true ); + configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); } void MainWindow::configureAgenda( int item ) { |