summaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2026-11-03 12:22:03 +0100
committerGravatar Nikias Bassen2026-11-03 12:22:03 +0100
commitae8cfb4aa919000b283a0fe7db96b1a321a010d3 (patch)
treeb6b0266686236afdc7ff0cd10e8fc23fefa827e1 /src/common.h
parent8f209f9635e20b84b6eb41ce2e4ed5c0e59b38f9 (diff)
downloadidevicerestore-ae8cfb4aa919000b283a0fe7db96b1a321a010d3.tar.gz
idevicerestore-ae8cfb4aa919000b283a0fe7db96b1a321a010d3.tar.bz2
Add multi-row progress display with a global progress barHEADmaster
Replace the single-line progress bar with a terminal renderer that shows one row per active progress tag. The overall restore step (Uploading/Verifying filesystem, Flashing firmware) is a reserved "global" bar that is always drawn first. Per-component bars (e.g. SEP, RestoreRamDisk) appear below it and disappear when finalized. - Redraw in place with ANSI cursor movement; clamp line width to the terminal width (ioctl on Unix, console API on Windows, with virtual terminal mode enabled) - Erase and redraw the bars around logger() output so log lines no longer corrupt the display - Remove the global bar once a different restore step starts - When stdout is not a TTY, skip escape codes and print only the changed bar, once per 1% step - Fix progress throttling: lastprog was an int and was compared after being overwritten, so granularity was never applied - RESTORE_STEP_UPLOAD_IMG no longer drives the global bar; it already has per-component bars
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common.h b/src/common.h
index 3bb648a..c634e24 100644
--- a/src/common.h
+++ b/src/common.h
@@ -144,7 +144,7 @@ struct progress_info_entry {
uint32_t tag;
char* label;
double progress;
- int lastprog;
+ double lastprog;
};
void set_update_progress_func(void (*func)(struct progress_info_entry** list, int count));
void set_progress_granularity(double granularity);
@@ -154,6 +154,8 @@ void register_progress(uint32_t tag, const char* label);
void set_progress(uint32_t tag, double progress);
void finalize_progress(uint32_t tag);
void print_progress_bar(const char* prefix, double progress);
+void progress_display_suspend(void);
+void progress_display_resume(void);
struct tuple {
int idx;