-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 @@ -116,5 +116,8 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) break; case Key_Up: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+count()-1)%count()); if(!itemVisible(currentItem())) { @@ -127,5 +130,8 @@ 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())) { @@ -950,4 +956,5 @@ void KOMonthView::changeEventDisplay(Event *, int) void KOMonthView::updateView() { + if ( !updatePossible ) return; @@ -961,4 +968,5 @@ void KOMonthView::updateView() processSelectionChange(); // qDebug("---------------------------------------------------------------------+ "); + setFocus(); } @@ -1124,6 +1132,23 @@ 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 @@ -238,4 +238,6 @@ class KOMonthView: public KOEventView void processSelectionChange(); signals: + void nextMonth(); + void prevMonth(); void selectWeekNum ( int ); void showDaySignal( QDate ); diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 94c459b..e8d5ab1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -458,4 +458,8 @@ void KOViewManager::showMonthView() 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 @@ -1737,5 +1737,5 @@ void MainWindow::showConfigureAgenda( ) 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 ) |