author | zautrix <zautrix> | 2005-08-05 21:59:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-05 21:59:14 (UTC) |
commit | cd215c243d0636cabbc73006652b9b6783319de1 (patch) (unidiff) | |
tree | 2b5021ac24ea77304991ebabac97cab9c8451202 | |
parent | 90585d5946407bdb8783bcb369ef7483c869995d (diff) | |
download | kdepimpi-cd215c243d0636cabbc73006652b9b6783319de1.zip kdepimpi-cd215c243d0636cabbc73006652b9b6783319de1.tar.gz kdepimpi-cd215c243d0636cabbc73006652b9b6783319de1.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/kotodoview.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 82c0f4c..00c2d97 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -369,97 +369,97 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | |||
369 | mMousePressed = false; | 369 | mMousePressed = false; |
370 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); | 370 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); |
371 | if (item) { | 371 | if (item) { |
372 | DndFactory factory( mCalendar ); | 372 | DndFactory factory( mCalendar ); |
373 | ICalDrag *vd = factory.createDrag( | 373 | ICalDrag *vd = factory.createDrag( |
374 | ((KOTodoViewItem *)item)->todo(),viewport()); | 374 | ((KOTodoViewItem *)item)->todo(),viewport()); |
375 | internalDrop = false; | 375 | internalDrop = false; |
376 | // we cannot do any senseful here, because the DnD is still broken in Qt | 376 | // we cannot do any senseful here, because the DnD is still broken in Qt |
377 | if (vd->drag()) { | 377 | if (vd->drag()) { |
378 | if ( !internalDrop ) { | 378 | if ( !internalDrop ) { |
379 | //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); | 379 | //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); |
380 | qDebug("Dnd: External move: Delete drag source "); | 380 | qDebug("Dnd: External move: Delete drag source "); |
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 | } |
394 | void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) | 394 | void 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 | ||
402 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | 402 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) |
403 | { | 403 | { |
404 | qApp->processEvents(); | 404 | qApp->processEvents(); |
405 | if ( !isVisible() ) { | 405 | if ( !isVisible() ) { |
406 | e->ignore(); | 406 | e->ignore(); |
407 | return; | 407 | return; |
408 | } | 408 | } |
409 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 409 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
410 | e->ignore(); | 410 | e->ignore(); |
411 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 411 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
412 | return; | 412 | return; |
413 | } | 413 | } |
414 | if (! e->isAutoRepeat() ) | 414 | if (! e->isAutoRepeat() ) |
415 | mFlagKeyPressed = true; | 415 | mFlagKeyPressed = true; |
416 | QListViewItem* cn; | 416 | QListViewItem* cn; |
417 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { | 417 | if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { |
418 | cn = currentItem(); | 418 | cn = currentItem(); |
419 | if ( cn ) { | 419 | if ( cn ) { |
420 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 420 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
421 | if ( ci ){ | 421 | if ( ci ){ |
422 | if ( e->state() == ShiftButton ) | 422 | if ( e->state() == ShiftButton ) |
423 | ci->setOn( false ); | 423 | ci->setOn( false ); |
424 | else | 424 | else |
425 | ci->setOn( true ); | 425 | ci->setOn( true ); |
426 | cn = cn->itemBelow(); | 426 | cn = cn->itemBelow(); |
427 | if ( cn ) { | 427 | if ( cn ) { |
428 | setCurrentItem ( cn ); | 428 | setCurrentItem ( cn ); |
429 | ensureItemVisible ( cn ); | 429 | ensureItemVisible ( cn ); |
430 | } | 430 | } |
431 | 431 | ||
432 | } | 432 | } |
433 | } | 433 | } |
434 | 434 | ||
435 | e->accept(); | 435 | e->accept(); |
436 | return; | 436 | return; |
437 | } | 437 | } |
438 | 438 | ||
439 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { | 439 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
440 | switch ( e->key() ) { | 440 | switch ( e->key() ) { |
441 | case Qt::Key_Down: | 441 | case Qt::Key_Down: |
442 | case Qt::Key_Up: | 442 | case Qt::Key_Up: |
443 | QListView::keyPressEvent ( e ); | 443 | QListView::keyPressEvent ( e ); |
444 | e->accept(); | 444 | e->accept(); |
445 | break; | 445 | break; |
446 | case Qt::Key_Left: | 446 | case Qt::Key_Left: |
447 | case Qt::Key_Right: | 447 | case Qt::Key_Right: |
448 | QListView::keyPressEvent ( e ); | 448 | QListView::keyPressEvent ( e ); |
449 | e->accept(); | 449 | e->accept(); |
450 | return; | 450 | return; |
451 | break; | 451 | break; |
452 | default: | 452 | default: |
453 | e->ignore(); | 453 | e->ignore(); |
454 | break; | 454 | break; |
455 | } | 455 | } |
456 | return; | 456 | return; |
457 | } | 457 | } |
458 | e->ignore(); | 458 | e->ignore(); |
459 | } | 459 | } |
460 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) | 460 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) |
461 | { | 461 | { |
462 | QListView::contentsMouseReleaseEvent(e); | 462 | QListView::contentsMouseReleaseEvent(e); |
463 | mMousePressed = false; | 463 | mMousePressed = false; |
464 | } | 464 | } |
465 | 465 | ||
@@ -1647,78 +1647,75 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) | |||
1647 | case Qt::Key_S: | 1647 | case Qt::Key_S: |
1648 | if ( e->state() == Qt::ControlButton ) { | 1648 | if ( e->state() == Qt::ControlButton ) { |
1649 | e->ignore(); | 1649 | e->ignore(); |
1650 | break; | 1650 | break; |
1651 | } | 1651 | } |
1652 | if ( e->state() == Qt::ShiftButton ) { | 1652 | if ( e->state() == Qt::ShiftButton ) { |
1653 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1653 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1654 | reparentTodo(); | 1654 | reparentTodo(); |
1655 | e->accept(); | 1655 | e->accept(); |
1656 | } else | 1656 | } else |
1657 | e->ignore(); | 1657 | e->ignore(); |
1658 | break; | 1658 | break; |
1659 | case Qt::Key_P: | 1659 | case Qt::Key_P: |
1660 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1660 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1661 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1661 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1662 | if ( pendingSubtodo ) | 1662 | if ( pendingSubtodo ) |
1663 | itemClicked(mActiveItem); | 1663 | itemClicked(mActiveItem); |
1664 | e->accept(); | 1664 | e->accept(); |
1665 | } else | 1665 | } else |
1666 | e->ignore(); | 1666 | e->ignore(); |
1667 | break; | 1667 | break; |
1668 | case Qt::Key_Escape: | 1668 | case Qt::Key_Escape: |
1669 | if ( pendingSubtodo ) { | 1669 | if ( pendingSubtodo ) { |
1670 | itemClicked(0); | 1670 | itemClicked(0); |
1671 | e->accept(); | 1671 | e->accept(); |
1672 | } else | 1672 | } else |
1673 | e->ignore(); | 1673 | e->ignore(); |
1674 | break; | 1674 | break; |
1675 | default: | 1675 | default: |
1676 | e->ignore(); | 1676 | e->ignore(); |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | if ( true ) { | 1679 | if ( true ) { |
1680 | if ( e->key() == Qt::Key_I ) { | 1680 | if ( e->key() == Qt::Key_I ) { |
1681 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); | 1681 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); |
1682 | if ( cn ) { | 1682 | if ( cn ) { |
1683 | mActiveItem = cn; | 1683 | mActiveItem = cn; |
1684 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 1684 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
1685 | if ( ci ){ | 1685 | if ( ci ){ |
1686 | showTodo(); | 1686 | showTodo(); |
1687 | cn = (KOTodoViewItem*)cn->itemBelow(); | 1687 | cn = (KOTodoViewItem*)cn->itemBelow(); |
1688 | if ( cn ) { | 1688 | if ( cn ) { |
1689 | mTodoListView->setCurrentItem ( cn ); | 1689 | mTodoListView->setCurrentItem ( cn ); |
1690 | mTodoListView->ensureItemVisible ( cn ); | 1690 | mTodoListView->ensureItemVisible ( cn ); |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | } | 1693 | } |
1694 | } | 1694 | } |
1695 | e->accept(); | 1695 | e->accept(); |
1696 | |||
1697 | } | 1696 | } |
1698 | |||
1699 | } | 1697 | } |
1700 | |||
1701 | } | 1698 | } |
1702 | void KOTodoView::updateTodo( Todo * t, int type ) | 1699 | void KOTodoView::updateTodo( Todo * t, int type ) |
1703 | { | 1700 | { |
1704 | if ( mBlockUpdate) | 1701 | if ( mBlockUpdate) |
1705 | return; | 1702 | return; |
1706 | 1703 | ||
1707 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1704 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
1708 | itemIterator = mTodoMap.find(t); | 1705 | itemIterator = mTodoMap.find(t); |
1709 | if (itemIterator != mTodoMap.end()) { | 1706 | if (itemIterator != mTodoMap.end()) { |
1710 | (*itemIterator)->construct(); | 1707 | (*itemIterator)->construct(); |
1711 | } else { | 1708 | } else { |
1712 | if ( type == KOGlobals::EVENTADDED ) { | 1709 | if ( type == KOGlobals::EVENTADDED ) { |
1713 | insertTodoItem( t ); | 1710 | insertTodoItem( t ); |
1714 | } | 1711 | } |
1715 | } | 1712 | } |
1716 | 1713 | ||
1717 | } | 1714 | } |
1718 | 1715 | ||
1719 | void KOTodoView::todoModified(Todo * t , int p ) | 1716 | void KOTodoView::todoModified(Todo * t , int p ) |
1720 | { | 1717 | { |
1721 | mBlockUpdate = true; | 1718 | mBlockUpdate = true; |
1722 | emit todoModifiedSignal ( t, p ); | 1719 | emit todoModifiedSignal ( t, p ); |
1723 | mBlockUpdate = false; | 1720 | mBlockUpdate = false; |
1724 | } | 1721 | } |