-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 @@ -59,5 +59,5 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar, if (! startDate.isValid()) { - kdDebug() << "KDateNavigator::KDateNavigator(): an invalid date was passed as a parameter!" << endl; + qDebug("KDateNavigator::invalid startdate "); 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 @@ -101,21 +101,21 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) switch(e->key()) { case Key_Right: - // if ( e->state() == Qt::ControlButton ) + if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); return; } - scrollBy(4,0); + scrollBy(10,0); break; case Key_Left: - // if ( e->state() == Qt::ControlButton ) + if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); return; } - scrollBy(-4,0); + scrollBy(-10,0); break; case Key_Up: - if(count() < 2) { + if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; @@ -131,5 +131,5 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) break; case Key_Down: - if(count() < 2) { + if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; @@ -144,4 +144,8 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } break; + case Key_I: + QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); + e->ignore(); + break; case Key_Shift: emit shiftDown(); @@ -153,4 +157,15 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } +void KNoScrollListBox::oneDown() +{ + setCurrentItem((currentItem()+1)%count()); + if(!itemVisible(currentItem())) { + if(currentItem() == 0) { + setTopItem(0); + } else { + setTopItem(topItem()+1); + } + } +} void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) { @@ -283,4 +298,5 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) //mLabel->setAlignment( AlignCenter ); mLabel->setFlat( true ); + mLabel->setFocusPolicy(NoFocus); mItemList = new KNoScrollListBox( this ); mItemList->setMinimumSize( 10, 10 ); @@ -402,6 +418,8 @@ void MonthViewCell::startUpdateCell() { + mItemList->setFocusPolicy(NoFocus); if ( !mMonthView->isUpdatePossible() ) return; + /* if ( !isVisible() ){ @@ -434,4 +452,6 @@ void MonthViewCell::startUpdateCell() void MonthViewCell::insertEvent(Event *event) { + + mItemList->setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) @@ -539,5 +559,5 @@ void MonthViewCell::insertTodo(Todo *todo) } } - text += i18n("To-Do: %1").arg(todo->summary()); + text += i18n("Td: %1").arg(todo->summary()); MonthViewItem *item = new MonthViewItem( todo, mDate, text ); @@ -827,4 +847,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) for( i = 0; i < mNumWeeks+1; i++ ) { KOWeekButton *label = new KOWeekButton( mMonthView ); + label->setFocusPolicy(NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); @@ -841,4 +862,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) for( i = 0; i < 1+1; i++ ) { KOWeekButton *label = new KOWeekButton( mWeekView ); + label->setFocusPolicy(NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); @@ -904,8 +926,5 @@ KOMonthView::~KOMonthView() delete mContextMenu; } -void KOMonthView::selectDateWeekNum ( int ) -{ -} void KOMonthView::selectInternalWeekNum ( int n ) { @@ -914,4 +933,10 @@ void KOMonthView::selectInternalWeekNum ( int n ) } +int KOMonthView::currentWeek() +{ + if ( mShowWeekView ) + return mWeekLabelsW[0]->getWeekNum(); + return mWeekLabels[0]->getWeekNum(); +} void KOMonthView::switchView() { @@ -1540,4 +1565,11 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) e->accept(); break; + case Key_Return: + case Key_Enter: + { + selectInternalWeekNum ( currentWeek() ); + } + e->accept(); + break; default: e->ignore(); diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 700f098..51eb9e6 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -55,4 +55,5 @@ class KOWeekButton : public QPushButton } void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} + int getWeekNum() { return mNumber;} signals: void selectWeekNum ( int ); @@ -77,4 +78,5 @@ class KNoScrollListBox: public QListBox protected slots: + void oneDown(); void keyPressEvent(QKeyEvent *); void keyReleaseEvent(QKeyEvent *); @@ -242,5 +244,4 @@ class KOMonthView: public KOEventView protected slots: - void selectDateWeekNum ( int ); void selectInternalWeekNum ( int ); void switchView(); @@ -258,4 +259,5 @@ class KOMonthView: public KOEventView private: + int currentWeek(); bool clPending; QWidgetStack * mWidStack; |