summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt5
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/komonthview.cpp52
-rw-r--r--korganizer/komonthview.h4
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
@@ -13,4 +13,9 @@ all attendees or all selected (with RSVP) attendees.
13Made the week-month mode changing in month view faster. 13Made the week-month mode changing in month view faster.
14 14
15Made month view better useable with keyboard.
16Now TAB key jumps to next cell with an event/todo.
17Scroll in cell with coursor keys, scroll in time (next week) with
18Shift/Control + coursorkeys.
19
15********** VERSION 2.0.2 ************ 20********** VERSION 2.0.2 ************
16 21
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,
59 59
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();
63 } 63 }
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)
101 switch(e->key()) { 101 switch(e->key()) {
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 {
105 e->ignore(); 105 e->ignore();
106 return; 106 return;
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 {
113 e->ignore(); 113 e->ignore();
114 return; 114 return;
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();
121 break; 121 break;
@@ -131,5 +131,5 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
131 break; 131 break;
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();
135 break; 135 break;
@@ -144,4 +144,8 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
144 } 144 }
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:
147 emit shiftDown(); 151 emit shiftDown();
@@ -153,4 +157,15 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
153} 157}
154 158
159void 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}
155void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 170void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
156{ 171{
@@ -283,4 +298,5 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
283 //mLabel->setAlignment( AlignCenter ); 298 //mLabel->setAlignment( AlignCenter );
284 mLabel->setFlat( true ); 299 mLabel->setFlat( true );
300 mLabel->setFocusPolicy(NoFocus);
285 mItemList = new KNoScrollListBox( this ); 301 mItemList = new KNoScrollListBox( this );
286 mItemList->setMinimumSize( 10, 10 ); 302 mItemList->setMinimumSize( 10, 10 );
@@ -402,6 +418,8 @@ void MonthViewCell::startUpdateCell()
402{ 418{
403 419
420 mItemList->setFocusPolicy(NoFocus);
404 if ( !mMonthView->isUpdatePossible() ) 421 if ( !mMonthView->isUpdatePossible() )
405 return; 422 return;
423
406 /* 424 /*
407 if ( !isVisible() ){ 425 if ( !isVisible() ){
@@ -434,4 +452,6 @@ void MonthViewCell::startUpdateCell()
434void MonthViewCell::insertEvent(Event *event) 452void MonthViewCell::insertEvent(Event *event)
435{ 453{
454
455 mItemList->setFocusPolicy(WheelFocus);
436 if ( !(event->doesRecur() == Recurrence::rNone) ) { 456 if ( !(event->doesRecur() == Recurrence::rNone) ) {
437 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 457 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
@@ -539,5 +559,5 @@ void MonthViewCell::insertTodo(Todo *todo)
539 } 559 }
540 } 560 }
541 text += i18n("To-Do: %1").arg(todo->summary()); 561 text += i18n("Td: %1").arg(todo->summary());
542 562
543 MonthViewItem *item = new MonthViewItem( todo, mDate, text ); 563 MonthViewItem *item = new MonthViewItem( todo, mDate, text );
@@ -827,4 +847,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
827 for( i = 0; i < mNumWeeks+1; i++ ) { 847 for( i = 0; i < mNumWeeks+1; i++ ) {
828 KOWeekButton *label = new KOWeekButton( mMonthView ); 848 KOWeekButton *label = new KOWeekButton( mMonthView );
849 label->setFocusPolicy(NoFocus);
829 label->setFont(bfont); 850 label->setFont(bfont);
830 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 851 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
@@ -841,4 +862,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
841 for( i = 0; i < 1+1; i++ ) { 862 for( i = 0; i < 1+1; i++ ) {
842 KOWeekButton *label = new KOWeekButton( mWeekView ); 863 KOWeekButton *label = new KOWeekButton( mWeekView );
864 label->setFocusPolicy(NoFocus);
843 label->setFont(bfont); 865 label->setFont(bfont);
844 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); 866 connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
@@ -904,8 +926,5 @@ KOMonthView::~KOMonthView()
904 delete mContextMenu; 926 delete mContextMenu;
905} 927}
906void KOMonthView::selectDateWeekNum ( int )
907{
908 928
909}
910void KOMonthView::selectInternalWeekNum ( int n ) 929void KOMonthView::selectInternalWeekNum ( int n )
911{ 930{
@@ -914,4 +933,10 @@ void KOMonthView::selectInternalWeekNum ( int n )
914} 933}
915 934
935int KOMonthView::currentWeek()
936{
937 if ( mShowWeekView )
938 return mWeekLabelsW[0]->getWeekNum();
939 return mWeekLabels[0]->getWeekNum();
940}
916void KOMonthView::switchView() 941void KOMonthView::switchView()
917{ 942{
@@ -1540,4 +1565,11 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
1540 e->accept(); 1565 e->accept();
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:
1543 e->ignore(); 1575 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
55 } 55 }
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:
58 void selectWeekNum ( int ); 59 void selectWeekNum ( int );
@@ -77,4 +78,5 @@ class KNoScrollListBox: public QListBox
77 78
78 protected slots: 79 protected slots:
80 void oneDown();
79 void keyPressEvent(QKeyEvent *); 81 void keyPressEvent(QKeyEvent *);
80 void keyReleaseEvent(QKeyEvent *); 82 void keyReleaseEvent(QKeyEvent *);
@@ -242,5 +244,4 @@ class KOMonthView: public KOEventView
242 244
243 protected slots: 245 protected slots:
244 void selectDateWeekNum ( int );
245 void selectInternalWeekNum ( int ); 246 void selectInternalWeekNum ( int );
246 void switchView(); 247 void switchView();
@@ -258,4 +259,5 @@ class KOMonthView: public KOEventView
258 259
259 private: 260 private:
261 int currentWeek();
260 bool clPending; 262 bool clPending;
261 QWidgetStack * mWidStack; 263 QWidgetStack * mWidStack;