PROGRESS_REPORTER: code formatting

This commit is contained in:
Maciej Suminski 2018-02-09 14:20:11 +01:00
parent bc7ca08f07
commit c39fd46c07
2 changed files with 23 additions and 14 deletions

View File

@ -32,7 +32,8 @@ PROGRESS_REPORTER::PROGRESS_REPORTER( int aNumPhases ) :
m_progress( 0 ), m_progress( 0 ),
m_maxProgress( 1 ) m_maxProgress( 1 )
{ {
}; }
void PROGRESS_REPORTER::BeginPhase( int aPhase ) void PROGRESS_REPORTER::BeginPhase( int aPhase )
{ {
@ -41,6 +42,7 @@ void PROGRESS_REPORTER::BeginPhase( int aPhase )
updateUI(); updateUI();
} }
void PROGRESS_REPORTER::AdvancePhase( ) void PROGRESS_REPORTER::AdvancePhase( )
{ {
m_phase++; m_phase++;
@ -48,23 +50,27 @@ void PROGRESS_REPORTER::AdvancePhase( )
updateUI(); updateUI();
} }
void PROGRESS_REPORTER::Report( const wxString& aMessage ) void PROGRESS_REPORTER::Report( const wxString& aMessage )
{ {
m_rptMessage = aMessage; m_rptMessage = aMessage;
updateUI(); updateUI();
} }
void PROGRESS_REPORTER::SetMaxProgress( int aMaxProgress ) void PROGRESS_REPORTER::SetMaxProgress( int aMaxProgress )
{ {
m_maxProgress = aMaxProgress; m_maxProgress = aMaxProgress;
updateUI(); updateUI();
} }
void PROGRESS_REPORTER::AdvanceProgress() void PROGRESS_REPORTER::AdvanceProgress()
{ {
m_progress++; m_progress++;
} }
int PROGRESS_REPORTER::currentProgress() const int PROGRESS_REPORTER::currentProgress() const
{ {
double current = ( 1.0 / (double) m_numPhases ) * double current = ( 1.0 / (double) m_numPhases ) *
@ -73,6 +79,7 @@ int PROGRESS_REPORTER::currentProgress() const
return (int)( current * 1000 ); return (int)( current * 1000 );
} }
// Please, *DO NOT* use wxPD_APP_MODAL style: it is not necessary // Please, *DO NOT* use wxPD_APP_MODAL style: it is not necessary
// (without this option the PROGRESS_REPORTER is modal for the parent frame) // (without this option the PROGRESS_REPORTER is modal for the parent frame)
// and PROGRESS_REPORTER works fine on OSX only without this style // and PROGRESS_REPORTER works fine on OSX only without this style
@ -103,6 +110,7 @@ void WX_PROGRESS_REPORTER::updateUI()
wxProgressDialog::Update( cur, m_rptMessage ); wxProgressDialog::Update( cur, m_rptMessage );
} }
void PROGRESS_REPORTER::KeepRefreshing( bool aWait ) void PROGRESS_REPORTER::KeepRefreshing( bool aWait )
{ {
#ifdef USE_OPENMP #ifdef USE_OPENMP
@ -110,6 +118,7 @@ void PROGRESS_REPORTER::KeepRefreshing( bool aWait )
{ {
updateUI(); updateUI();
wxMilliSleep( 10 ); wxMilliSleep( 10 );
if( !aWait ) if( !aWait )
return; return;
} }