-rw-r--r-- | korganizer/kotodoview.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 2c017e1..c2ad886 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -397,16 +397,20 @@ void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) | |||
397 | mFlagKeyPressed = false; | 397 | mFlagKeyPressed = false; |
398 | } | 398 | } |
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | 402 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) |
403 | { | 403 | { |
404 | qApp->processEvents(); | 404 | qApp->processEvents(); |
405 | if ( !isVisible() ) { | ||
406 | e->ignore(); | ||
407 | return; | ||
408 | } | ||
405 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 409 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
406 | e->ignore(); | 410 | e->ignore(); |
407 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 411 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
408 | return; | 412 | return; |
409 | } | 413 | } |
410 | if (! e->isAutoRepeat() ) | 414 | if (! e->isAutoRepeat() ) |
411 | mFlagKeyPressed = true; | 415 | mFlagKeyPressed = true; |
412 | QListViewItem* cn; | 416 | QListViewItem* cn; |
@@ -1594,24 +1598,34 @@ void KOTodoView::addQuickTodoPar( Todo * parentTodo) | |||
1594 | todoModified (todo, KOGlobals::EVENTADDED ); | 1598 | todoModified (todo, KOGlobals::EVENTADDED ); |
1595 | updateView(); | 1599 | updateView(); |
1596 | 1600 | ||
1597 | } | 1601 | } |
1598 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1602 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1599 | { | 1603 | { |
1600 | // e->ignore(); | 1604 | // e->ignore(); |
1601 | //return; | 1605 | //return; |
1602 | //qDebug("KOTodoView::keyPressEvent "); | 1606 | //qDebug("KOTodoView::keyPressEvent "); |
1607 | if ( !isVisible() ) { | ||
1608 | e->ignore(); | ||
1609 | return; | ||
1610 | } | ||
1603 | switch ( e->key() ) { | 1611 | switch ( e->key() ) { |
1604 | case Qt::Key_Down: | 1612 | case Qt::Key_Down: |
1605 | case Qt::Key_Up: | 1613 | case Qt::Key_Up: |
1606 | QWidget::keyPressEvent ( e ); | 1614 | QWidget::keyPressEvent ( e ); |
1607 | break; | 1615 | break; |
1608 | 1616 | ||
1609 | case Qt::Key_Q: | 1617 | case Qt::Key_Q: |
1618 | |||
1619 | |||
1620 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) { | ||
1621 | e->ignore(); | ||
1622 | break; | ||
1623 | } | ||
1610 | toggleQuickTodo(); | 1624 | toggleQuickTodo(); |
1611 | break; | 1625 | break; |
1612 | case Qt::Key_U: | 1626 | case Qt::Key_U: |
1613 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1627 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1614 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1628 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1615 | unparentTodo(); | 1629 | unparentTodo(); |
1616 | e->accept(); | 1630 | e->accept(); |
1617 | } else | 1631 | } else |