From 59ba793096a8151704f86373a93f0b5c86b04175 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 4 Aug 2020 14:31:31 +0100 Subject: [PATCH] Disable various combinations of router and editing commands. They just confuse each other. Fixes https://gitlab.com/kicad/code/kicad/issues/5067 --- pcbnew/router/router_tool.cpp | 21 +++++++++++++++++++++ pcbnew/tools/edit_tool.cpp | 7 +++++++ pcbnew/tools/pcb_actions.h | 3 --- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 4a5ddf046a..e1fa3b6230 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1483,6 +1483,27 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) m_router->FixRoute( m_endSnapPoint, m_endItem ); break; } + else if( evt->Category() == TC_COMMAND ) + { + // disallow many editing commands + if( evt->IsAction( &PCB_ACTIONS::rotateCw ) + || evt->IsAction( &PCB_ACTIONS::rotateCcw ) + || evt->IsAction( &PCB_ACTIONS::flip ) + || evt->IsAction( &PCB_ACTIONS::mirror ) + || evt->IsAction( &ACTIONS::cut ) + || evt->IsAction( &ACTIONS::copy ) + || evt->IsAction( &ACTIONS::paste ) + || evt->IsAction( &ACTIONS::pasteSpecial ) + || evt->IsAction( &ACTIONS::duplicate ) + || evt->IsAction( &PCB_ACTIONS::duplicateIncrement ) + || evt->IsAction( &PCB_ACTIONS::move ) + || evt->IsAction( &PCB_ACTIONS::moveWithReference ) + || evt->IsAction( &PCB_ACTIONS::moveExact ) ) + { + wxBell(); + } + } + } if( module ) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index f2b64fbd69..815a767ebb 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -249,6 +249,13 @@ bool EDIT_TOOL::invokeInlineRouter( int aDragMode ) if( !theRouter ) return false; + // don't allow switch from moving to dragging + if( m_dragging ) + { + wxBell(); + return false; + } + // make sure we don't accidentally invoke inline routing mode while the router is already active! if( theRouter->IsToolActive() ) return false; diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index ba19bad457..f8798dcb8c 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -114,9 +114,6 @@ public: /// Activation of the exact move tool static TOOL_ACTION moveExact; - /// Activation of the duplication tool - static TOOL_ACTION duplicate; - /// Activation of the duplication tool with incrementing (e.g. pad number) static TOOL_ACTION duplicateIncrement;