Slightly cleaner impl.

This commit is contained in:
Jeff Young 2022-02-17 12:48:29 +00:00
parent 9584849aba
commit 662fb40605
2 changed files with 6 additions and 8 deletions

View File

@ -133,10 +133,10 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
button->Bind( wxEVT_COMMAND_HYPERLINK, button->Bind( wxEVT_COMMAND_HYPERLINK,
std::function<void( wxHyperlinkEvent& aEvent )>( std::function<void( wxHyperlinkEvent& aEvent )>(
[frame]( wxHyperlinkEvent& aEvent ) [frame]( wxHyperlinkEvent& aEvent )
{ {
frame->ShowBoardSetupDialog( _( "Rules" ) ); frame->ShowBoardSetupDialog( _( "Rules" ) );
} ) ); } ) );
infobar->RemoveAllButtons(); infobar->RemoveAllButtons();
infobar->AddButton( button ); infobar->AddButton( button );
@ -157,10 +157,7 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
if( filler.Fill( toFill ) ) if( filler.Fill( toFill ) )
{ {
if( aReporter ) filler.GetProgressReporter()->AdvancePhase();
aReporter->AdvancePhase();
else
reporter->AdvancePhase();
commit.Push( _( "Fill Zone(s)" ), true, true, false ); commit.Push( _( "Fill Zone(s)" ), true, true, false );
frame->m_ZoneFillsDirty = false; frame->m_ZoneFillsDirty = false;

View File

@ -43,6 +43,7 @@ public:
~ZONE_FILLER(); ~ZONE_FILLER();
void SetProgressReporter( PROGRESS_REPORTER* aReporter ); void SetProgressReporter( PROGRESS_REPORTER* aReporter );
PROGRESS_REPORTER* GetProgressReporter() const { return m_progressReporter; }
/** /**
* Fills the given list of zones. Invalidates connectivity - it is up to the caller to obtain * Fills the given list of zones. Invalidates connectivity - it is up to the caller to obtain