From 3f91db25d43f2c19ec041e7f25985d824191fe20 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 10 Aug 2019 22:26:39 +0100 Subject: [PATCH] Minimal cherry-pick of c836cc9cf8afdac1e682ded5f541251922b77b79. Fixes: lp:1839534 * https://bugs.launchpad.net/kicad/+bug/1839534 --- pcbnew/tools/edit_tool.cpp | 1 - pcbnew/tools/selection_tool.cpp | 2 +- qa/qa_utils/mocks.cpp | 5 +++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 046aadc155..e18edc363e 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1410,7 +1410,6 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent ) void EDIT_TOOL::setTransitions() { - Go( &EDIT_TOOL::Main, PCB_ACTIONS::editActivate.MakeEvent() ); Go( &EDIT_TOOL::Main, PCB_ACTIONS::move.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::drag45Degree.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::dragFreeAngle.MakeEvent() ); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index e3747bf408..20f41607c9 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -349,7 +349,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( selectionContains( evt->Position() ) ) { // Yes -> run the move tool and wait till it finishes - m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" ); + m_toolMgr->RunAction( PCB_ACTIONS::move, true ); } else { diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index 3fadd9a6fb..cd0b3c92d3 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -193,6 +193,11 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC, GR_DRAWMODE aDrawMode, const } +TOOL_ACTION PCB_ACTIONS::move( "pcbnew.InteractiveEdit.move", + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM ), + _( "Move" ), _( "Moves the selected item(s)" ), nullptr, AF_ACTIVATE ); + + // Initialize static member variables wxString DIALOG_FIND::prevSearchString; bool DIALOG_FIND::warpMouse = true;