-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 | |||
@@ -112,24 +112,30 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
112 | e->ignore(); | 112 | e->ignore(); |
113 | return; | 113 | return; |
114 | } | 114 | } |
115 | scrollBy(-4,0); | 115 | scrollBy(-4,0); |
116 | break; | 116 | break; |
117 | case Key_Up: | 117 | case Key_Up: |
118 | if(!count()) break; | 118 | if(count() < 2) { |
119 | e->ignore(); | ||
120 | break; | ||
121 | } | ||
119 | setCurrentItem((currentItem()+count()-1)%count()); | 122 | setCurrentItem((currentItem()+count()-1)%count()); |
120 | if(!itemVisible(currentItem())) { | 123 | if(!itemVisible(currentItem())) { |
121 | if((unsigned int) currentItem() == (count()-1)) { | 124 | if((unsigned int) currentItem() == (count()-1)) { |
122 | setTopItem(currentItem()-numItemsVisible()+1); | 125 | setTopItem(currentItem()-numItemsVisible()+1); |
123 | } else { | 126 | } else { |
124 | setTopItem(topItem()-1); | 127 | setTopItem(topItem()-1); |
125 | } | 128 | } |
126 | } | 129 | } |
127 | break; | 130 | break; |
128 | case Key_Down: | 131 | case Key_Down: |
129 | if(!count()) break; | 132 | if(count() < 2) { |
133 | e->ignore(); | ||
134 | break; | ||
135 | } | ||
130 | setCurrentItem((currentItem()+1)%count()); | 136 | setCurrentItem((currentItem()+1)%count()); |
131 | if(!itemVisible(currentItem())) { | 137 | if(!itemVisible(currentItem())) { |
132 | if(currentItem() == 0) { | 138 | if(currentItem() == 0) { |
133 | setTopItem(0); | 139 | setTopItem(0); |
134 | } else { | 140 | } else { |
135 | setTopItem(topItem()+1); | 141 | setTopItem(topItem()+1); |
@@ -946,23 +952,25 @@ void KOMonthView::changeEventDisplay(Event *, int) | |||
946 | // quick-and-dirty-hack gets the job done for right now. | 952 | // quick-and-dirty-hack gets the job done for right now. |
947 | updateView(); | 953 | updateView(); |
948 | } | 954 | } |
949 | 955 | ||
950 | void KOMonthView::updateView() | 956 | void KOMonthView::updateView() |
951 | { | 957 | { |
958 | |||
952 | if ( !updatePossible ) | 959 | if ( !updatePossible ) |
953 | return; | 960 | return; |
954 | //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); | 961 | //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); |
955 | int i; | 962 | int i; |
956 | for( i = 0; i < mCells.count(); ++i ) { | 963 | for( i = 0; i < mCells.count(); ++i ) { |
957 | mCells[i]->updateCell(); | 964 | mCells[i]->updateCell(); |
958 | } | 965 | } |
959 | 966 | ||
960 | //qDebug("KOMonthView::updateView() "); | 967 | //qDebug("KOMonthView::updateView() "); |
961 | processSelectionChange(); | 968 | processSelectionChange(); |
962 | // qDebug("---------------------------------------------------------------------+ "); | 969 | // qDebug("---------------------------------------------------------------------+ "); |
970 | setFocus(); | ||
963 | } | 971 | } |
964 | 972 | ||
965 | void KOMonthView::resizeEvent(QResizeEvent * e) | 973 | void KOMonthView::resizeEvent(QResizeEvent * e) |
966 | { | 974 | { |
967 | computeLayout(); | 975 | computeLayout(); |
968 | } | 976 | } |
@@ -1120,10 +1128,27 @@ void KOMonthView::clearSelection() | |||
1120 | mSelectedCell->deselect(); | 1128 | mSelectedCell->deselect(); |
1121 | mSelectedCell = 0; | 1129 | mSelectedCell = 0; |
1122 | } | 1130 | } |
1123 | } | 1131 | } |
1124 | void KOMonthView::keyPressEvent ( QKeyEvent * e ) | 1132 | void KOMonthView::keyPressEvent ( QKeyEvent * e ) |
1125 | { | 1133 | { |
1126 | 1134 | switch(e->key()) { | |
1135 | break; | ||
1136 | case Key_Up: | ||
1137 | { | ||
1138 | emit prevMonth(); | ||
1139 | setFocus(); | ||
1140 | } | ||
1141 | e->accept(); | ||
1142 | break; | ||
1143 | case Key_Down: | ||
1144 | { | ||
1145 | emit nextMonth(); | ||
1146 | setFocus(); | ||
1147 | } | ||
1148 | e->accept(); | ||
1149 | break; | ||
1150 | default: | ||
1127 | e->ignore(); | 1151 | e->ignore(); |
1128 | 1152 | break; | |
1153 | } | ||
1129 | } | 1154 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a965bf3..50903b3 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -234,12 +234,14 @@ class KOMonthView: public KOEventView | |||
234 | 234 | ||
235 | void setSelectedCell( MonthViewCell * ); | 235 | void setSelectedCell( MonthViewCell * ); |
236 | 236 | ||
237 | protected slots: | 237 | protected slots: |
238 | void processSelectionChange(); | 238 | void processSelectionChange(); |
239 | signals: | 239 | signals: |
240 | void nextMonth(); | ||
241 | void prevMonth(); | ||
240 | void selectWeekNum ( int ); | 242 | void selectWeekNum ( int ); |
241 | void showDaySignal( QDate ); | 243 | void showDaySignal( QDate ); |
242 | protected: | 244 | protected: |
243 | void resizeEvent(QResizeEvent *); | 245 | void resizeEvent(QResizeEvent *); |
244 | void viewChanged(); | 246 | void viewChanged(); |
245 | void updateDayLabels(); | 247 | void updateDayLabels(); |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 94c459b..e8d5ab1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -454,12 +454,16 @@ void KOViewManager::showMonthView() | |||
454 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 454 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
455 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 455 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
456 | mMainView, SLOT ( selectWeekNum( int ) ) ); | 456 | mMainView, SLOT ( selectWeekNum( int ) ) ); |
457 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 457 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
458 | mMainView, SLOT ( showDay( QDate ) ) ); | 458 | mMainView, SLOT ( showDay( QDate ) ) ); |
459 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 459 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
460 | connect( mMonthView, SIGNAL(nextMonth() ), | ||
461 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); | ||
462 | connect( mMonthView, SIGNAL(prevMonth() ), | ||
463 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | ||
460 | mMonthView->updateConfig(); | 464 | mMonthView->updateConfig(); |
461 | } | 465 | } |
462 | 466 | ||
463 | globalFlagBlockAgenda = 1; | 467 | globalFlagBlockAgenda = 1; |
464 | //mFlagShowNextxDays = false; | 468 | //mFlagShowNextxDays = false; |
465 | // if(mMonthView == mCurrentView) return; | 469 | // if(mMonthView == mCurrentView) return; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 145b36c..950d2ec 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1733,13 +1733,13 @@ void MainWindow::setCaptionToDates() | |||
1733 | void MainWindow::showConfigureAgenda( ) | 1733 | void MainWindow::showConfigureAgenda( ) |
1734 | { | 1734 | { |
1735 | int iii; | 1735 | int iii; |
1736 | for ( iii = 1;iii<= 10 ;++iii ){ | 1736 | for ( iii = 1;iii<= 10 ;++iii ){ |
1737 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 1737 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
1738 | } | 1738 | } |
1739 | configureAgendaMenu->setItemChecked( KOPrefs::instance()->mHourSize, true ); | 1739 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
1740 | } | 1740 | } |
1741 | void MainWindow::configureAgenda( int item ) | 1741 | void MainWindow::configureAgenda( int item ) |
1742 | { | 1742 | { |
1743 | if ( KOPrefs::instance()->mHourSize == item ) | 1743 | if ( KOPrefs::instance()->mHourSize == item ) |
1744 | return; | 1744 | return; |
1745 | KOPrefs::instance()->mHourSize=item; | 1745 | KOPrefs::instance()->mHourSize=item; |