From fb580d369418d907a0ca60d3bf0802fcd8d6f653 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 8 Sep 2018 20:18:14 -0700 Subject: [PATCH] pcbnew: center the zone fill confirmation dialog The zone fill confirmation should follow the parent dialog. In the case of plotting, this is the plot window. --- pcbnew/zone_filler.cpp | 9 +++++---- pcbnew/zone_filler.h | 4 +++- pcbnew/zones_by_polygon_fill_functions.cpp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index c3e1d1998a..7130de6420 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -65,9 +65,9 @@ extern void CreateThermalReliefPadPolygon( SHAPE_POLY_SET& aCornerBuffer, static double s_thermalRot = 450; // angle of stubs in thermal reliefs for round pads static const bool s_DumpZonesWhenFilling = false; -ZONE_FILLER::ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit ) : - m_board( aBoard ), m_commit( aCommit ), m_progressReporter( nullptr ), - m_next( 0 ), m_count_done( 0 ) +ZONE_FILLER::ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit, wxWindow* aActiveWindow ) : + m_board( aBoard ), m_commit( aCommit ), m_activeWindow( aActiveWindow ), + m_progressReporter( nullptr ), m_next( 0 ), m_count_done( 0 ) { } @@ -185,7 +185,8 @@ bool ZONE_FILLER::Fill( std::vector aZones, bool aCheck ) if( aCheck ) { - bool cancel = !outOfDate || !IsOK( nullptr, _( "Zone fills are out-of-date. Re-fill?" ) ); + bool cancel = !outOfDate || !IsOK( m_activeWindow, + _( "Zone fills are out-of-date. Re-fill?" ) ); if( m_progressReporter ) { diff --git a/pcbnew/zone_filler.h b/pcbnew/zone_filler.h index 27f50a1a51..db271fafb3 100644 --- a/pcbnew/zone_filler.h +++ b/pcbnew/zone_filler.h @@ -38,7 +38,8 @@ class SHAPE_LINE_CHAIN; class ZONE_FILLER { public: - ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit = nullptr ); + ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit = nullptr, + wxWindow* aActiveWindow = nullptr ); ~ZONE_FILLER(); void SetProgressReporter( WX_PROGRESS_REPORTER* aReporter ); @@ -117,6 +118,7 @@ private: BOARD* m_board; COMMIT* m_commit; + wxWindow* m_activeWindow; WX_PROGRESS_REPORTER* m_progressReporter; std::atomic_size_t m_next; // An index into the vector of zones to fill. diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index 4a472713f1..fec311d952 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -119,7 +119,7 @@ void PCB_EDIT_FRAME::Check_All_Zones( wxWindow* aActiveWindow ) std::unique_ptr progressReporter( new WX_PROGRESS_REPORTER( aActiveWindow, _( "Checking Zones" ), 3 ) ); - ZONE_FILLER filler( GetBoard(), &commit ); + ZONE_FILLER filler( GetBoard(), &commit, aActiveWindow ); filler.SetProgressReporter( progressReporter.get() ); if( filler.Fill( toFill, true ) )