From 7440630caa77869e7d264dfb9da47db2182524a2 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 28 Oct 2011 15:13:10 -0700 Subject: refactor ui functions into a class Move all the functions in ui.c to be members of a ScreenRecoveryUI class, which is a subclass of an abstract RecoveryUI class. Recovery then creates a global singleton instance of this class and then invoke the methods to drive the UI. We use this to allow substitution of a different RecoveryUI implementation for devices with radically different form factors (eg, that don't have a screen). Change-Id: I7fd8b2949d0db5a3f47c52978bca183966c86f33 --- verifier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'verifier.cpp') diff --git a/verifier.cpp b/verifier.cpp index 58ca72393..1c5a41d1b 100644 --- a/verifier.cpp +++ b/verifier.cpp @@ -25,6 +25,8 @@ #include #include +extern RecoveryUI* ui; + // Look for an RSA signature embedded in the .ZIP file comment given // the path to the zip. Verify it matches one of the given public // keys. @@ -33,7 +35,7 @@ // or no key matches the signature). int verify_file(const char* path, const RSAPublicKey *pKeys, unsigned int numKeys) { - ui_set_progress(0.0); + ui->SetProgress(0.0); FILE* f = fopen(path, "rb"); if (f == NULL) { @@ -161,7 +163,7 @@ int verify_file(const char* path, const RSAPublicKey *pKeys, unsigned int numKey so_far += size; double f = so_far / (double)signed_len; if (f > frac + 0.02 || size == so_far) { - ui_set_progress(f); + ui->SetProgress(f); frac = f; } } -- cgit v1.2.3