Try to fix a regression on OSX

Fixes: lp:1740909
https://bugs.launchpad.net/kicad/+bug/1740909
This commit is contained in:
jean-pierre charras 2018-01-14 17:38:48 +01:00
parent e0f819d02e
commit 63e55e9180
2 changed files with 19 additions and 6 deletions

View File

@ -408,8 +408,17 @@ void DRC::RunTests( wxTextCtrl* aMessages )
wxSafeYield(); wxSafeYield();
} }
m_pcbEditorFrame->Fill_All_Zones( aMessages ? aMessages->GetParent() : m_pcbEditorFrame, // Refill all zones
false ); // On OSX the progress bar managed by Fill_All_Zones() create issues
// when Fill_All_Zones() is called by a QuasiModal dialog
// so it is not shown on OSX, until a better fix is found
#ifdef __WXMAC__
wxWindow* caller = nullptr; // Do not show progress bar
#else
// caller (a wxTopLevelFrame) is the wxDialog or the Pcb Editor frame that call DRC:
wxWindow* caller = aMessages ? aMessages->GetParent() : m_pcbEditorFrame;
#endif
m_pcbEditorFrame->Fill_All_Zones( caller, true );
// test zone clearances to other zones // test zone clearances to other zones
if( aMessages ) if( aMessages )

View File

@ -103,13 +103,17 @@ int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose )
ZONE_FILLER filler( GetBoard() ); ZONE_FILLER filler( GetBoard() );
std::unique_ptr<WX_PROGRESS_REPORTER> progressReporter( // progressReporter must be created *only* if needed
if( aActiveWindow )
{
std::unique_ptr<WX_PROGRESS_REPORTER> progressReporter(
new WX_PROGRESS_REPORTER( aActiveWindow, _( "Fill All Zones" ), 3 ) ); new WX_PROGRESS_REPORTER( aActiveWindow, _( "Fill All Zones" ), 3 ) );
if( aVerbose )
filler.SetProgressReporter( progressReporter.get() ); filler.SetProgressReporter( progressReporter.get() );
filler.Fill( toFill );
filler.Fill( toFill ); }
else // do not use a WX_PROGRESS_REPORTER in ZONE_FILLER instance
filler.Fill( toFill );
return 0; return 0;
} }