From ae60b57c3dfc5ed629e90a22c7210e97c3dc4780 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 13 Jul 2023 13:15:19 +0100 Subject: [PATCH] Add default parameter to PCB image placement action --- pcbnew/tools/pcb_actions.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 72910b8163..4060b986b1 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -35,6 +35,9 @@ #include #include +// Forward declarations for types needed in the parameters +class PCB_BITMAP; + // Actions, being statically-defined, require specialized I18N handling. We continue to // use the _() macro so that string harvesting by the I18N framework doesn't have to be // specialized, but we don't translate on initialization and instead do it in the getters. @@ -124,10 +127,14 @@ TOOL_ACTION PCB_ACTIONS::placeStackup( "pcbnew.InteractiveDrawing.placeStackup", _( "Add a board stackup table on a graphic layer" ), BITMAPS::INVALID_BITMAP, AF_ACTIVATE ); -TOOL_ACTION PCB_ACTIONS::placeImage( "pcbnew.InteractiveDrawing.placeImage", - AS_GLOBAL, 0, "", - _( "Add Image" ), _( "Add bitmap image" ), - BITMAPS::image, AF_ACTIVATE ); +TOOL_ACTION PCB_ACTIONS::placeImage( TOOL_ACTION_ARGS() + .Name( "pcbnew.InteractiveDrawing.placeImage" ) + .Scope( AS_GLOBAL ) + .MenuText( _( "Add Image" ) ) + .Tooltip( _( "Add bitmap image" ) ) + .Icon( BITMAPS::image ) + .Flags( AF_ACTIVATE ) + .Parameter( nullptr ) ); TOOL_ACTION PCB_ACTIONS::placeText( "pcbnew.InteractiveDrawing.text", AS_GLOBAL,