Browse Source

tools: moved tools registration outside pcbframe.cpp

pull/2/head
Tomasz Włostowski 11 years ago
parent
commit
9f0b02268b
  1. 1
      pcbnew/CMakeLists.txt
  2. 20
      pcbnew/pcbframe.cpp
  3. 8
      pcbnew/tools/common_actions.h

1
pcbnew/CMakeLists.txt

@ -275,6 +275,7 @@ set( PCBNEW_CLASS_SRCS
tools/module_tools.cpp
tools/placement_tool.cpp
tools/common_actions.cpp
tools/tools_common.cpp
)
set( PCBNEW_SRCS ${PCBNEW_AUTOROUTER_SRCS} ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS} )

20
pcbnew/pcbframe.cpp

@ -68,17 +68,9 @@
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/selection_tool.h>
#include <router/router_tool.h>
#include <tools/edit_tool.h>
#include <tools/drawing_tool.h>
#include <tools/point_editor.h>
#include <tools/pcbnew_control.h>
#include <tools/pcb_editor_control.h>
#include <tools/placement_tool.h>
#include <tools/common_actions.h>
#include <scripting/python_console_frame.h>
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
@ -545,14 +537,8 @@ void PCB_EDIT_FRAME::setupTools()
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
// Register tools
m_toolManager->RegisterTool( new SELECTION_TOOL );
m_toolManager->RegisterTool( new ROUTER_TOOL );
m_toolManager->RegisterTool( new EDIT_TOOL );
m_toolManager->RegisterTool( new DRAWING_TOOL );
m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new PCBNEW_CONTROL );
m_toolManager->RegisterTool( new PCB_EDITOR_CONTROL );
m_toolManager->RegisterTool( new PLACEMENT_TOOL );
registerAllTools ( m_toolManager );
m_toolManager->ResetTools( TOOL_BASE::RUN );
// Run the selection tool, it is supposed to be always active

8
pcbnew/tools/common_actions.h

@ -22,10 +22,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __COMMON_ACTIONS_H
#define __COMMON_ACTIONS_H
#include <tool/tool_action.h>
#include <boost/optional.hpp>
class TOOL_EVENT;
class TOOL_MANAGER;
/**
* Class COMMON_ACTIONS
@ -241,3 +245,7 @@ public:
*/
static boost::optional<TOOL_EVENT> TranslateLegacyId( int aId );
};
void registerAllTools ( TOOL_MANAGER *aToolManager );
#endif
Loading…
Cancel
Save