Disable various combinations of router and editing commands.

They just confuse each other.

Fixes https://gitlab.com/kicad/code/kicad/issues/5067
This commit is contained in:
Jeff Young 2020-08-04 14:31:31 +01:00
parent 0f3d79245e
commit 59ba793096
3 changed files with 28 additions and 3 deletions

View File

@ -1483,6 +1483,27 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
m_router->FixRoute( m_endSnapPoint, m_endItem ); m_router->FixRoute( m_endSnapPoint, m_endItem );
break; 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 ) if( module )

View File

@ -249,6 +249,13 @@ bool EDIT_TOOL::invokeInlineRouter( int aDragMode )
if( !theRouter ) if( !theRouter )
return false; 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! // make sure we don't accidentally invoke inline routing mode while the router is already active!
if( theRouter->IsToolActive() ) if( theRouter->IsToolActive() )
return false; return false;

View File

@ -114,9 +114,6 @@ public:
/// Activation of the exact move tool /// Activation of the exact move tool
static TOOL_ACTION moveExact; static TOOL_ACTION moveExact;
/// Activation of the duplication tool
static TOOL_ACTION duplicate;
/// Activation of the duplication tool with incrementing (e.g. pad number) /// Activation of the duplication tool with incrementing (e.g. pad number)
static TOOL_ACTION duplicateIncrement; static TOOL_ACTION duplicateIncrement;