Commit 9bd7ba36 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Added resetting of tools after loading a new board.

parent 723424df
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -222,5 +222,11 @@ void TOOL_MANAGER::SetEnvironment( EDA_ITEM* aModel, KiGfx::VIEW* aView,
	m_view = aView;
	m_viewControls = aViewControls;
	m_editFrame = aFrame;
	// fixme: reset tools after changing environment

	// Reset state of the registered tools
	BOOST_FOREACH( TOOL_BASE* tool, m_toolState | boost::adaptors::map_keys )
	{
	    if( tool->GetType() == TOOL_Interactive )
	        static_cast<TOOL_INTERACTIVE*>( tool )->Reset();
	}
}
+3 −4
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ public:
    template <class Parameters>
        void InvokeTool( const std::string& name, const Parameters& aToolParams );


    /**
     * Function FindTool()
     * Searches for a tool with given name or ID
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ SELECTION_TOOL::~SELECTION_TOOL()

void SELECTION_TOOL::Reset()
{
    m_selectedItems.clear();

    // the tool launches upon reception of activate ("pcbnew.InteractiveSelection")
    Go( &SELECTION_TOOL::Main, TOOL_EVENT( TC_Command, TA_ActivateTool, GetName() ) ); //"pcbnew.InteractiveSelection"));
}