More progressbar improvements

This commit is contained in:
Henrik Rydgård committed 2023-07-18 15:52:14 +02:00
1 parent ecea3844b0
commit 370bb4c315
7 files changed
+52 -41

No files matched your search

+10 -1
View File
@@ -216,9 +216,14 @@ void OnScreenDisplay::ShowOnOff(const std::string &message, bool on, float durat
}
void OnScreenDisplay::SetProgressBar(std::string id, std::string &&message, float minValue, float maxValue, float progress, float delay) {
std::lock_guard<std::mutex> guard(mutex_);
_dbg_assert_(!my_isnanorinf(progress));
_dbg_assert_(!my_isnanorinf(minValue));
_dbg_assert_(!my_isnanorinf(maxValue));
double now = time_now_d();
bool found = false;
std::lock_guard<std::mutex> guard(mutex_);
for (auto &bar : bars_) {
if (bar.id == id) {
bar.minValue = minValue;
@@ -230,6 +235,10 @@ void OnScreenDisplay::SetProgressBar(std::string id, std::string &&message, floa
}
}
if (message == "dorequest.php") {
found = found;
}
ProgressBar bar;
bar.id = id;
bar.message = std::move(message);