From fbf3c10e45c20f8fe6bd1ac49ffe220035b9c454 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Wed, 24 Jun 2009 09:36:20 -0700 Subject: improve updater progress bar Let recovery accept set_progress commands to control progress over the 'current segment' of the bar. Add a set_progress() builtin to the updater binary. --- install.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'install.c') diff --git a/install.c b/install.c index cbb35805c..ab19478cf 100644 --- a/install.c +++ b/install.c @@ -210,7 +210,15 @@ try_update_binary(const char *path, ZipArchive *zip) { // progress bar. The program can write single-line commands: // // progress - // fill up of the progress bar over seconds. + // fill up the next part of of the progress bar + // over seconds. If is zero, use + // set_progress commands to manually control the + // progress of this segment of the bar + // + // set_progress + // should be between 0.0 and 1.0; sets the + // progress bar within the segment defined by the most + // recent progress command. // // firmware <"hboot"|"radio"> // arrange to install the contents of in the @@ -261,6 +269,10 @@ try_update_binary(const char *path, ZipArchive *zip) { ui_show_progress(fraction * (1-VERIFICATION_PROGRESS_FRACTION), seconds); + } else if (strcmp(command, "set_progress") == 0) { + char* fraction_s = strtok(NULL, " \n"); + float fraction = strtof(fraction_s, NULL); + ui_set_progress(fraction); } else if (strcmp(command, "firmware") == 0) { char* type = strtok(NULL, " \n"); char* filename = strtok(NULL, " \n"); -- cgit v1.2.3