summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 765d2fe60..575605452 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -844,9 +844,13 @@ bool ScreenRecoveryUI::InitTextParams() {
return true;
}
-// TODO(xunchang) load localized text icons for the menu. (Init for screenRecoveryUI but
-// not wearRecoveryUI).
bool ScreenRecoveryUI::LoadWipeDataMenuText() {
+ // Ignores the errors since the member variables will stay as nullptr.
+ cancel_wipe_data_text_ = LoadLocalizedBitmap("cancel_wipe_data_text");
+ factory_data_reset_text_ = LoadLocalizedBitmap("factory_data_reset_text");
+ try_again_text_ = LoadLocalizedBitmap("try_again_text");
+ wipe_data_confirmation_text_ = LoadLocalizedBitmap("wipe_data_confirmation_text");
+ wipe_data_menu_header_text_ = LoadLocalizedBitmap("wipe_data_menu_header_text");
return true;
}
@@ -1250,6 +1254,20 @@ size_t ScreenRecoveryUI::ShowPromptWipeDataMenu(const std::vector<std::string>&
return ShowMenu(std::move(wipe_data_menu), true, key_handler);
}
+size_t ScreenRecoveryUI::ShowPromptWipeDataConfirmationMenu(
+ const std::vector<std::string>& backup_headers, const std::vector<std::string>& backup_items,
+ const std::function<int(int, bool)>& key_handler) {
+ auto confirmation_menu =
+ CreateMenu(wipe_data_confirmation_text_.get(),
+ { cancel_wipe_data_text_.get(), factory_data_reset_text_.get() }, backup_headers,
+ backup_items, 0);
+ if (confirmation_menu == nullptr) {
+ return 0;
+ }
+
+ return ShowMenu(std::move(confirmation_menu), true, key_handler);
+}
+
bool ScreenRecoveryUI::IsTextVisible() {
std::lock_guard<std::mutex> lg(updateMutex);
int visible = show_text;