-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 52 | ||||
-rw-r--r-- | korganizer/komonthview.h | 4 |
4 files changed, 51 insertions, 12 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 3ba0841..7214035 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -11,8 +11,13 @@ Added to the event/todo viewer the option to send an email to all attendees or all selected (with RSVP) attendees. Made the week-month mode changing in month view faster. +Made month view better useable with keyboard. +Now TAB key jumps to next cell with an event/todo. +Scroll in cell with coursor keys, scroll in time (next week) with +Shift/Control + coursorkeys. + ********** VERSION 2.0.2 ************ KO/Pi: Fixed the layout problem of the day label buttons diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index f31e50a..c08f44f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -57,9 +57,9 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar, QGridLayout *topLayout = new QGridLayout(this,8,8); if (! startDate.isValid()) { - kdDebug() << "KDateNavigator::KDateNavigator(): an invalid date was passed as a parameter!" << endl; + qDebug("KDateNavigator::invalid startdate "); startDate = QDate::currentDate(); } mSelectedDates.append(startDate); diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index dfa89e2..df5e060 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -99,25 +99,25 @@ 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; } setCurrentItem((currentItem()+count()-1)%count()); @@ -129,9 +129,9 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } break; case Key_Down: - if(count() < 2) { + if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; } setCurrentItem((currentItem()+1)%count()); @@ -142,8 +142,12 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) setTopItem(topItem()+1); } } break; + case Key_I: + QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); + e->ignore(); + break; case Key_Shift: emit shiftDown(); break; default: @@ -151,8 +155,19 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) break; } } +void KNoScrollListBox::oneDown() +{ + setCurrentItem((currentItem()+1)%count()); + if(!itemVisible(currentItem())) { + if(currentItem() == 0) { + setTopItem(0); + } else { + setTopItem(topItem()+1); + } + } +} void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) { switch(e->key()) { case Key_Shift: @@ -281,8 +296,9 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); //mLabel->setLineWidth( 1 ); //mLabel->setAlignment( AlignCenter ); mLabel->setFlat( true ); + mLabel->setFocusPolicy(NoFocus); mItemList = new KNoScrollListBox( this ); mItemList->setMinimumSize( 10, 10 ); mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); mItemList->setLineWidth( 1 ); @@ -400,10 +416,12 @@ void MonthViewCell::clear() void MonthViewCell::startUpdateCell() { + mItemList->setFocusPolicy(NoFocus); if ( !mMonthView->isUpdatePossible() ) return; + /* if ( !isVisible() ){ return; } @@ -432,8 +450,10 @@ void MonthViewCell::startUpdateCell() } void MonthViewCell::insertEvent(Event *event) { + + mItemList->setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return; else @@ -537,9 +557,9 @@ void MonthViewCell::insertTodo(Todo *todo) text += KGlobal::locale()->formatTime(todo->dtDue().time()); text += " "; } } - text += i18n("To-Do: %1").arg(todo->summary()); + text += i18n("Td: %1").arg(todo->summary()); MonthViewItem *item = new MonthViewItem( todo, mDate, text ); //item->setPalette( mStandardPalette ); QPalette pal; @@ -825,8 +845,9 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWeekLabels.resize( mNumWeeks+1 ); mWeekLabelsW.resize( 2 ); 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 )) ); label->setFlat(true); QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); @@ -839,8 +860,9 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); 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 )) ); label->setFlat(true); QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); @@ -902,18 +924,21 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) KOMonthView::~KOMonthView() { delete mContextMenu; } -void KOMonthView::selectDateWeekNum ( int ) -{ -} void KOMonthView::selectInternalWeekNum ( int n ) { switchView(); emit selectWeekNum ( n ); } +int KOMonthView::currentWeek() +{ + if ( mShowWeekView ) + return mWeekLabelsW[0]->getWeekNum(); + return mWeekLabels[0]->getWeekNum(); +} void KOMonthView::switchView() { if ( selectedCell( ) ) @@ -1538,8 +1563,15 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } e->accept(); break; + case Key_Return: + case Key_Enter: + { + selectInternalWeekNum ( currentWeek() ); + } + e->accept(); + break; default: e->ignore(); break; } diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 700f098..51eb9e6 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -53,8 +53,9 @@ class KOWeekButton : public QPushButton SLOT( bottonClicked() )); mNumber = -1; } void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} + int getWeekNum() { return mNumber;} signals: void selectWeekNum ( int ); private: int mNumber; @@ -75,8 +76,9 @@ class KNoScrollListBox: public QListBox void shiftUp(); void rightClick(); protected slots: + void oneDown(); void keyPressEvent(QKeyEvent *); void keyReleaseEvent(QKeyEvent *); void mousePressEvent(QMouseEvent *); @@ -240,9 +242,8 @@ class KOMonthView: public KOEventView void setSelectedCell( MonthViewCell * ); protected slots: - void selectDateWeekNum ( int ); void selectInternalWeekNum ( int ); void switchView(); void processSelectionChange(); signals: @@ -256,8 +257,9 @@ class KOMonthView: public KOEventView void viewChanged(); void updateDayLabels(); private: + int currentWeek(); bool clPending; QWidgetStack * mWidStack; QWidget* mMonthView; QWidget* mWeekView; |