summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp16
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
@@ -389,32 +389,36 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
}
}
}
#endif
}
void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
{
if ( !e->isAutoRepeat() ) {
mFlagKeyPressed = false;
}
}
void KOTodoListView::keyPressEvent ( QKeyEvent * e )
{
qApp->processEvents();
+ if ( !isVisible() ) {
+ e->ignore();
+ return;
+ }
if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
e->ignore();
// qDebug(" ignore %d",e->isAutoRepeat() );
return;
}
if (! e->isAutoRepeat() )
mFlagKeyPressed = true;
QListViewItem* cn;
if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
cn = currentItem();
if ( cn ) {
KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
if ( ci ){
if ( e->state() == ShiftButton )
ci->setOn( false );
else
@@ -1586,40 +1590,50 @@ void KOTodoView::addQuickTodoPar( Todo * parentTodo)
todo->setCategories(cf->categoryList());
}
if ( cf->isEnabled() )
todo->setSecrecy( cf->getSecrecy());
}
}
mCalendar->addTodo(todo);
mQuickAdd->setText("");
todoModified (todo, KOGlobals::EVENTADDED );
updateView();
}
void KOTodoView::keyPressEvent ( QKeyEvent * e )
{
// e->ignore();
//return;
- //qDebug("KOTodoView::keyPressEvent ");
+ //qDebug("KOTodoView::keyPressEvent ");
+ if ( !isVisible() ) {
+ e->ignore();
+ return;
+ }
switch ( e->key() ) {
case Qt::Key_Down:
case Qt::Key_Up:
QWidget::keyPressEvent ( e );
break;
case Qt::Key_Q:
+
+
+ if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) {
+ e->ignore();
+ break;
+ }
toggleQuickTodo();
break;
case Qt::Key_U:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
unparentTodo();
e->accept();
} else
e->ignore();
break;
case Qt::Key_S:
if ( e->state() == Qt::ControlButton ) {
e->ignore();
break;
}
if ( e->state() == Qt::ShiftButton ) {