-rw-r--r-- | korganizer/kotodoview.cpp | 78 |
1 files changed, 70 insertions, 8 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index a87e6fc..c23a8ee 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -483,52 +483,86 @@ void KOQuickTodo::focusInEvent(QFocusEvent *ev) | |||
483 | { | 483 | { |
484 | if ( text()==i18n("Click to add a new Todo") ) | 484 | if ( text()==i18n("Click to add a new Todo") ) |
485 | setText(""); | 485 | setText(""); |
486 | QLineEdit::focusInEvent(ev); | 486 | QLineEdit::focusInEvent(ev); |
487 | } | 487 | } |
488 | 488 | ||
489 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | 489 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) |
490 | { | 490 | { |
491 | setText(i18n("Click to add a new Todo")); | 491 | setText(i18n("Click to add a new Todo")); |
492 | QLineEdit::focusOutEvent(ev); | 492 | QLineEdit::focusOutEvent(ev); |
493 | } | 493 | } |
494 | 494 | ||
495 | ///////////////////////////////////////////////////////////////////////////// | 495 | ///////////////////////////////////////////////////////////////////////////// |
496 | 496 | ||
497 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 497 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
498 | KOrg::BaseView(calendar,parent,name) | 498 | KOrg::BaseView(calendar,parent,name) |
499 | { | 499 | { |
500 | mCategoryPopupMenu = 0; | 500 | mCategoryPopupMenu = 0; |
501 | mPendingUpdateBeforeRepaint = false; | 501 | mPendingUpdateBeforeRepaint = false; |
502 | isFlatDisplay = false; | 502 | isFlatDisplay = false; |
503 | mNavigator = 0; | 503 | mNavigator = 0; |
504 | QBoxLayout *topLayout = new QVBoxLayout(this); | 504 | QBoxLayout *topLayout = new QVBoxLayout(this); |
505 | mName = QString ( name ); | 505 | mName = QString ( name ); |
506 | mBlockUpdate = false; | 506 | mBlockUpdate = false; |
507 | mQuickAdd = new KOQuickTodo(this); | 507 | mQuickBar = new QWidget( this ); |
508 | topLayout->addWidget(mQuickAdd); | 508 | topLayout->addWidget(mQuickBar); |
509 | 509 | ||
510 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); | 510 | mQuickAdd = new KOQuickTodo(mQuickBar); |
511 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); | ||
512 | quickLayout->addWidget( mQuickAdd ); | ||
513 | QPushButton * flat = new QPushButton( "F",mQuickBar ); | ||
514 | int fixwid = flat->sizeHint().height(); | ||
515 | if ( QApplication::desktop()->width() > 320 ) | ||
516 | fixwid *= 2; | ||
517 | flat->setFixedWidth( fixwid ); | ||
518 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); | ||
519 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | ||
520 | allopen->setFixedWidth( fixwid ); | ||
521 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); | ||
522 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | ||
523 | allclose->setFixedWidth( fixwid ); | ||
524 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); | ||
525 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | ||
526 | s_done->setFixedWidth( fixwid ); | ||
527 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); | ||
528 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | ||
529 | s_run->setFixedWidth( fixwid ); | ||
530 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); | ||
531 | |||
532 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | ||
533 | mNewSubBut->setFixedWidth( fixwid*3/2 ); | ||
534 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); | ||
535 | mNewSubBut->setEnabled( false ); | ||
536 | quickLayout->addWidget( mNewSubBut ); | ||
537 | quickLayout->addWidget( s_done ); | ||
538 | quickLayout->addWidget( s_run ); | ||
539 | |||
540 | quickLayout->addWidget( allopen ); | ||
541 | quickLayout->addWidget( allclose ); | ||
542 | quickLayout->addWidget( flat ); | ||
543 | |||
544 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); | ||
511 | 545 | ||
512 | mTodoListView = new KOTodoListView(calendar,this, name ); | 546 | mTodoListView = new KOTodoListView(calendar,this, name ); |
513 | topLayout->addWidget(mTodoListView); | 547 | topLayout->addWidget(mTodoListView); |
514 | //mTodoListView->header()->setMaximumHeight(30); | 548 | //mTodoListView->header()->setMaximumHeight(30); |
515 | mTodoListView->setRootIsDecorated(true); | 549 | mTodoListView->setRootIsDecorated(true); |
516 | mTodoListView->setAllColumnsShowFocus(true); | 550 | mTodoListView->setAllColumnsShowFocus(true); |
517 | 551 | ||
518 | mTodoListView->setShowSortIndicator(true); | 552 | mTodoListView->setShowSortIndicator(true); |
519 | 553 | ||
520 | mTodoListView->addColumn(i18n("Todo")); | 554 | mTodoListView->addColumn(i18n("Todo")); |
521 | mTodoListView->addColumn(i18n("Prio")); | 555 | mTodoListView->addColumn(i18n("Prio")); |
522 | mTodoListView->setColumnAlignment(1,AlignHCenter); | 556 | mTodoListView->setColumnAlignment(1,AlignHCenter); |
523 | mTodoListView->addColumn(i18n("Complete")); | 557 | mTodoListView->addColumn(i18n("Complete")); |
524 | mTodoListView->setColumnAlignment(2,AlignCenter); | 558 | mTodoListView->setColumnAlignment(2,AlignCenter); |
525 | 559 | ||
526 | mTodoListView->addColumn(i18n("Due Date")); | 560 | mTodoListView->addColumn(i18n("Due Date")); |
527 | mTodoListView->setColumnAlignment(3,AlignLeft); | 561 | mTodoListView->setColumnAlignment(3,AlignLeft); |
528 | mTodoListView->addColumn(i18n("Due Time")); | 562 | mTodoListView->addColumn(i18n("Due Time")); |
529 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 563 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
530 | 564 | ||
531 | mTodoListView->addColumn(i18n("Start Date")); | 565 | mTodoListView->addColumn(i18n("Start Date")); |
532 | mTodoListView->setColumnAlignment(5,AlignLeft); | 566 | mTodoListView->setColumnAlignment(5,AlignLeft); |
533 | mTodoListView->addColumn(i18n("Start Time")); | 567 | mTodoListView->addColumn(i18n("Start Time")); |
534 | mTodoListView->setColumnAlignment(6,AlignHCenter); | 568 | mTodoListView->setColumnAlignment(6,AlignHCenter); |
@@ -1061,49 +1095,53 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) | |||
1061 | switch (column){ | 1095 | switch (column){ |
1062 | case 1: | 1096 | case 1: |
1063 | mPriorityPopupMenu->popup(QCursor::pos ()); break; | 1097 | mPriorityPopupMenu->popup(QCursor::pos ()); break; |
1064 | case 2: | 1098 | case 2: |
1065 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; | 1099 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; |
1066 | case 3: | 1100 | case 3: |
1067 | moveTodo(); | 1101 | moveTodo(); |
1068 | break; | 1102 | break; |
1069 | case 8: | 1103 | case 8: |
1070 | mCategoryPopupMenu->popup(QCursor::pos ()); break; | 1104 | mCategoryPopupMenu->popup(QCursor::pos ()); break; |
1071 | case 9: | 1105 | case 9: |
1072 | mCalPopupMenu->popup(QCursor::pos ()); break; | 1106 | mCalPopupMenu->popup(QCursor::pos ()); break; |
1073 | default: | 1107 | default: |
1074 | mItemPopupMenu->popup(QCursor::pos()); | 1108 | mItemPopupMenu->popup(QCursor::pos()); |
1075 | } | 1109 | } |
1076 | } else mPopupMenu->popup(QCursor::pos()); | 1110 | } else mPopupMenu->popup(QCursor::pos()); |
1077 | } | 1111 | } |
1078 | void KOTodoView::newTodo() | 1112 | void KOTodoView::newTodo() |
1079 | { | 1113 | { |
1080 | emit newTodoSignal(); | 1114 | emit newTodoSignal(); |
1081 | } | 1115 | } |
1082 | 1116 | ||
1083 | void KOTodoView::newSubTodo() | 1117 | void KOTodoView::newSubTodo() |
1084 | { | 1118 | { |
1119 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | ||
1085 | if (mActiveItem) { | 1120 | if (mActiveItem) { |
1121 | if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add a new Todo") ) { | ||
1122 | addQuickTodoPar( mActiveItem->todo()); | ||
1123 | } else | ||
1086 | emit newSubTodoSignal(mActiveItem->todo()); | 1124 | emit newSubTodoSignal(mActiveItem->todo()); |
1087 | } | 1125 | } |
1088 | } | 1126 | } |
1089 | void KOTodoView::unparentTodo() | 1127 | void KOTodoView::unparentTodo() |
1090 | { | 1128 | { |
1091 | if (mActiveItem) { | 1129 | if (mActiveItem) { |
1092 | emit unparentTodoSignal(mActiveItem->todo()); | 1130 | emit unparentTodoSignal(mActiveItem->todo()); |
1093 | } | 1131 | } |
1094 | } | 1132 | } |
1095 | 1133 | ||
1096 | void KOTodoView::reparentTodo() | 1134 | void KOTodoView::reparentTodo() |
1097 | { | 1135 | { |
1098 | if (mActiveItem) { | 1136 | if (mActiveItem) { |
1099 | topLevelWidget()->setCaption(i18n("Click on new parent item")); | 1137 | topLevelWidget()->setCaption(i18n("Click on new parent item")); |
1100 | pendingSubtodo = mActiveItem; | 1138 | pendingSubtodo = mActiveItem; |
1101 | } | 1139 | } |
1102 | } | 1140 | } |
1103 | void KOTodoView::editTodo() | 1141 | void KOTodoView::editTodo() |
1104 | { | 1142 | { |
1105 | if (mActiveItem) { | 1143 | if (mActiveItem) { |
1106 | emit editTodoSignal(mActiveItem->todo()); | 1144 | emit editTodoSignal(mActiveItem->todo()); |
1107 | } | 1145 | } |
1108 | } | 1146 | } |
1109 | void KOTodoView::cloneTodo() | 1147 | void KOTodoView::cloneTodo() |
@@ -1370,50 +1408,52 @@ void KOTodoView::itemStateChanged( QListViewItem *item ) | |||
1370 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 1408 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
1371 | 1409 | ||
1372 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 1410 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
1373 | } | 1411 | } |
1374 | 1412 | ||
1375 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 1413 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
1376 | { | 1414 | { |
1377 | mTodoListView->saveLayout(config,group); | 1415 | mTodoListView->saveLayout(config,group); |
1378 | } | 1416 | } |
1379 | 1417 | ||
1380 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 1418 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
1381 | { | 1419 | { |
1382 | mTodoListView->restoreLayout(config,group); | 1420 | mTodoListView->restoreLayout(config,group); |
1383 | } | 1421 | } |
1384 | 1422 | ||
1385 | void KOTodoView::processSelectionChange() | 1423 | void KOTodoView::processSelectionChange() |
1386 | { | 1424 | { |
1387 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 1425 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
1388 | 1426 | ||
1389 | KOTodoViewItem *item = | 1427 | KOTodoViewItem *item = |
1390 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 1428 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
1391 | 1429 | ||
1392 | if ( !item ) { | 1430 | if ( !item ) { |
1393 | emit incidenceSelected( 0 ); | 1431 | emit incidenceSelected( 0 ); |
1432 | mNewSubBut->setEnabled( false ); | ||
1394 | } else { | 1433 | } else { |
1395 | emit incidenceSelected( item->todo() ); | 1434 | emit incidenceSelected( item->todo() ); |
1435 | mNewSubBut->setEnabled( true ); | ||
1396 | } | 1436 | } |
1397 | } | 1437 | } |
1398 | 1438 | ||
1399 | void KOTodoView::modified(bool b) | 1439 | void KOTodoView::modified(bool b) |
1400 | { | 1440 | { |
1401 | emit isModified(b); | 1441 | emit isModified(b); |
1402 | } | 1442 | } |
1403 | void KOTodoView::setTodoModified( Todo* todo ) | 1443 | void KOTodoView::setTodoModified( Todo* todo ) |
1404 | { | 1444 | { |
1405 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 1445 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
1406 | } | 1446 | } |
1407 | void KOTodoView::clearSelection() | 1447 | void KOTodoView::clearSelection() |
1408 | { | 1448 | { |
1409 | mTodoListView->selectAll( false ); | 1449 | mTodoListView->selectAll( false ); |
1410 | } | 1450 | } |
1411 | void KOTodoView::setAllOpen() | 1451 | void KOTodoView::setAllOpen() |
1412 | { | 1452 | { |
1413 | if ( isFlatDisplay ) { | 1453 | if ( isFlatDisplay ) { |
1414 | isFlatDisplay = false; | 1454 | isFlatDisplay = false; |
1415 | mPopupMenu->setItemChecked( 8,false ); | 1455 | mPopupMenu->setItemChecked( 8,false ); |
1416 | updateView(); | 1456 | updateView(); |
1417 | } else { | 1457 | } else { |
1418 | storeCurrentItem(); | 1458 | storeCurrentItem(); |
1419 | } | 1459 | } |
@@ -1459,95 +1499,117 @@ void KOTodoView::displayAllFlat() | |||
1459 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1499 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
1460 | mTodoMap.insert(todo,todoItem); | 1500 | mTodoMap.insert(todo,todoItem); |
1461 | } | 1501 | } |
1462 | resetCurrentItem(); | 1502 | resetCurrentItem(); |
1463 | } | 1503 | } |
1464 | 1504 | ||
1465 | void KOTodoView::setAllFlat() | 1505 | void KOTodoView::setAllFlat() |
1466 | { | 1506 | { |
1467 | if ( isFlatDisplay ) { | 1507 | if ( isFlatDisplay ) { |
1468 | isFlatDisplay = false; | 1508 | isFlatDisplay = false; |
1469 | mPopupMenu->setItemChecked( 8,false ); | 1509 | mPopupMenu->setItemChecked( 8,false ); |
1470 | updateView(); | 1510 | updateView(); |
1471 | return; | 1511 | return; |
1472 | } | 1512 | } |
1473 | displayAllFlat(); | 1513 | displayAllFlat(); |
1474 | } | 1514 | } |
1475 | 1515 | ||
1476 | void KOTodoView::purgeCompleted() | 1516 | void KOTodoView::purgeCompleted() |
1477 | { | 1517 | { |
1478 | emit purgeCompletedSignal(); | 1518 | emit purgeCompletedSignal(); |
1479 | 1519 | ||
1480 | } | 1520 | } |
1481 | void KOTodoView::toggleQuickTodo() | 1521 | void KOTodoView::toggleQuickTodo() |
1482 | { | 1522 | { |
1483 | if ( mQuickAdd->isVisible() ) { | 1523 | if ( mQuickBar->isVisible() ) { |
1484 | mQuickAdd->hide(); | 1524 | mQuickBar->hide(); |
1485 | KOPrefs::instance()->mEnableQuickTodo = false; | 1525 | KOPrefs::instance()->mEnableQuickTodo = false; |
1486 | } | 1526 | } |
1487 | else { | 1527 | else { |
1488 | mQuickAdd->show(); | 1528 | mQuickBar->show(); |
1489 | KOPrefs::instance()->mEnableQuickTodo = true; | 1529 | KOPrefs::instance()->mEnableQuickTodo = true; |
1490 | } | 1530 | } |
1491 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1531 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1492 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1532 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1493 | } | 1533 | } |
1494 | 1534 | ||
1495 | void KOTodoView::toggleRunning() | 1535 | void KOTodoView::toggleRunning() |
1496 | { | 1536 | { |
1497 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | 1537 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; |
1498 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 1538 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
1499 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 1539 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
1500 | updateView(); | 1540 | updateView(); |
1541 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | ||
1542 | topLevelWidget()->setCaption(i18n("Hide not Running")); | ||
1543 | else | ||
1544 | topLevelWidget()->setCaption(i18n("Show not Running")); | ||
1501 | } | 1545 | } |
1502 | 1546 | ||
1503 | void KOTodoView::toggleCompleted() | 1547 | void KOTodoView::toggleCompleted() |
1504 | { | 1548 | { |
1505 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1549 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1506 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1550 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1507 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1551 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1508 | updateView(); | 1552 | updateView(); |
1553 | if ( KOPrefs::instance()->mShowCompletedTodo ) | ||
1554 | topLevelWidget()->setCaption(i18n("Show Completed")); | ||
1555 | else | ||
1556 | topLevelWidget()->setCaption(i18n("Hide Completed")); | ||
1509 | } | 1557 | } |
1510 | 1558 | ||
1511 | void KOTodoView::addQuickTodo() | 1559 | void KOTodoView::addQuickTodo() |
1512 | { | 1560 | { |
1561 | addQuickTodoPar( 0 ); | ||
1562 | } | ||
1563 | void KOTodoView::addQuickTodoPar( Todo * parentTodo) | ||
1564 | { | ||
1513 | Todo *todo = new Todo(); | 1565 | Todo *todo = new Todo(); |
1514 | todo->setSummary(mQuickAdd->text()); | 1566 | todo->setSummary(mQuickAdd->text()); |
1515 | todo->setOrganizer(KOPrefs::instance()->email()); | 1567 | todo->setOrganizer(KOPrefs::instance()->email()); |
1568 | if ( parentTodo ) { | ||
1569 | todo->setRelatedTo(parentTodo); | ||
1570 | |||
1571 | todo->setCategories (parentTodo->categoriesStr ()); | ||
1572 | todo->setSecrecy (parentTodo->secrecy ()); | ||
1573 | if ( parentTodo->priority() < 3 ) | ||
1574 | todo->setPriority( parentTodo->priority() ); | ||
1575 | todo->setCalID( parentTodo->calID() ); | ||
1576 | } else { | ||
1516 | CalFilter * cf = mCalendar->filter(); | 1577 | CalFilter * cf = mCalendar->filter(); |
1517 | if ( cf ) { | 1578 | if ( cf ) { |
1518 | if ( cf->isEnabled()&& cf->showCategories()) { | 1579 | if ( cf->isEnabled()&& cf->showCategories()) { |
1519 | todo->setCategories(cf->categoryList()); | 1580 | todo->setCategories(cf->categoryList()); |
1520 | } | 1581 | } |
1521 | if ( cf->isEnabled() ) | 1582 | if ( cf->isEnabled() ) |
1522 | todo->setSecrecy( cf->getSecrecy()); | 1583 | todo->setSecrecy( cf->getSecrecy()); |
1523 | } | 1584 | } |
1585 | } | ||
1524 | mCalendar->addTodo(todo); | 1586 | mCalendar->addTodo(todo); |
1525 | mQuickAdd->setText(""); | 1587 | mQuickAdd->setText(""); |
1526 | todoModified (todo, KOGlobals::EVENTADDED ); | 1588 | todoModified (todo, KOGlobals::EVENTADDED ); |
1527 | updateView(); | 1589 | updateView(); |
1528 | } | ||
1529 | 1590 | ||
1591 | } | ||
1530 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1592 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1531 | { | 1593 | { |
1532 | // e->ignore(); | 1594 | // e->ignore(); |
1533 | //return; | 1595 | //return; |
1534 | //qDebug("KOTodoView::keyPressEvent "); | 1596 | //qDebug("KOTodoView::keyPressEvent "); |
1535 | switch ( e->key() ) { | 1597 | switch ( e->key() ) { |
1536 | case Qt::Key_Down: | 1598 | case Qt::Key_Down: |
1537 | case Qt::Key_Up: | 1599 | case Qt::Key_Up: |
1538 | QWidget::keyPressEvent ( e ); | 1600 | QWidget::keyPressEvent ( e ); |
1539 | break; | 1601 | break; |
1540 | 1602 | ||
1541 | case Qt::Key_Q: | 1603 | case Qt::Key_Q: |
1542 | toggleQuickTodo(); | 1604 | toggleQuickTodo(); |
1543 | break; | 1605 | break; |
1544 | case Qt::Key_U: | 1606 | case Qt::Key_U: |
1545 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1607 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1546 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1608 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1547 | unparentTodo(); | 1609 | unparentTodo(); |
1548 | e->accept(); | 1610 | e->accept(); |
1549 | } else | 1611 | } else |
1550 | e->ignore(); | 1612 | e->ignore(); |
1551 | break; | 1613 | break; |
1552 | case Qt::Key_S: | 1614 | case Qt::Key_S: |
1553 | if ( e->state() == Qt::ControlButton ) { | 1615 | if ( e->state() == Qt::ControlButton ) { |