-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 @@ -114,9 +114,12 @@ 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)) { setTopItem(currentItem()-numItemsVisible()+1); @@ -125,9 +128,12 @@ 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) { setTopItem(0); @@ -948,8 +954,9 @@ void KOMonthView::changeEventDisplay(Event *, int) } void KOMonthView::updateView() { + if ( !updatePossible ) return; //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); int i; @@ -959,8 +966,9 @@ void KOMonthView::updateView() //qDebug("KOMonthView::updateView() "); processSelectionChange(); // qDebug("---------------------------------------------------------------------+ "); + setFocus(); } void KOMonthView::resizeEvent(QResizeEvent * e) { @@ -1122,8 +1130,25 @@ 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 @@ -236,8 +236,10 @@ class KOMonthView: public KOEventView protected slots: void processSelectionChange(); signals: + void nextMonth(); + void prevMonth(); void selectWeekNum ( int ); void showDaySignal( QDate ); protected: void resizeEvent(QResizeEvent *); diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 94c459b..e8d5ab1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -456,8 +456,12 @@ void KOViewManager::showMonthView() mMainView, SLOT ( selectWeekNum( int ) ) ); 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(); } globalFlagBlockAgenda = 1; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 145b36c..950d2ec 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1735,9 +1735,9 @@ void MainWindow::showConfigureAgenda( ) int iii; 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 ) { if ( KOPrefs::instance()->mHourSize == item ) |