27 #ifndef GENERIC_PROGRESS_REPORTER_H 28 #define GENERIC_PROGRESS_REPORTER_H 52 void AddPhases(
int aNumPhases )
override;
57 virtual void BeginPhase(
int aPhase )
override;
67 virtual void AdvancePhase(
const wxString& aMessage )
override;
72 virtual void Report(
const wxString& aMessage )
override;
106 void SetTitle(
const wxString& aTitle )
override { }
void AdvanceProgress() override
Increment the progress bar length (inside the current virtual zone).
std::atomic_int m_progress
std::atomic_int m_maxProgress
int currentProgress() const
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
A progress reporter interface for use in multi-threaded environments.
virtual bool updateUI()=0
virtual void Report(const wxString &aMessage) override
Display aMessage in the progress bar dialog.
void SetNumPhases(int aNumPhases) override
Set the number of phases.
void SetMaxProgress(int aMaxProgress) override
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
virtual void BeginPhase(int aPhase) override
Initialize the aPhase virtual zone of the dialog progress bar.
bool KeepRefreshing(bool aWait=false) override
Update the UI dialog.
std::atomic_int m_numPhases
PROGRESS_REPORTER_BASE(int aNumPhases)
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.
bool IsCancelled() const override
virtual ~PROGRESS_REPORTER_BASE()
std::atomic_bool m_cancelled
void AddPhases(int aNumPhases) override
void SetTitle(const wxString &aTitle) override
Change the title displayed on the window caption.
virtual void SetCurrentProgress(double aProgress) override
Set the progress value to aProgress (0..1).