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

Fixes: lp:1839877
* https://bugs.launchpad.net/kicad/+bug/1839877
This commit is contained in:
Jeff Young 2019-08-12 22:17:25 +01:00
parent 3bf24fae7a
commit f3f0a6899f
4 changed files with 13 additions and 14 deletions

View File

@ -26,25 +26,21 @@
#include <kiface_i.h>
#include <confirm.h>
#include <macros.h>
#include <dialog_helpers.h>
#include <html_messagebox.h>
#include <base_units.h>
#include <pcb_edit_frame.h>
#include <pcb_netlist.h>
#include <netlist_reader.h>
#include <reporter.h>
#include <bitmaps.h>
#include <tool/tool_manager.h>
#include <board_design_settings.h>
#include <tools/drc.h>
#include <tools/pcb_actions.h>
#include <class_board.h>
#include <class_module.h>
#include <connectivity/connectivity_data.h>
#include <wildcards_and_files_ext.h>
#include <board_netlist_updater.h>
#include <dialog_netlist.h>
#include <wx_html_report_panel.h>
#include <tools/drc.h>
#define NETLIST_FILTER_MESSAGES_KEY wxT("NetlistReportFilterMsg")
#define NETLIST_UPDATEFOOTPRINTS_KEY wxT("NetlistUpdateFootprints")
@ -106,7 +102,11 @@ DIALOG_NETLIST::~DIALOG_NETLIST()
m_config->Write( NETLIST_FILTER_MESSAGES_KEY, (long) m_MessageWindow->GetVisibleSeverities() );
if( m_runDragCommand )
m_parent->GetToolManager()->InvokeTool( "pcbnew.InteractiveEdit" );
{
KIGFX::VIEW_CONTROLS* controls = m_parent->GetCanvas()->GetViewControls();
controls->SetCursorPosition( controls->GetMousePosition() );
m_parent->GetToolManager()->RunAction( PCB_ACTIONS::move, true );
}
}

View File

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

View File

@ -393,11 +393,6 @@ int PCB_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent )
{
DIALOG_UPDATE_PCB updateDialog( m_frame, &netlist );
updateDialog.ShowModal();
SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
if( !selectionTool->GetSelection().Empty() )
m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" );
}
return 0;

View File

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