From a3562b354bb29f968e975429cf31187b3d78538e Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 7 Mar 2018 09:01:13 +0100 Subject: [PATCH] Refresh zones in the view on a DRC run PCB_EDIT_FRAME::Fill_All_Zones() now reuses ZONE_FILLER tool to avoid code duplication. Fixes: lp:1753901 * https://bugs.launchpad.net/kicad/+bug/1753901 --- pcbnew/zones_by_polygon_fill_functions.cpp | 26 +++++++--------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index bfba818af5..a234eefbe2 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -36,6 +36,9 @@ #include #include +#include +#include + #include #include #include @@ -90,24 +93,11 @@ void PCB_EDIT_FRAME::Delete_OldZone_Fill( SEGZONE* aZone, timestamp_t aTimestamp } } -int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow * aActiveWindow ) + +int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow* aActiveWindow ) { - wxBusyCursor dummy; - - std::vector toFill; - - for( auto zone : GetBoard()->Zones() ) - { - toFill.push_back(zone); - } - - ZONE_FILLER filler( GetBoard() ); - - std::unique_ptr progressReporter( - new WX_PROGRESS_REPORTER( aActiveWindow, _( "Fill All Zones" ), 3 ) ); - - filler.SetProgressReporter( progressReporter.get() ); - filler.Fill( toFill ); - + auto toolMgr = GetToolManager(); + wxCHECK( toolMgr, 1 ); + toolMgr->RunAction( PCB_ACTIONS::zoneFillAll, true ); return 0; }