From 9d0f5c7f949296eece67585112fb0870f8a31caa Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Thu, 18 Jun 2020 18:54:58 +0200 Subject: [PATCH] PROGRESS_REPORTER: implement SetCurrentProgress() method --- common/widgets/progress_reporter.cpp | 6 ++++++ include/widgets/progress_reporter.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/common/widgets/progress_reporter.cpp b/common/widgets/progress_reporter.cpp index 05c85904cd..c3a2d1e3a8 100644 --- a/common/widgets/progress_reporter.cpp +++ b/common/widgets/progress_reporter.cpp @@ -61,6 +61,12 @@ void PROGRESS_REPORTER::SetMaxProgress( int aMaxProgress ) m_maxProgress.store( aMaxProgress ); } +void PROGRESS_REPORTER::SetCurrentProgress( double aProgress ) +{ + m_maxProgress.store( 10000 ); + m_progress.store( (int) (aProgress * 10000.0) ); +} + void PROGRESS_REPORTER::AdvanceProgress() { diff --git a/include/widgets/progress_reporter.h b/include/widgets/progress_reporter.h index 59e333a7a8..5bc099d9e1 100644 --- a/include/widgets/progress_reporter.h +++ b/include/widgets/progress_reporter.h @@ -63,6 +63,11 @@ class PROGRESS_REPORTER */ void Report( const wxString& aMessage ); + /** + * Set the progress value to aProgress (0..1) + */ + void SetCurrentProgress( double aProgress ); + /** * Fix the value thar gives the 100 precent progress bar length * (inside the current virtual zone)