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
This commit is contained in:
Maciej Suminski 2018-03-07 09:01:13 +01:00
parent c69db6cf8f
commit a3562b354b
1 changed files with 8 additions and 18 deletions

View File

@ -36,6 +36,9 @@
#include <pcb_edit_frame.h>
#include <macros.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <class_board.h>
#include <class_track.h>
#include <class_zone.h>
@ -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<ZONE_CONTAINER*> toFill;
for( auto zone : GetBoard()->Zones() )
{
toFill.push_back(zone);
}
ZONE_FILLER filler( GetBoard() );
std::unique_ptr<WX_PROGRESS_REPORTER> 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;
}