From ed0e6af66d182f798efe855c82471425fc18036d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 4 May 2019 12:23:04 +0100 Subject: [PATCH] Move to direct tool registration. It was confusing that the primary frames registered their tools differently than the other frames. In addition, since the other frames also added their own tools, foo_actions::RegisterAllTools() didn't really register all tool but rather those used by the principal frame (PCB_EDIT_FRAME, SCH_EDIT_FRAME, etc.) --- cvpcb/display_footprints_frame.cpp | 16 +++++---- cvpcb/tools/cvpcb_actions.cpp | 15 --------- cvpcb/tools/cvpcb_actions.h | 3 -- eeschema/libedit/lib_edit_frame.cpp | 31 +++++++++++++++++- eeschema/libedit/lib_edit_frame.h | 3 ++ eeschema/sch_base_frame.cpp | 20 ------------ eeschema/sch_base_frame.h | 4 --- eeschema/sch_edit_frame.cpp | 42 +++++++++++++++++++++--- eeschema/sch_edit_frame.h | 2 ++ eeschema/tools/sch_actions.cpp | 24 -------------- eeschema/tools/sch_actions.h | 3 -- eeschema/tools/sch_inspection_tool.cpp | 4 +-- eeschema/tools/sch_inspection_tool.h | 2 +- eeschema/viewlib_frame.cpp | 25 ++++++++++++++ eeschema/viewlib_frame.h | 7 ++-- gerbview/gerbview_frame.cpp | 9 +++++- gerbview/tools/gerbview_actions.cpp | 15 +-------- gerbview/tools/gerbview_actions.h | 3 -- include/tool/actions.h | 3 -- pcbnew/pcb_edit_frame.cpp | 45 +++++++++++++++++++++----- pcbnew/tools/pcb_actions.cpp | 39 ---------------------- pcbnew/tools/pcb_actions.h | 3 -- qa/qa_utils/pcb_test_frame.cpp | 4 --- 23 files changed, 161 insertions(+), 161 deletions(-) diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 6b0f094ec2..15c65273c7 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Wayne Stambaugh - * Copyright (C) 2007-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2007-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,10 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file display_footprints_frame.cpp - */ - #include #include #include @@ -58,7 +54,10 @@ #include #include #include -#include "tools/cvpcb_actions.h" +#include +#include +#include +#include // Colors for layers and items COLORS_DESIGN_SETTINGS g_ColorsSettings( FRAME_CVPCB_DISPLAY ); @@ -156,7 +155,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); gal_drawPanel->SetEventDispatcher( m_toolDispatcher ); - m_actions->RegisterAllTools( m_toolManager ); + m_toolManager->RegisterTool( new COMMON_TOOLS ); + m_toolManager->RegisterTool( new ZOOM_TOOL ); + m_toolManager->RegisterTool( new CVPCB_SELECTION_TOOL ); + m_toolManager->RegisterTool( new CVPCB_CONTROL ); m_toolManager->InitTools(); // Run the control tool, it is supposed to be always active diff --git a/cvpcb/tools/cvpcb_actions.cpp b/cvpcb/tools/cvpcb_actions.cpp index 014ccc6460..566f04989a 100644 --- a/cvpcb/tools/cvpcb_actions.cpp +++ b/cvpcb/tools/cvpcb_actions.cpp @@ -22,25 +22,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include -#include - #include "cvpcb_actions.h" -#include "cvpcb_control.h" -#include "cvpcb_selection_tool.h" #include -void CVPCB_ACTIONS::RegisterAllTools( TOOL_MANAGER* aToolManager ) -{ - aToolManager->RegisterTool( new COMMON_TOOLS ); - aToolManager->RegisterTool( new ZOOM_TOOL ); - aToolManager->RegisterTool( new CVPCB_SELECTION_TOOL ); - aToolManager->RegisterTool( new CVPCB_CONTROL ); -} - - OPT CVPCB_ACTIONS::TranslateLegacyId( int aId ) { switch( aId ) diff --git a/cvpcb/tools/cvpcb_actions.h b/cvpcb/tools/cvpcb_actions.h index b94512e000..a6df7ae1c9 100644 --- a/cvpcb/tools/cvpcb_actions.h +++ b/cvpcb/tools/cvpcb_actions.h @@ -61,9 +61,6 @@ public: ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override; - - ///> @copydoc COMMON_ACTIONS::RegisterAllTools() - virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override; }; #endif diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 58909b9d31..4bfc5f3d54 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -62,10 +62,16 @@ #include #include #include +#include #include +#include +#include +#include +#include +#include #include #include -#include + int LIB_EDIT_FRAME:: m_unit = 1; int LIB_EDIT_FRAME:: m_convert = 1; @@ -316,6 +322,29 @@ LIB_EDIT_FRAME::~LIB_EDIT_FRAME() } +void LIB_EDIT_FRAME::setupTools() +{ + // Create the manager and dispatcher & route draw panel events to the dispatcher + m_toolManager = new TOOL_MANAGER; + m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), + GetCanvas()->GetViewControls(), this ); + m_actions = new SCH_ACTIONS(); + m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); + + // Register tools + m_toolManager->RegisterTool( new COMMON_TOOLS ); + m_toolManager->RegisterTool( new ZOOM_TOOL ); + m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_PICKER_TOOL ); + m_toolManager->InitTools(); + + // Run the selection tool, it is supposed to be always active + m_toolManager->InvokeTool( "eeschema.InteractiveSelection" ); + + GetCanvas()->SetEventDispatcher( m_toolDispatcher ); +} + + void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) { if( saveAllLibraries( true ) ) diff --git a/eeschema/libedit/lib_edit_frame.h b/eeschema/libedit/lib_edit_frame.h index d889944716..f57cc75394 100644 --- a/eeschema/libedit/lib_edit_frame.h +++ b/eeschema/libedit/lib_edit_frame.h @@ -444,6 +444,9 @@ public: bool IsEditingDrawItem() { return GetDrawItem() && GetDrawItem()->InEditMode(); } private: + // Sets up the tool framework + void setupTools(); + void loadPart( const wxString& aLibrary, const wxString& aPart, int Unit ); void savePartAs(); diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 0faa4cc78e..d771478430 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -107,26 +107,6 @@ SCH_BASE_FRAME::~SCH_BASE_FRAME() } -void SCH_BASE_FRAME::setupTools() -{ - // Create the manager and dispatcher & route draw panel events to the dispatcher - m_toolManager = new TOOL_MANAGER; - m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), - GetCanvas()->GetViewControls(), this ); - m_actions = new SCH_ACTIONS(); - m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); - - // Register tools - m_actions->RegisterAllTools( m_toolManager ); - m_toolManager->InitTools(); - - // Run the selection tool, it is supposed to be always active - m_toolManager->InvokeTool( "eeschema.InteractiveSelection" ); - - GetCanvas()->SetEventDispatcher( m_toolDispatcher ); -} - - void SCH_BASE_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent ) { wxMenuBar* menuBar = GetMenuBar(); diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index 2361aeb95b..8ed802d605 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -326,10 +326,6 @@ public: protected: - - // Sets up the tool framework - void setupTools(); - /** * Open the library viewer only to browse library contents. * If the viewed is already opened from this, raise the viewer diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index e423ca42f2..b815098b50 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -49,17 +49,23 @@ #include #include #include -#include "sim/sim_plot_frame.h" - +#include #include #include #include #include #include +#include +#include +#include #include #include - -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -408,6 +414,34 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME() } +void SCH_EDIT_FRAME::setupTools() +{ + // Create the manager and dispatcher & route draw panel events to the dispatcher + m_toolManager = new TOOL_MANAGER; + m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), + GetCanvas()->GetViewControls(), this ); + m_actions = new SCH_ACTIONS(); + m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); + + // Register tools + m_toolManager->RegisterTool( new COMMON_TOOLS ); + m_toolManager->RegisterTool( new ZOOM_TOOL ); + m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_PICKER_TOOL ); + m_toolManager->RegisterTool( new SCH_DRAWING_TOOL ); + m_toolManager->RegisterTool( new SCH_LINE_DRAWING_TOOL ); + m_toolManager->RegisterTool( new SCH_EDIT_TOOL ); + m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); + m_toolManager->RegisterTool( new SCH_EDITOR_CONTROL ); + m_toolManager->InitTools(); + + // Run the selection tool, it is supposed to be always active + m_toolManager->InvokeTool( "eeschema.InteractiveSelection" ); + + GetCanvas()->SetEventDispatcher( m_toolDispatcher ); +} + + void SCH_EDIT_FRAME::SetRepeatItem( SCH_ITEM* aItem ) { // we cannot store a pointer to an item in the display list here since diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 7dedbf6ce3..e2918d706e 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -769,6 +769,8 @@ public: void GetSchematicConnections( std::vector< wxPoint >& aConnections ); private: + // Sets up the tool framework + void setupTools(); void OnExit( wxCommandEvent& event ); void OnAnnotate( wxCommandEvent& event ); diff --git a/eeschema/tools/sch_actions.cpp b/eeschema/tools/sch_actions.cpp index 9ed83a3e42..827e8865f8 100644 --- a/eeschema/tools/sch_actions.cpp +++ b/eeschema/tools/sch_actions.cpp @@ -23,17 +23,7 @@ #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include char g_lastBusEntryShape = '/'; @@ -215,17 +205,3 @@ OPT SCH_ACTIONS::TranslateLegacyId( int aId ) return OPT(); } - - -void SCH_ACTIONS::RegisterAllTools( TOOL_MANAGER* aToolManager ) -{ - aToolManager->RegisterTool( new COMMON_TOOLS ); - aToolManager->RegisterTool( new ZOOM_TOOL ); - aToolManager->RegisterTool( new SCH_SELECTION_TOOL ); - aToolManager->RegisterTool( new SCH_PICKER_TOOL ); - aToolManager->RegisterTool( new SCH_DRAWING_TOOL ); - aToolManager->RegisterTool( new SCH_LINE_DRAWING_TOOL ); - aToolManager->RegisterTool( new SCH_EDIT_TOOL ); - aToolManager->RegisterTool( new SCH_INSPECTION_TOOL ); - aToolManager->RegisterTool( new SCH_EDITOR_CONTROL ); -} diff --git a/eeschema/tools/sch_actions.h b/eeschema/tools/sch_actions.h index 044a15e0b8..7b6762fd4a 100644 --- a/eeschema/tools/sch_actions.h +++ b/eeschema/tools/sch_actions.h @@ -166,9 +166,6 @@ public: ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override; - - ///> @copydoc COMMON_ACTIONS::RegisterAllTools() - virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override; }; #endif diff --git a/eeschema/tools/sch_inspection_tool.cpp b/eeschema/tools/sch_inspection_tool.cpp index 9f611a945a..568160cc5c 100644 --- a/eeschema/tools/sch_inspection_tool.cpp +++ b/eeschema/tools/sch_inspection_tool.cpp @@ -61,7 +61,7 @@ SCH_INSPECTION_TOOL::SCH_INSPECTION_TOOL() bool SCH_INSPECTION_TOOL::Init() { - m_frame = getEditFrame(); + m_frame = getEditFrame(); m_selectionTool = m_toolMgr->GetTool(); wxASSERT_MSG( m_selectionTool, "eeshema.InteractiveSelection tool is not available" ); @@ -84,7 +84,7 @@ void SCH_INSPECTION_TOOL::Reset( RESET_REASON aReason ) { m_view = static_cast( getView() ); m_controls = getViewControls(); - m_frame = getEditFrame(); + m_frame = getEditFrame(); } diff --git a/eeschema/tools/sch_inspection_tool.h b/eeschema/tools/sch_inspection_tool.h index c82e71e8b5..1a2354db04 100644 --- a/eeschema/tools/sch_inspection_tool.h +++ b/eeschema/tools/sch_inspection_tool.h @@ -58,7 +58,7 @@ private: SCH_SELECTION_TOOL* m_selectionTool; KIGFX::SCH_VIEW* m_view; KIGFX::VIEW_CONTROLS* m_controls; - SCH_EDIT_FRAME* m_frame; + SCH_BASE_FRAME* m_frame; }; #endif /* SCH_INSPECTION_TOOL_H */ diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 82f966281f..5f37f69923 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -45,7 +45,10 @@ #include #include #include +#include #include +#include +#include // Save previous component library viewer state. wxString LIB_VIEW_FRAME::m_libraryName; @@ -218,6 +221,28 @@ LIB_VIEW_FRAME::~LIB_VIEW_FRAME() } +void LIB_VIEW_FRAME::setupTools() +{ + // Create the manager and dispatcher & route draw panel events to the dispatcher + m_toolManager = new TOOL_MANAGER; + m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), + GetCanvas()->GetViewControls(), this ); + m_actions = new SCH_ACTIONS(); + m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); + + // Register tools + m_toolManager->RegisterTool( new COMMON_TOOLS ); + m_toolManager->RegisterTool( new ZOOM_TOOL ); + + m_toolManager->InitTools(); + + // Run the selection tool, it is supposed to be always active + m_toolManager->InvokeTool( "eeschema.InteractiveSelection" ); + + GetCanvas()->SetEventDispatcher( m_toolDispatcher ); +} + + void LIB_VIEW_FRAME::SetUnitAndConvert( int aUnit, int aConvert ) { m_unit = aUnit > 0 ? aUnit : 1; diff --git a/eeschema/viewlib_frame.h b/eeschema/viewlib_frame.h index 1eda44566c..03fbfe84c5 100644 --- a/eeschema/viewlib_frame.h +++ b/eeschema/viewlib_frame.h @@ -48,8 +48,7 @@ public: * Constructor * @param aKiway * @param aParent = the parent frame - * @param aFrameType must be given either FRAME_SCH_LIB_VIEWER or - * FRAME_SCH_LIB_VIEWER_MODAL + * @param aFrameType must be either FRAME_SCH_LIB_VIEWER or FRAME_SCH_LIB_VIEWER_MODAL * @param aLibrary = the library to open when starting (default = NULL) */ LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, @@ -83,6 +82,7 @@ public: * exists) */ bool ReCreateListCmp(); + void DisplayLibInfos(); void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override; void OnCloseWindow( wxCloseEvent& Event ); @@ -157,6 +157,9 @@ public: const BOX2I GetDocumentExtents() const override; private: + // Sets up the tool framework + void setupTools(); + /** * Called when the frame is activated to reload the libraries and component lists * that can be changed by the schematic editor or the library editor. diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 8f6cee4042..d8d0dee8d0 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -46,7 +46,11 @@ #include #include #include +#include +#include #include +#include +#include #include #include @@ -1208,7 +1212,10 @@ void GERBVIEW_FRAME::setupTools() m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); // Register tools - m_actions->RegisterAllTools( m_toolManager ); + m_toolManager->RegisterTool( new COMMON_TOOLS ); + m_toolManager->RegisterTool( new GERBVIEW_SELECTION_TOOL ); + m_toolManager->RegisterTool( new GERBVIEW_CONTROL ); + m_toolManager->RegisterTool( new ZOOM_TOOL ); m_toolManager->InitTools(); // Run the selection tool, it is supposed to be always active diff --git a/gerbview/tools/gerbview_actions.cpp b/gerbview/tools/gerbview_actions.cpp index 7b9b516269..8a2e5ac408 100644 --- a/gerbview/tools/gerbview_actions.cpp +++ b/gerbview/tools/gerbview_actions.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2017 Jon Evans - * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -19,23 +19,10 @@ */ #include -#include -#include #include - #include "gerbview_actions.h" -#include "gerbview_selection_tool.h" -#include "gerbview_control.h" -void GERBVIEW_ACTIONS::RegisterAllTools( TOOL_MANAGER* aToolManager ) -{ - aToolManager->RegisterTool( new COMMON_TOOLS ); - aToolManager->RegisterTool( new GERBVIEW_SELECTION_TOOL ); - aToolManager->RegisterTool( new GERBVIEW_CONTROL ); - aToolManager->RegisterTool( new ZOOM_TOOL ); -} - OPT GERBVIEW_ACTIONS::TranslateLegacyId( int aId ) { switch( aId ) diff --git a/gerbview/tools/gerbview_actions.h b/gerbview/tools/gerbview_actions.h index ce348c3c63..dca51e69b8 100644 --- a/gerbview/tools/gerbview_actions.h +++ b/gerbview/tools/gerbview_actions.h @@ -118,9 +118,6 @@ public: ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override; - - ///> @copydoc COMMON_ACTIONS::RegisterAllTools() - virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override; }; #endif // __GERBVIEW_ACTIONS_H diff --git a/include/tool/actions.h b/include/tool/actions.h index 2ddf8ccf08..b6ede29768 100644 --- a/include/tool/actions.h +++ b/include/tool/actions.h @@ -97,9 +97,6 @@ public: */ virtual OPT TranslateLegacyId( int aId ) = 0; - ///> Registers all valid tools for an application with the tool manager - virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) = 0; - ///> Cursor control event types enum CURSOR_EVENT_TYPE { CURSOR_UP, CURSOR_DOWN, CURSOR_LEFT, CURSOR_RIGHT, CURSOR_CLICK, CURSOR_DBL_CLICK, CURSOR_FAST_MOVE = 0x8000 }; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 872b0212e4..fcd6680655 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck * Copyright (C) 2013 Wayne Stambaugh - * Copyright (C) 2013-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2013-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -20,11 +20,6 @@ * with this program. If not, see . */ -/** - * @file pcb_edit_frame.cpp - * @brief PCB editor main frame implementation. - */ - #include #include #include @@ -70,8 +65,24 @@ #include #include #include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -81,6 +92,8 @@ #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) #include +#include + #endif @@ -556,7 +569,23 @@ void PCB_EDIT_FRAME::setupTools() m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); // Register tools - m_actions->RegisterAllTools( m_toolManager ); + m_toolManager->RegisterTool( new COMMON_TOOLS ); + m_toolManager->RegisterTool( new SELECTION_TOOL ); + m_toolManager->RegisterTool( new ZOOM_TOOL ); + m_toolManager->RegisterTool( new PICKER_TOOL ); + m_toolManager->RegisterTool( new ROUTER_TOOL ); + m_toolManager->RegisterTool( new LENGTH_TUNER_TOOL ); + m_toolManager->RegisterTool( new EDIT_TOOL ); + m_toolManager->RegisterTool( new PAD_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 ALIGN_DISTRIBUTE_TOOL ); + m_toolManager->RegisterTool( new MICROWAVE_TOOL ); + m_toolManager->RegisterTool( new POSITION_RELATIVE_TOOL ); + m_toolManager->RegisterTool( new ZONE_FILLER_TOOL ); + m_toolManager->RegisterTool( new AUTOPLACE_TOOL ); m_toolManager->InitTools(); // Run the selection tool, it is supposed to be always active diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 0cfebcdf70..72e4f15356 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -26,24 +26,7 @@ #include "pcb_actions.h" #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include OPT PCB_ACTIONS::TranslateLegacyId( int aId ) @@ -256,25 +239,3 @@ OPT PCB_ACTIONS::TranslateLegacyId( int aId ) return OPT(); } - - -void PCB_ACTIONS::RegisterAllTools( TOOL_MANAGER* aToolManager ) -{ - aToolManager->RegisterTool( new COMMON_TOOLS ); - aToolManager->RegisterTool( new SELECTION_TOOL ); - aToolManager->RegisterTool( new ZOOM_TOOL ); - aToolManager->RegisterTool( new PICKER_TOOL ); - aToolManager->RegisterTool( new ROUTER_TOOL ); - aToolManager->RegisterTool( new LENGTH_TUNER_TOOL ); - aToolManager->RegisterTool( new EDIT_TOOL ); - aToolManager->RegisterTool( new PAD_TOOL ); - aToolManager->RegisterTool( new DRAWING_TOOL ); - aToolManager->RegisterTool( new POINT_EDITOR ); - aToolManager->RegisterTool( new PCBNEW_CONTROL ); - aToolManager->RegisterTool( new PCB_EDITOR_CONTROL ); - aToolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL ); - aToolManager->RegisterTool( new MICROWAVE_TOOL ); - aToolManager->RegisterTool( new POSITION_RELATIVE_TOOL ); - aToolManager->RegisterTool( new ZONE_FILLER_TOOL ); - aToolManager->RegisterTool( new AUTOPLACE_TOOL ); -} diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index bdc1f70657..1afc478758 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -346,9 +346,6 @@ public: ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override; - - ///> @copydoc COMMON_ACTIONS::RegisterAllTools() - virtual void RegisterAllTools( TOOL_MANAGER* aToolManager ) override; }; #endif diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp index 564ee53ffe..2bf0fbb34f 100644 --- a/qa/qa_utils/pcb_test_frame.cpp +++ b/qa/qa_utils/pcb_test_frame.cpp @@ -107,10 +107,6 @@ public: { return NULLOPT; } - - void RegisterAllTools( TOOL_MANAGER* aToolManager ) override - { - } }; void PCB_TEST_FRAME::OnMenuFileOpen( wxCommandEvent& WXUNUSED( event ) )