summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Unidiff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2c017e1..c2ad886 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -381,48 +381,52 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
381 } else 381 } else
382 qDebug("Dnd: Internal move "); 382 qDebug("Dnd: Internal move ");
383 383
384 } else { 384 } else {
385 if ( !internalDrop ) { 385 if ( !internalDrop ) {
386 qDebug("Dnd: External Copy"); 386 qDebug("Dnd: External Copy");
387 } else 387 } else
388 qDebug("DnD: Internal copy: Copy pending"); 388 qDebug("DnD: Internal copy: Copy pending");
389 } 389 }
390 } 390 }
391 } 391 }
392#endif 392#endif
393} 393}
394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) 394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
395{ 395{
396 if ( !e->isAutoRepeat() ) { 396 if ( !e->isAutoRepeat() ) {
397 mFlagKeyPressed = false; 397 mFlagKeyPressed = false;
398 } 398 }
399} 399}
400 400
401 401
402void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 402void 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;
413 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 417 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
414 cn = currentItem(); 418 cn = currentItem();
415 if ( cn ) { 419 if ( cn ) {
416 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
417 if ( ci ){ 421 if ( ci ){
418 if ( e->state() == ShiftButton ) 422 if ( e->state() == ShiftButton )
419 ci->setOn( false ); 423 ci->setOn( false );
420 else 424 else
421 ci->setOn( true ); 425 ci->setOn( true );
422 cn = cn->itemBelow(); 426 cn = cn->itemBelow();
423 if ( cn ) { 427 if ( cn ) {
424 setCurrentItem ( cn ); 428 setCurrentItem ( cn );
425 ensureItemVisible ( cn ); 429 ensureItemVisible ( cn );
426 } 430 }
427 431
428 } 432 }
@@ -1579,55 +1583,65 @@ void KOTodoView::addQuickTodoPar( Todo * parentTodo)
1579 if ( parentTodo->priority() < 3 ) 1583 if ( parentTodo->priority() < 3 )
1580 todo->setPriority( parentTodo->priority() ); 1584 todo->setPriority( parentTodo->priority() );
1581 todo->setCalID( parentTodo->calID() ); 1585 todo->setCalID( parentTodo->calID() );
1582 } else { 1586 } else {
1583 CalFilter * cf = mCalendar->filter(); 1587 CalFilter * cf = mCalendar->filter();
1584 if ( cf ) { 1588 if ( cf ) {
1585 if ( cf->isEnabled()&& cf->showCategories()) { 1589 if ( cf->isEnabled()&& cf->showCategories()) {
1586 todo->setCategories(cf->categoryList()); 1590 todo->setCategories(cf->categoryList());
1587 } 1591 }
1588 if ( cf->isEnabled() ) 1592 if ( cf->isEnabled() )
1589 todo->setSecrecy( cf->getSecrecy()); 1593 todo->setSecrecy( cf->getSecrecy());
1590 } 1594 }
1591 } 1595 }
1592 mCalendar->addTodo(todo); 1596 mCalendar->addTodo(todo);
1593 mQuickAdd->setText(""); 1597 mQuickAdd->setText("");
1594 todoModified (todo, KOGlobals::EVENTADDED ); 1598 todoModified (todo, KOGlobals::EVENTADDED );
1595 updateView(); 1599 updateView();
1596 1600
1597} 1601}
1598void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1602void 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
1618 e->ignore(); 1632 e->ignore();
1619 break; 1633 break;
1620 case Qt::Key_S: 1634 case Qt::Key_S:
1621 if ( e->state() == Qt::ControlButton ) { 1635 if ( e->state() == Qt::ControlButton ) {
1622 e->ignore(); 1636 e->ignore();
1623 break; 1637 break;
1624 } 1638 }
1625 if ( e->state() == Qt::ShiftButton ) { 1639 if ( e->state() == Qt::ShiftButton ) {
1626 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1640 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1627 reparentTodo(); 1641 reparentTodo();
1628 e->accept(); 1642 e->accept();
1629 } else 1643 } else
1630 e->ignore(); 1644 e->ignore();
1631 break; 1645 break;
1632 case Qt::Key_P: 1646 case Qt::Key_P:
1633 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1647 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {