summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index dcb46a8..5420822 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -405,97 +405,97 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
405 case QEvent::MouseButtonPress: 405 case QEvent::MouseButtonPress:
406 rightClickTime.restart(); 406 rightClickTime.restart();
407 if (me->button() == LeftButton) { 407 if (me->button() == LeftButton) {
408 leftMouseDown = true; 408 leftMouseDown = true;
409 } 409 }
410 else if (me->button() == RightButton) 410 else if (me->button() == RightButton)
411 rightMouseDown = true; 411 rightMouseDown = true;
412 blockMoving = true; 412 blockMoving = true;
413 startX = viewportPos.x(); 413 startX = viewportPos.x();
414 startY = viewportPos.y(); 414 startY = viewportPos.y();
415 if (object != viewport()) { 415 if (object != viewport()) {
416 if (me->button() == RightButton) { 416 if (me->button() == RightButton) {
417 mClickedItem = (KOAgendaItem *)object; 417 mClickedItem = (KOAgendaItem *)object;
418 if (mClickedItem) { 418 if (mClickedItem) {
419 selectItem(mClickedItem); 419 selectItem(mClickedItem);
420 } 420 }
421 } else if (me->button() == LeftButton) { 421 } else if (me->button() == LeftButton) {
422 mActionItem = (KOAgendaItem *)object; 422 mActionItem = (KOAgendaItem *)object;
423 if (mActionItem) { 423 if (mActionItem) {
424 if ( mSelectionHeight > 0 ) { 424 if ( mSelectionHeight > 0 ) {
425 int selectionCellX = mSelectionCellX * mGridSpacingX; 425 int selectionCellX = mSelectionCellX * mGridSpacingX;
426 int selectionYTop = mSelectionYTop; 426 int selectionYTop = mSelectionYTop;
427 int gridSpacingX = mGridSpacingX; 427 int gridSpacingX = mGridSpacingX;
428 int selectionHeight = mSelectionHeight; 428 int selectionHeight = mSelectionHeight;
429 clearSelection(); 429 clearSelection();
430 repaintContents( selectionCellX, selectionYTop, 430 repaintContents( selectionCellX, selectionYTop,
431 gridSpacingX, selectionHeight,false ); 431 gridSpacingX, selectionHeight,false );
432 } 432 }
433 selectItem(mActionItem); 433 selectItem(mActionItem);
434 Incidence *incidence = mActionItem->incidence(); 434 Incidence *incidence = mActionItem->incidence();
435 if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { 435 if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) {
436 mActionItem = 0; 436 mActionItem = 0;
437 } else { 437 } else {
438 startItemAction(viewportPos); 438 startItemAction(viewportPos);
439 } 439 }
440 } 440 }
441 } 441 }
442 } else { // ---------- viewport() 442 } else { // ---------- viewport()
443 selectItem(0); 443 selectItem(0);
444 mActionItem = 0; 444 mActionItem = 0;
445 if (me->button() == LeftButton ) { 445 if (me->button() == LeftButton ) {
446 setCursor(arrowCursor); 446 setCursor(arrowCursor);
447 startSelectAction(viewportPos); 447 startSelectAction(viewportPos);
448 } 448 }
449 } 449 }
450 break; 450 break;
451 451
452 case QEvent::MouseButtonRelease: 452 case QEvent::MouseButtonRelease:
453 if ( rightClickTime.elapsed() > 700 && blockMoving ) 453 if ( rightClickTime.elapsed() > 500 && blockMoving )
454 rightButtonPressed = true; 454 rightButtonPressed = true;
455 if (object != viewport()) { 455 if (object != viewport()) {
456 if (me->button() == RightButton || rightButtonPressed ) { 456 if (me->button() == RightButton || rightButtonPressed ) {
457 if ( blockMoving ) { 457 if ( blockMoving ) {
458 mClickedItem = (KOAgendaItem *)object; 458 mClickedItem = (KOAgendaItem *)object;
459 if (mActionItem ) { 459 if (mActionItem ) {
460 endItemAction(); 460 endItemAction();
461 } 461 }
462 leftMouseDown = false; // no more leftMouse computation 462 leftMouseDown = false; // no more leftMouse computation
463 if (mClickedItem) { 463 if (mClickedItem) {
464 selectItem(mClickedItem); 464 selectItem(mClickedItem);
465 emit showIncidencePopupSignal(mClickedItem->incidence()); 465 emit showIncidencePopupSignal(mClickedItem->incidence());
466 } 466 }
467 } 467 }
468 } else if (me->button() == LeftButton && leftMouseDown) { 468 } else if (me->button() == LeftButton && leftMouseDown) {
469 if (mActionItem) { 469 if (mActionItem) {
470 QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); 470 QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos));
471 //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); 471 //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 );
472 if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { 472 if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) {
473 mScrollUpTimer.stop(); 473 mScrollUpTimer.stop();
474 mScrollDownTimer.stop(); 474 mScrollDownTimer.stop();
475 mActionItem->resetMove(); 475 mActionItem->resetMove();
476 placeSubCells( mActionItem ); 476 placeSubCells( mActionItem );
477 // emit startDragSignal( mActionItem->incidence() ); 477 // emit startDragSignal( mActionItem->incidence() );
478 setCursor( arrowCursor ); 478 setCursor( arrowCursor );
479 mActionItem = 0; 479 mActionItem = 0;
480 mActionType = NOP; 480 mActionType = NOP;
481 mItemMoved = 0; 481 mItemMoved = 0;
482 leftMouseDown = false; 482 leftMouseDown = false;
483 return true; 483 return true;
484 } 484 }
485 endItemAction(); 485 endItemAction();
486 } 486 }
487 } 487 }
488 488
489 } else { // ---------- viewport() 489 } else { // ---------- viewport()
490 if (me->button() == RightButton || rightButtonPressed ) { //right click 490 if (me->button() == RightButton || rightButtonPressed ) { //right click
491 if ( blockMoving ) { // we did mot moved the mouse much - popup menu 491 if ( blockMoving ) { // we did mot moved the mouse much - popup menu
492 if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action 492 if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action
493 endSelectAction( false ); // do not emit new event signal 493 endSelectAction( false ); // do not emit new event signal
494 leftMouseDown = false; // no more leftMouse computation 494 leftMouseDown = false; // no more leftMouse computation
495 } 495 }
496 int x,y; 496 int x,y;
497 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 497 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
498 int gx,gy; 498 int gx,gy;
499 contentsToGrid(x,y,gx,gy); 499 contentsToGrid(x,y,gx,gy);
500 mCurrentCellX = gx; 500 mCurrentCellX = gx;
501 mCurrentCellY = gy; 501 mCurrentCellY = gy;