Invoke move by ACTION; the EDIT_TOOL does lots of other stuff too.

Fixes: lp:1839877
* https://bugs.launchpad.net/kicad/+bug/1839877

(cherry picked from commit f3f0a6899f)
This commit is contained in:
Jeff Young 2019-08-12 22:17:25 +01:00
parent 2a9412042c
commit e404fb772b
4 changed files with 12 additions and 9 deletions

View File

@ -427,12 +427,6 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
{ {
DIALOG_UPDATE_PCB updateDialog( this, &netlist ); DIALOG_UPDATE_PCB updateDialog( this, &netlist );
updateDialog.ShowModal(); updateDialog.ShowModal();
auto selectionTool = static_cast<SELECTION_TOOL*>(
m_toolManager->FindTool( "pcbnew.InteractiveSelection" ) );
if( !selectionTool->GetSelection().Empty() )
GetToolManager()->InvokeTool( "pcbnew.InteractiveEdit" );
} }
break; break;

View File

@ -41,6 +41,7 @@
#include <bitmaps.h> #include <bitmaps.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <board_design_settings.h> #include <board_design_settings.h>
#include <tools/pcb_actions.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
@ -119,7 +120,11 @@ DIALOG_NETLIST::~DIALOG_NETLIST()
m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_MessageWindow->GetVisibleSeverities() ); m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_MessageWindow->GetVisibleSeverities() );
if( m_runDragCommand ) if( m_runDragCommand )
m_parent->GetToolManager()->InvokeTool( "pcbnew.InteractiveEdit" ); {
KIGFX::VIEW_CONTROLS* controls = m_parent->GetGalCanvas()->GetViewControls();
controls->SetCursorPosition( controls->GetMousePosition() );
m_parent->GetToolManager()->RunAction( PCB_ACTIONS::move, true );
}
} }

View File

@ -94,7 +94,11 @@ DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB()
m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_messagePanel->GetVisibleSeverities() ); m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_messagePanel->GetVisibleSeverities() );
if( m_runDragCommand ) if( m_runDragCommand )
m_frame->GetToolManager()->InvokeTool( "pcbnew.InteractiveEdit" ); {
KIGFX::VIEW_CONTROLS* controls = m_frame->GetGalCanvas()->GetViewControls();
controls->SetCursorPosition( controls->GetMousePosition() );
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::move, true );
}
} }

View File

@ -1289,7 +1289,7 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent )
viewCtrls->ForceCursorPosition( true, module->GetPosition() ); viewCtrls->ForceCursorPosition( true, module->GetPosition() );
// pick the component up and start moving // pick the component up and start moving
m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" ); m_toolMgr->RunAction( PCB_ACTIONS::move, true );
// restore the previous cursor position // restore the previous cursor position
viewCtrls->SetCursorPosition( cursorPosition, false ); viewCtrls->SetCursorPosition( cursorPosition, false );