From 9f1e2e34b7562b955a77d176fc77f5bf9ee6a256 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 3 Jun 2019 02:46:08 +0100 Subject: [PATCH] Move some dupicated tools to common tools. --- common/tool/actions.cpp | 9 ++++ cvpcb/display_footprints_frame.cpp | 20 +++------ cvpcb/tools/cvpcb_actions.h | 5 --- cvpcb/tools/cvpcb_control.cpp | 4 +- cvpcb/tools/cvpcb_selection_tool.cpp | 18 +------- eeschema/sch_edit_frame.cpp | 2 +- eeschema/tools/ee_actions.h | 1 - eeschema/tools/ee_selection_tool.cpp | 4 -- gerbview/menubar.cpp | 2 +- gerbview/toolbars_gerber.cpp | 4 +- gerbview/tools/gerbview_actions.cpp | 1 - gerbview/tools/gerbview_actions.h | 7 --- gerbview/tools/gerbview_control.cpp | 12 ------ gerbview/tools/gerbview_selection_tool.cpp | 7 +-- include/tool/actions.h | 4 ++ pagelayout_editor/CMakeLists.txt | 1 - pagelayout_editor/tools/pl_actions.cpp | 43 ------------------- pagelayout_editor/tools/pl_actions.h | 3 +- pagelayout_editor/tools/pl_selection_tool.cpp | 4 -- pcbnew/toolbars_footprint_editor.cpp | 6 +-- pcbnew/toolbars_pcb_editor.cpp | 4 +- pcbnew/tools/edit_tool.cpp | 7 +-- qa/qa_utils/pcb_test_frame.cpp | 2 +- 23 files changed, 36 insertions(+), 134 deletions(-) delete mode 100644 pagelayout_editor/tools/pl_actions.cpp diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index 76e1c09a1e..b938f1fbf7 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -344,6 +344,15 @@ TOOL_ACTION ACTIONS::highContrastDec( "common.Control.highContrastDec", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_HIGHCONTRAST_DEC ), "", "" ); +TOOL_ACTION ACTIONS::selectionTool( "common.InteractiveSelection.selectionTool", + AS_GLOBAL, 0, _( "Select item(s)" ), "", + cursor_xpm, AF_ACTIVATE ); + +TOOL_ACTION ACTIONS::measureTool( "common.InteractiveEdit.measureTool", + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MEASURE_TOOL ), + _( "Measure Tool" ), _( "Interactively measure distance between points" ), + measurement_xpm, AF_ACTIVATE ); + TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_3D_VIEWER ), _( "3D Viewer" ), _( "Show 3D viewer window" ), diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 3e68758fae..d76c18b085 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -50,8 +50,8 @@ #include #include #include -#include #include +#include #include // Colors for layers and items @@ -63,14 +63,6 @@ BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME ) EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay ) EVT_CHOICE( ID_ON_ZOOM_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectZoom ) EVT_CHOICE( ID_ON_GRID_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectGrid ) - - /* - EVT_TOOL and EVT_UPDATE_UI for: - ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, - ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, - ID_TB_OPTIONS_SHOW_PADS_SKETCH - are managed in PCB_BASE_FRAME - */ END_EVENT_TABLE() @@ -209,8 +201,8 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar() // TODO: these can be moved to the 'proper' right vertical toolbar if and when there are // actual tools to put there. That, or I'll get around to implementing configurable // toolbars. - m_optionsToolBar->Add( CVPCB_ACTIONS::selectionTool, ACTION_TOOLBAR::TOGGLE ); - m_optionsToolBar->Add( CVPCB_ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::selectionTool, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->AddSeparator(); m_optionsToolBar->Add( ACTIONS::toggleGrid, ACTION_TOOLBAR::TOGGLE ); @@ -460,11 +452,11 @@ void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel() void DISPLAY_FOOTPRINTS_FRAME::SyncMenusAndToolbars() { - m_mainToolBar->Toggle( CVPCB_ACTIONS::zoomTool, GetToolId() == ID_ZOOM_SELECTION ); + m_mainToolBar->Toggle( ACTIONS::zoomTool, GetToolId() == ID_ZOOM_SELECTION ); m_mainToolBar->Refresh(); - m_optionsToolBar->Toggle( CVPCB_ACTIONS::selectionTool, GetToolId() == ID_NO_TOOL_SELECTED ); - m_optionsToolBar->Toggle( CVPCB_ACTIONS::measureTool, GetToolId() == ID_TB_MEASUREMENT_TOOL ); + m_optionsToolBar->Toggle( ACTIONS::selectionTool, GetToolId() == ID_NO_TOOL_SELECTED ); + m_optionsToolBar->Toggle( ACTIONS::measureTool, GetToolId() == ID_TB_MEASUREMENT_TOOL ); m_optionsToolBar->Toggle( ACTIONS::metricUnits, GetUserUnits() != INCHES ); m_optionsToolBar->Toggle( ACTIONS::imperialUnits, GetUserUnits() == INCHES ); m_optionsToolBar->Refresh(); diff --git a/cvpcb/tools/cvpcb_actions.h b/cvpcb/tools/cvpcb_actions.h index 0fa0fb6ae6..9fb87597ec 100644 --- a/cvpcb/tools/cvpcb_actions.h +++ b/cvpcb/tools/cvpcb_actions.h @@ -46,11 +46,6 @@ public: /// Activation of the selection tool static TOOL_ACTION selectionActivate; - /// Tool selection - static TOOL_ACTION selectionTool; - static TOOL_ACTION measureTool; - - ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override { return OPT(); } }; diff --git a/cvpcb/tools/cvpcb_control.cpp b/cvpcb/tools/cvpcb_control.cpp index c217fad545..8e3eebe420 100644 --- a/cvpcb/tools/cvpcb_control.cpp +++ b/cvpcb/tools/cvpcb_control.cpp @@ -24,9 +24,9 @@ */ #include -#include "cvpcb_actions.h" -#include "cvpcb_control.h" #include +#include +#include using namespace std::placeholders; diff --git a/cvpcb/tools/cvpcb_selection_tool.cpp b/cvpcb/tools/cvpcb_selection_tool.cpp index bd72a5390c..e527055431 100644 --- a/cvpcb/tools/cvpcb_selection_tool.cpp +++ b/cvpcb/tools/cvpcb_selection_tool.cpp @@ -18,7 +18,6 @@ */ #include - #include using namespace std::placeholders; @@ -29,28 +28,15 @@ using namespace std::placeholders; #include #include #include +#include #include #include -#include -// JEY TODO: move all these actions to tool/actions.cpp -// Selection tool actions TOOL_ACTION CVPCB_ACTIONS::selectionActivate( "cvpcb.InteractiveSelection", AS_GLOBAL, 0, "", "", NULL, AF_ACTIVATE ); // No description, it is not supposed to be shown anywhere -// Selection tool actions -TOOL_ACTION CVPCB_ACTIONS::selectionTool( "cvpcb.InteractiveSelection.selectionTool", - AS_GLOBAL, 0, - _( "Select item(s)" ), "", - cursor_xpm, AF_ACTIVATE ); - -TOOL_ACTION CVPCB_ACTIONS::measureTool( "cvpcb.InteractiveSelection.measureTool", - AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MEASURE_TOOL ), - _( "Measure Tool" ), _( "Interactively measure distance between points" ), - measurement_xpm, AF_ACTIVATE ); - CVPCB_SELECTION_TOOL::CVPCB_SELECTION_TOOL() : TOOL_INTERACTIVE( "cvpcb.InteractiveSelection" ), @@ -235,6 +221,6 @@ const KIGFX::VIEW_GROUP::ITEMS SELECTION::updateDrawList() const void CVPCB_SELECTION_TOOL::setTransitions() { Go( &CVPCB_SELECTION_TOOL::Main, CVPCB_ACTIONS::selectionActivate.MakeEvent() ); - Go( &CVPCB_SELECTION_TOOL::MeasureTool, CVPCB_ACTIONS::measureTool.MakeEvent() ); + Go( &CVPCB_SELECTION_TOOL::MeasureTool, ACTIONS::measureTool.MakeEvent() ); } diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 69b2b0f1c6..c9fb8a2538 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::setupTools() m_toolManager->InitTools(); // Run the selection tool, it is supposed to be always active - m_toolManager->InvokeTool( "eeschema.InteractiveSelection" ); + m_toolManager->RunAction( EE_ACTIONS::selectionActivate ); GetCanvas()->SetEventDispatcher( m_toolDispatcher ); } diff --git a/eeschema/tools/ee_actions.h b/eeschema/tools/ee_actions.h index 701640a838..f56de03f6c 100644 --- a/eeschema/tools/ee_actions.h +++ b/eeschema/tools/ee_actions.h @@ -73,7 +73,6 @@ public: static TOOL_ACTION unlock; // Schematic Tools - static TOOL_ACTION selectionTool; static TOOL_ACTION pickerTool; static TOOL_ACTION placeSymbol; static TOOL_ACTION placePower; diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 0b2c3b6bb4..3fb90cd4eb 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -51,10 +51,6 @@ TOOL_ACTION EE_ACTIONS::selectionActivate( "eeschema.InteractiveSelection", AS_GLOBAL, 0, "", "", // No description, not shown anywhere nullptr, AF_ACTIVATE ); -TOOL_ACTION EE_ACTIONS::selectionTool( "eeschema.InteractiveSelection.selectionTool", - AS_GLOBAL, 0, _( "Select item(s)" ), "", - cursor_xpm, AF_ACTIVATE ); - TOOL_ACTION EE_ACTIONS::selectNode( "eeschema.InteractiveSelection.SelectNode", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SELECT_NODE ), _( "Select Node" ), _( "Select a connection item under the cursor" ) ); diff --git a/gerbview/menubar.cpp b/gerbview/menubar.cpp index 5caa07895f..1338c99280 100644 --- a/gerbview/menubar.cpp +++ b/gerbview/menubar.cpp @@ -232,7 +232,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar() toolsMenu->Add( _( "&Show Source..." ), _( "Show source file for the current layer" ), ID_GERBVIEW_SHOW_SOURCE, tools_xpm ); - toolsMenu->Add( GERBVIEW_ACTIONS::measureTool ); + toolsMenu->Add( ACTIONS::measureTool ); toolsMenu->AppendSeparator(); toolsMenu->Add( _( "Clear Current Layer..." ), _( "Clear the selected graphic layer" ), diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index ac77db6c6b..b8fd0f0228 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -220,8 +220,8 @@ void GERBVIEW_FRAME::ReCreateOptToolbar() // TODO: these can be moved to the 'proper' vertical toolbar if and when there are // actual tools to put there. That, or I'll get around to implementing configurable // toolbars. - m_optionsToolBar->Add( GERBVIEW_ACTIONS::selectionTool, ACTION_TOOLBAR::TOGGLE ); - m_optionsToolBar->Add( GERBVIEW_ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::selectionTool, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->AddSeparator(); m_optionsToolBar->Add( ACTIONS::toggleGrid, ACTION_TOOLBAR::TOGGLE ); diff --git a/gerbview/tools/gerbview_actions.cpp b/gerbview/tools/gerbview_actions.cpp index 6cbac22242..545b4b0b23 100644 --- a/gerbview/tools/gerbview_actions.cpp +++ b/gerbview/tools/gerbview_actions.cpp @@ -38,7 +38,6 @@ OPT GERBVIEW_ACTIONS::TranslateLegacyId( int aId ) case ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS: return GERBVIEW_ACTIONS::highlightAttribute.MakeEvent(); - break; } return OPT(); diff --git a/gerbview/tools/gerbview_actions.h b/gerbview/tools/gerbview_actions.h index 94e81298fb..1383d364bb 100644 --- a/gerbview/tools/gerbview_actions.h +++ b/gerbview/tools/gerbview_actions.h @@ -56,8 +56,6 @@ public: /// Activation of the edit tool static TOOL_ACTION properties; - static TOOL_ACTION measureTool; - // Display modes static TOOL_ACTION linesDisplayOutlines; static TOOL_ACTION flashedDisplayOutlines; @@ -69,15 +67,10 @@ public: // Layer control static TOOL_ACTION layerPrev; static TOOL_ACTION layerNext; - static TOOL_ACTION layerAlphaInc; - static TOOL_ACTION layerAlphaDec; - static TOOL_ACTION layerToggle; static TOOL_ACTION layerChanged; // notification // Miscellaneous - static TOOL_ACTION selectionTool; - static TOOL_ACTION zoomTool; static TOOL_ACTION showHelp; // Highlighting diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index cc267752e1..3b5211df0d 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -29,11 +29,6 @@ #include "gerbview_control.h" #include "gerbview_selection_tool.h" -TOOL_ACTION GERBVIEW_ACTIONS::selectionTool( "gerbview.Control.selectionTool", - AS_GLOBAL, 0, - _( "Select item(s)" ), "", - cursor_xpm, AF_ACTIVATE ); - TOOL_ACTION GERBVIEW_ACTIONS::layerChanged( "gerbview.Control.layerChanged", AS_GLOBAL, 0, "", "", @@ -240,13 +235,6 @@ int GERBVIEW_CONTROL::LayerPrev( const TOOL_EVENT& aEvent ) } -int GERBVIEW_CONTROL::SwitchUnits( const TOOL_EVENT& aEvent ) -{ - m_frame->ChangeUserUnits( m_frame->GetUserUnits() == INCHES ? MILLIMETRES : INCHES ); - return 0; -} - - int GERBVIEW_CONTROL::ShowHelp( const TOOL_EVENT& aEvent ) { DisplayHotkeyList( m_frame, m_frame->GetHotkeyConfig() ); diff --git a/gerbview/tools/gerbview_selection_tool.cpp b/gerbview/tools/gerbview_selection_tool.cpp index bed32dbf32..597a26ed48 100644 --- a/gerbview/tools/gerbview_selection_tool.cpp +++ b/gerbview/tools/gerbview_selection_tool.cpp @@ -69,11 +69,6 @@ TOOL_ACTION GERBVIEW_ACTIONS::selectionClear( "gerbview.InteractiveSelection.Cle AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere -TOOL_ACTION GERBVIEW_ACTIONS::measureTool( "gerbview.InteractiveSelection.measureTool", - AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MEASURE_TOOL ), - _( "Measure Tool" ), _( "Interactively measure distance between points" ), - measurement_xpm, AF_ACTIVATE ); - class HIGHLIGHT_MENU: public ACTION_MENU { @@ -477,7 +472,7 @@ void GERBVIEW_SELECTION_TOOL::setTransitions() Go( &GERBVIEW_SELECTION_TOOL::ClearSelection, GERBVIEW_ACTIONS::selectionClear.MakeEvent() ); Go( &GERBVIEW_SELECTION_TOOL::SelectItem, GERBVIEW_ACTIONS::selectItem.MakeEvent() ); Go( &GERBVIEW_SELECTION_TOOL::UnselectItem, GERBVIEW_ACTIONS::unselectItem.MakeEvent() ); - Go( &GERBVIEW_SELECTION_TOOL::MeasureTool, GERBVIEW_ACTIONS::measureTool.MakeEvent() ); + Go( &GERBVIEW_SELECTION_TOOL::MeasureTool, ACTIONS::measureTool.MakeEvent() ); } diff --git a/include/tool/actions.h b/include/tool/actions.h index 91c65881ab..895aeaf66e 100644 --- a/include/tool/actions.h +++ b/include/tool/actions.h @@ -135,6 +135,10 @@ public: static TOOL_ACTION togglePolarCoords; static TOOL_ACTION resetLocalCoords; + // Common Tools + static TOOL_ACTION selectionTool; + static TOOL_ACTION measureTool; + // Misc static TOOL_ACTION show3DViewer; static TOOL_ACTION configurePaths; diff --git a/pagelayout_editor/CMakeLists.txt b/pagelayout_editor/CMakeLists.txt index 100060f829..e5647b7140 100644 --- a/pagelayout_editor/CMakeLists.txt +++ b/pagelayout_editor/CMakeLists.txt @@ -28,7 +28,6 @@ set( PL_EDITOR_SRCS menubar.cpp toolbars_pl_editor.cpp - tools/pl_actions.cpp tools/pl_selection_tool.cpp tools/pl_drawing_tools.cpp tools/pl_edit_tool.cpp diff --git a/pagelayout_editor/tools/pl_actions.cpp b/pagelayout_editor/tools/pl_actions.cpp deleted file mode 100644 index a0f577769f..0000000000 --- a/pagelayout_editor/tools/pl_actions.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 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 Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include -#include -#include "pl_actions.h" - - -OPT PL_ACTIONS::TranslateLegacyId( int aId ) -{ - switch( aId ) - { - case ID_MOUSE_CLICK: - return ACTIONS::cursorClick.MakeEvent(); - - case ID_MOUSE_DOUBLECLICK: - return ACTIONS::cursorDblClick.MakeEvent(); - } - - return OPT(); -} diff --git a/pagelayout_editor/tools/pl_actions.h b/pagelayout_editor/tools/pl_actions.h index 1aacd0cf15..0ba006e7bc 100644 --- a/pagelayout_editor/tools/pl_actions.h +++ b/pagelayout_editor/tools/pl_actions.h @@ -59,7 +59,6 @@ public: static TOOL_ACTION selectionMenu; // Tools - static TOOL_ACTION selectionTool; static TOOL_ACTION pickerTool; static TOOL_ACTION placeText; static TOOL_ACTION placeImage; @@ -80,7 +79,7 @@ public: static TOOL_ACTION toggleBackground; ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() - virtual OPT TranslateLegacyId( int aId ) override; + virtual OPT TranslateLegacyId( int aId ) override { return OPT(); } }; diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index a4e2463e6a..7dab7a81d1 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -49,10 +49,6 @@ TOOL_ACTION PL_ACTIONS::selectionActivate( "plEditor.InteractiveSelection", AS_GLOBAL, 0, "", "", // No description, not shown anywhere nullptr, AF_ACTIVATE ); -TOOL_ACTION PL_ACTIONS::selectionTool( "plEditor.InteractiveSelection.selectionTool", - AS_GLOBAL, 0, _( "Select item(s)" ), "", - cursor_xpm, AF_ACTIVATE ); - TOOL_ACTION PL_ACTIONS::selectionMenu( "plEditor.InteractiveSelection.SelectionMenu", AS_GLOBAL, 0, "", "" ); // No description, it is not supposed to be shown anywhere diff --git a/pcbnew/toolbars_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp index f0dec2b12b..9e0851e2b0 100644 --- a/pcbnew/toolbars_footprint_editor.cpp +++ b/pcbnew/toolbars_footprint_editor.cpp @@ -159,7 +159,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateVToolbar() KiScaledSeparator( m_drawToolBar, this ); m_drawToolBar->Add( PCB_ACTIONS::setAnchor, ACTION_TOOLBAR::TOGGLE ); m_drawToolBar->Add( PCB_ACTIONS::gridSetOrigin, ACTION_TOOLBAR::TOGGLE ); - m_drawToolBar->Add( PCB_ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); + m_drawToolBar->Add( ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); m_drawToolBar->Realize(); } @@ -211,7 +211,7 @@ void FOOTPRINT_EDIT_FRAME::SyncMenusAndToolbars() m_optionsToolBar->Toggle( ACTIONS::highContrastMode, opts->m_ContrastModeDisplay ); m_optionsToolBar->Refresh(); - m_drawToolBar->Toggle( PCB_ACTIONS::selectionTool, GetToolId() == ID_NO_TOOL_SELECTED ); + m_drawToolBar->Toggle( ACTIONS::selectionTool, GetToolId() == ID_NO_TOOL_SELECTED ); m_drawToolBar->Toggle( PCB_ACTIONS::placePad, GetToolId() == ID_MODEDIT_PAD_TOOL ); m_drawToolBar->Toggle( PCB_ACTIONS::drawLine, GetToolId() == ID_MODEDIT_LINE_TOOL ); m_drawToolBar->Toggle( PCB_ACTIONS::drawCircle, GetToolId() == ID_MODEDIT_CIRCLE_TOOL ); @@ -221,6 +221,6 @@ void FOOTPRINT_EDIT_FRAME::SyncMenusAndToolbars() m_drawToolBar->Toggle( PCB_ACTIONS::deleteTool, GetToolId() == ID_MODEDIT_DELETE_TOOL ); m_drawToolBar->Toggle( PCB_ACTIONS::setAnchor, GetToolId() == ID_MODEDIT_ANCHOR_TOOL ); m_drawToolBar->Toggle( PCB_ACTIONS::gridSetOrigin, GetToolId() == ID_MODEDIT_PLACE_GRID_COORD ); - m_drawToolBar->Toggle( PCB_ACTIONS::measureTool, GetToolId() == ID_MODEDIT_MEASUREMENT_TOOL ); + m_drawToolBar->Toggle( ACTIONS::measureTool, GetToolId() == ID_MODEDIT_MEASUREMENT_TOOL ); m_drawToolBar->Refresh(); } diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 43889f2f68..31b5f9de19 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -419,7 +419,7 @@ void PCB_EDIT_FRAME::ReCreateVToolbar() KiScaledSeparator( m_drawToolBar, this ); m_drawToolBar->Add( PCB_ACTIONS::drillOrigin, ACTION_TOOLBAR::TOGGLE ); m_drawToolBar->Add( PCB_ACTIONS::gridSetOrigin, ACTION_TOOLBAR::TOGGLE ); - m_drawToolBar->Add( PCB_ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); + m_drawToolBar->Add( ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); m_drawToolBar->Realize(); } @@ -817,6 +817,6 @@ void PCB_EDIT_FRAME::SyncMenusAndToolbars() m_drawToolBar->Toggle( PCB_ACTIONS::deleteTool, GetToolId() == ID_PCB_DELETE_ITEM_BUTT ); m_drawToolBar->Toggle( PCB_ACTIONS::drillOrigin, GetToolId() == ID_PCB_PLACE_OFFSET_COORD_BUTT ); m_drawToolBar->Toggle( PCB_ACTIONS::gridSetOrigin, GetToolId() == ID_PCB_PLACE_GRID_COORD_BUTT ); - m_drawToolBar->Toggle( PCB_ACTIONS::measureTool, GetToolId() == ID_PCB_MEASUREMENT_TOOL ); + m_drawToolBar->Toggle( ACTIONS::measureTool, GetToolId() == ID_PCB_MEASUREMENT_TOOL ); m_drawToolBar->Refresh(); } diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index d7b2ff90ba..45b7007588 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -149,11 +149,6 @@ TOOL_ACTION PCB_ACTIONS::properties( "pcbnew.InteractiveEdit.properties", _( "Properties..." ), _( "Displays item properties dialog" ), config_xpm ); -TOOL_ACTION PCB_ACTIONS::measureTool( "pcbnew.InteractiveEdit.measureTool", - AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MEASURE_TOOL ), - _( "Measuring Tool" ), _( "Interactively measure distance between points" ), - measurement_xpm, AF_ACTIVATE ); - TOOL_ACTION PCB_ACTIONS::updateUnits( "pcbnew.InteractiveEdit.updateUnits", AS_GLOBAL, 0, "", "" ); @@ -1490,7 +1485,7 @@ void EDIT_TOOL::setTransitions() Go( &EDIT_TOOL::editFootprintInFpEditor, PCB_ACTIONS::editFootprintInFpEditor.MakeEvent() ); Go( &EDIT_TOOL::ExchangeFootprints, PCB_ACTIONS::updateFootprints.MakeEvent() ); Go( &EDIT_TOOL::ExchangeFootprints, PCB_ACTIONS::exchangeFootprints.MakeEvent() ); - Go( &EDIT_TOOL::MeasureTool, PCB_ACTIONS::measureTool.MakeEvent() ); + Go( &EDIT_TOOL::MeasureTool, ACTIONS::measureTool.MakeEvent() ); Go( &EDIT_TOOL::copyToClipboard, ACTIONS::copy.MakeEvent() ); Go( &EDIT_TOOL::cutToClipboard, ACTIONS::cut.MakeEvent() ); diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp index 04b403fa2e..02fa0128d0 100644 --- a/qa/qa_utils/pcb_test_frame.cpp +++ b/qa/qa_utils/pcb_test_frame.cpp @@ -212,7 +212,7 @@ PCB_TEST_FRAME::PCB_TEST_FRAME( wxFrame* frame, const wxString& title, const wxP m_toolManager->InitTools(); m_galPanel->SetEventDispatcher( m_toolDispatcher.get() ); - m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" ); + m_toolManager->InvokeTool( "common.InteractiveSelection" ); #endif SetBoard( new BOARD );