From 3bd24e6a4041f63bcba178f2b6cf9ba49271bd02 Mon Sep 17 00:00:00 2001 From: John Beard Date: Tue, 24 Jul 2018 20:55:51 +0100 Subject: [PATCH] Add global zone fill/unfill to Edit menu This means if you don't know the hotkey, the tool action can be reached without having to activate the zone tool. Fixes: lp:1783250 https://bugs.launchpad.net/kicad/+bug/1783250 --- pcbnew/menubar_pcb_editor.cpp | 15 +++++++++++++++ pcbnew/tools/pcb_actions.cpp | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index ed3ba934f..a00c68a7e 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -485,6 +485,21 @@ void prepareEditMenu( wxMenu* aParentMenu, bool aUseGal ) KiBitmap( swap_layer_xpm ) ); aParentMenu->AppendSeparator(); + + text = AddHotkeyName( _( "Fill &All Zones" ), g_Board_Editor_Hotkeys_Descr, + HK_ZONE_FILL_OR_REFILL ); + AddMenuItem( aParentMenu, ID_POPUP_PCB_FILL_ALL_ZONES, + text, _( "Fill all zones on the board" ), + KiBitmap( fill_zone_xpm ) ); + + text = AddHotkeyName( _( "&Unfill All Zones" ), g_Board_Editor_Hotkeys_Descr, + HK_ZONE_REMOVE_FILLED ); + AddMenuItem( aParentMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES, + text, _( "Remove fill from all zones on the board" ), + KiBitmap( zone_unfill_xpm ) ); + + aParentMenu->AppendSeparator(); + AddMenuItem( aParentMenu, ID_PCB_GLOBAL_DELETE, _( "&Global Deletions..." ), _( "Delete tracks, footprints and graphic items from board" ), diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 2569bc342..cded71f54 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -206,6 +206,12 @@ OPT PCB_ACTIONS::TranslateLegacyId( int aId ) case ID_EDIT_PASTE: return PCB_ACTIONS::pasteFromClipboard.MakeEvent(); + + case ID_POPUP_PCB_FILL_ALL_ZONES: + return PCB_ACTIONS::zoneFillAll.MakeEvent(); + + case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: + return PCB_ACTIONS::zoneUnfillAll.MakeEvent(); } return OPT(); -- 2.17.1