Browse Source

widgets: PROGRESS_REPORTER - make SetCurrentProgress() virtual, allow to change number of phases post-construction

pull/16/head
Tomasz Wlostowski 5 years ago
parent
commit
09d0aff3d6
  1. 6
      common/widgets/progress_reporter.cpp
  2. 7
      include/widgets/progress_reporter.h

6
common/widgets/progress_reporter.cpp

@ -75,6 +75,12 @@ void PROGRESS_REPORTER::AdvanceProgress()
}
void PROGRESS_REPORTER::SetNumPhases( int aNumPhases )
{
m_numPhases = aNumPhases;
}
int PROGRESS_REPORTER::currentProgress() const
{
double current = ( 1.0 / (double) m_numPhases ) *

7
include/widgets/progress_reporter.h

@ -51,6 +51,11 @@ class PROGRESS_REPORTER
{
}
/**
* sets the number of phases
*/
void SetNumPhases( int aNumPhases );
/**
* initialize the aPhase virtual zone of the dialog progress bar
*/
@ -69,7 +74,7 @@ class PROGRESS_REPORTER
/**
* Set the progress value to aProgress (0..1)
*/
void SetCurrentProgress( double aProgress );
virtual void SetCurrentProgress( double aProgress );
/**
* Fix the value thar gives the 100 precent progress bar length

Loading…
Cancel
Save