-rw-r--r-- | korganizer/koagenda.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 0aef929..ffa2678 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -438,28 +438,34 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
438 | mActionItem = 0; | 438 | mActionItem = 0; |
439 | if (me->button() == RightButton ) { | 439 | if (me->button() == RightButton ) { |
440 | blockNewEvent = true; | 440 | blockNewEvent = true; |
441 | //qDebug("right "); | 441 | block = false; |
442 | } else { | ||
443 | blockNewEvent = false; | ||
444 | setCursor(arrowCursor); | ||
445 | startSelectAction(viewportPos); | ||
446 | } | ||
447 | } | ||
448 | break; | ||
449 | |||
450 | case QEvent::MouseButtonRelease: | ||
451 | //qDebug("QEvent::MouseButtonRelease: %d",blockNewEvent ); | ||
452 | if (me->button() == RightButton && blockNewEvent && !block) { | ||
442 | int x,y; | 453 | int x,y; |
443 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 454 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
444 | int gx,gy; | 455 | int gx,gy; |
445 | contentsToGrid(x,y,gx,gy); | 456 | contentsToGrid(x,y,gx,gy); |
446 | mStartCellX = gx; | 457 | if ( mCurrentCellY < mStartCellY +1 ) { |
447 | mStartCellY = gy; | 458 | //qDebug("mCurrentCellY %d mStartCellY %d ", mCurrentCellY,mStartCellY); |
448 | mCurrentCellX = gx; | 459 | mCurrentCellX = gx; |
449 | mCurrentCellY = gy; | 460 | mCurrentCellY = gy; |
461 | mStartCellX = gx; | ||
462 | mStartCellY = gy; | ||
450 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | 463 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); |
451 | 464 | break; | |
452 | } else { | 465 | } else { |
453 | blockNewEvent = false; | 466 | blockNewEvent = false; |
454 | setCursor(arrowCursor); | ||
455 | startSelectAction(viewportPos); | ||
456 | } | 467 | } |
457 | } | 468 | } else if (me->button() == RightButton && block ) { |
458 | break; | ||
459 | |||
460 | case QEvent::MouseButtonRelease: | ||
461 | //qDebug("QEvent::MouseButtonRelease: "); | ||
462 | if (me->button() == RightButton && block ) { | ||
463 | if (object != viewport()) { | 469 | if (object != viewport()) { |
464 | mClickedItem = (KOAgendaItem *)object; | 470 | mClickedItem = (KOAgendaItem *)object; |
465 | if (mActionItem ) { | 471 | if (mActionItem ) { |
@@ -491,7 +497,6 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
491 | endItemAction(); | 497 | endItemAction(); |
492 | } else if ( mActionType == SELECT ) { | 498 | } else if ( mActionType == SELECT ) { |
493 | if (me->button() == RightButton ) { | 499 | if (me->button() == RightButton ) { |
494 | |||
495 | } else { | 500 | } else { |
496 | endSelectAction( !blockNewEvent ); | 501 | endSelectAction( !blockNewEvent ); |
497 | } | 502 | } |