-rw-r--r-- | korganizer/kdatenavigator.cpp | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 52 | ||||
-rw-r--r-- | korganizer/komonthview.h | 4 |
3 files changed, 46 insertions, 12 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index f31e50a..c08f44f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -60,3 +60,3 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar, | |||
60 | if (! startDate.isValid()) { | 60 | if (! startDate.isValid()) { |
61 | kdDebug() << "KDateNavigator::KDateNavigator(): an invalid date was passed as a parameter!" << endl; | 61 | qDebug("KDateNavigator::invalid startdate "); |
62 | startDate = QDate::currentDate(); | 62 | startDate = QDate::currentDate(); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index dfa89e2..df5e060 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -102,3 +102,3 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
102 | case Key_Right: | 102 | case Key_Right: |
103 | // if ( e->state() == Qt::ControlButton ) | 103 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
104 | { | 104 | { |
@@ -107,6 +107,6 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
107 | } | 107 | } |
108 | scrollBy(4,0); | 108 | scrollBy(10,0); |
109 | break; | 109 | break; |
110 | case Key_Left: | 110 | case Key_Left: |
111 | // if ( e->state() == Qt::ControlButton ) | 111 | if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
112 | { | 112 | { |
@@ -115,6 +115,6 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
115 | } | 115 | } |
116 | scrollBy(-4,0); | 116 | scrollBy(-10,0); |
117 | break; | 117 | break; |
118 | case Key_Up: | 118 | case Key_Up: |
119 | if(count() < 2) { | 119 | if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { |
120 | e->ignore(); | 120 | e->ignore(); |
@@ -132,3 +132,3 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
132 | case Key_Down: | 132 | case Key_Down: |
133 | if(count() < 2) { | 133 | if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { |
134 | e->ignore(); | 134 | e->ignore(); |
@@ -145,2 +145,6 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
145 | break; | 145 | break; |
146 | case Key_I: | ||
147 | QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); | ||
148 | e->ignore(); | ||
149 | break; | ||
146 | case Key_Shift: | 150 | case Key_Shift: |
@@ -154,2 +158,13 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
154 | 158 | ||
159 | void KNoScrollListBox::oneDown() | ||
160 | { | ||
161 | setCurrentItem((currentItem()+1)%count()); | ||
162 | if(!itemVisible(currentItem())) { | ||
163 | if(currentItem() == 0) { | ||
164 | setTopItem(0); | ||
165 | } else { | ||
166 | setTopItem(topItem()+1); | ||
167 | } | ||
168 | } | ||
169 | } | ||
155 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) | 170 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) |
@@ -284,2 +299,3 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | |||
284 | mLabel->setFlat( true ); | 299 | mLabel->setFlat( true ); |
300 | mLabel->setFocusPolicy(NoFocus); | ||
285 | mItemList = new KNoScrollListBox( this ); | 301 | mItemList = new KNoScrollListBox( this ); |
@@ -403,4 +419,6 @@ void MonthViewCell::startUpdateCell() | |||
403 | 419 | ||
420 | mItemList->setFocusPolicy(NoFocus); | ||
404 | if ( !mMonthView->isUpdatePossible() ) | 421 | if ( !mMonthView->isUpdatePossible() ) |
405 | return; | 422 | return; |
423 | |||
406 | /* | 424 | /* |
@@ -435,2 +453,4 @@ void MonthViewCell::insertEvent(Event *event) | |||
435 | { | 453 | { |
454 | |||
455 | mItemList->setFocusPolicy(WheelFocus); | ||
436 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 456 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
@@ -540,3 +560,3 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
540 | } | 560 | } |
541 | text += i18n("To-Do: %1").arg(todo->summary()); | 561 | text += i18n("Td: %1").arg(todo->summary()); |
542 | 562 | ||
@@ -828,2 +848,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
828 | KOWeekButton *label = new KOWeekButton( mMonthView ); | 848 | KOWeekButton *label = new KOWeekButton( mMonthView ); |
849 | label->setFocusPolicy(NoFocus); | ||
829 | label->setFont(bfont); | 850 | label->setFont(bfont); |
@@ -842,2 +863,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
842 | KOWeekButton *label = new KOWeekButton( mWeekView ); | 863 | KOWeekButton *label = new KOWeekButton( mWeekView ); |
864 | label->setFocusPolicy(NoFocus); | ||
843 | label->setFont(bfont); | 865 | label->setFont(bfont); |
@@ -905,6 +927,3 @@ KOMonthView::~KOMonthView() | |||
905 | } | 927 | } |
906 | void KOMonthView::selectDateWeekNum ( int ) | ||
907 | { | ||
908 | 928 | ||
909 | } | ||
910 | void KOMonthView::selectInternalWeekNum ( int n ) | 929 | void KOMonthView::selectInternalWeekNum ( int n ) |
@@ -915,2 +934,8 @@ void KOMonthView::selectInternalWeekNum ( int n ) | |||
915 | 934 | ||
935 | int KOMonthView::currentWeek() | ||
936 | { | ||
937 | if ( mShowWeekView ) | ||
938 | return mWeekLabelsW[0]->getWeekNum(); | ||
939 | return mWeekLabels[0]->getWeekNum(); | ||
940 | } | ||
916 | void KOMonthView::switchView() | 941 | void KOMonthView::switchView() |
@@ -1541,2 +1566,9 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) | |||
1541 | break; | 1566 | break; |
1567 | case Key_Return: | ||
1568 | case Key_Enter: | ||
1569 | { | ||
1570 | selectInternalWeekNum ( currentWeek() ); | ||
1571 | } | ||
1572 | e->accept(); | ||
1573 | break; | ||
1542 | default: | 1574 | default: |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 700f098..51eb9e6 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -56,2 +56,3 @@ class KOWeekButton : public QPushButton | |||
56 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} | 56 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} |
57 | int getWeekNum() { return mNumber;} | ||
57 | signals: | 58 | signals: |
@@ -78,2 +79,3 @@ class KNoScrollListBox: public QListBox | |||
78 | protected slots: | 79 | protected slots: |
80 | void oneDown(); | ||
79 | void keyPressEvent(QKeyEvent *); | 81 | void keyPressEvent(QKeyEvent *); |
@@ -243,3 +245,2 @@ class KOMonthView: public KOEventView | |||
243 | protected slots: | 245 | protected slots: |
244 | void selectDateWeekNum ( int ); | ||
245 | void selectInternalWeekNum ( int ); | 246 | void selectInternalWeekNum ( int ); |
@@ -259,2 +260,3 @@ class KOMonthView: public KOEventView | |||
259 | private: | 260 | private: |
261 | int currentWeek(); | ||
260 | bool clPending; | 262 | bool clPending; |