Rework progressbar logic, implement scoped/split progressbar

Rework progressbar according to AOSP, this should fix various
issues with progressbar.

From AOSP:

   progress <frac> <secs>
       fill up the next <frac> part of of the progress bar over <secs> seconds. If <secs> is
       zero, use `set_progress` commands to manually control the progress of this segment of the
       bar.

   set_progress <frac>
       <frac> should be between 0.0 and 1.0; sets the progress bar within the segment defined by
       the most recent progress command.

Change-Id: I7f92359046288f3529cb2e98e6d54d410a248f1d
(cherry picked from commit ab16437de14fd9f1203b7e0ce82ea18eb56cae78)
This commit is contained in:
Chaosmaster
2020-02-03 15:38:02 +01:00
committed by bigbiff
parent 7b66bf503f
commit d5364a0b21
4 changed files with 53 additions and 8 deletions
+1 -1
View File
@@ -302,7 +302,7 @@ static int Run_Update_Binary(const char *path, ZipWrap *Zip, int* wipe_cache, zi
} else if (strcmp(command, "set_progress") == 0) {
char* fraction_char = strtok(NULL, " \n");
float fraction_float = strtof(fraction_char, NULL);
DataManager::SetProgress(fraction_float);
DataManager::_SetProgress(fraction_float);
} else if (strcmp(command, "ui_print") == 0) {
char* display_value = strtok(NULL, "\n");
if (display_value) {