PROGRESS_REPORTER: KeepRefreshing shouldn't block on non-OpenMP systems

Fixes: lp:1737277
* https://bugs.launchpad.net/kicad/+bug/1737277
This commit is contained in:
Tomasz Włostowski 2017-12-14 00:32:45 +01:00
parent 941ebe376c
commit 2831268b60
2 changed files with 12 additions and 8 deletions

View File

@ -99,13 +99,17 @@ void WX_PROGRESS_REPORTER::updateUI()
wxProgressDialog::Update( cur, m_rptMessage );
}
void PROGRESS_REPORTER::KeepRefreshing()
void PROGRESS_REPORTER::KeepRefreshing( bool aWait )
{
while ( m_progress < m_maxProgress && m_maxProgress > 0)
{
updateUI();
#ifdef USE_OPENMP
#ifdef USE_OPENMP
while ( m_progress < m_maxProgress && m_maxProgress > 0)
{
updateUI();
wxMilliSleep(10);
#endif
}
if ( !aWait )
return;
}
#else
updateUI();
#endif
}

View File

@ -43,7 +43,7 @@ class PROGRESS_REPORTER
void SetMaxProgress ( int aMaxProgress );
void AdvanceProgress( );
void KeepRefreshing();
void KeepRefreshing( bool aWait = false );
protected: