From 6ed34b7f61c144a09d457d608290eea81aae702d Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Fri, 25 Jan 2013 15:01:29 +0000 Subject: Use GUI for ORS instead of console only --- gui/action.cpp | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'gui/action.cpp') diff --git a/gui/action.cpp b/gui/action.cpp index 9c3ee5916..19a8b69a0 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1013,27 +1013,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) int load_theme = 1; DataManager::SetValue(TW_IS_ENCRYPTED, 0); - DataManager::ReadSettingsFile(); - // Check for the SCRIPT_FILE_TMP first as these are AOSP recovery commands - // that we converted to ORS commands during boot in recovery.cpp. - // Run those first. - if (TWFunc::Path_Exists(SCRIPT_FILE_TMP)) { - ui_print("Processing AOSP recovery commands...\n"); - if (OpenRecoveryScript::run_script_file() == 0) { - usleep(2000000); // Sleep for 2 seconds before rebooting - TWFunc::tw_reboot(rb_system); - load_theme = 0; - } - } - // Check for the ORS file in /cache and attempt to run those commands. - if (OpenRecoveryScript::check_for_script_file()) { - ui_print("Processing OpenRecoveryScript file...\n"); - if (OpenRecoveryScript::run_script_file() == 0) { - usleep(2000000); // Sleep for 2 seconds before rebooting - TWFunc::tw_reboot(rb_system); - load_theme = 0; - } - } if (load_theme) { int has_datamedia; @@ -1083,7 +1062,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) string result, Sideload_File; if (!PartitionManager.Mount_Current_Storage(true)) { - DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support operation_end(1, simulate); return 0; } @@ -1114,7 +1092,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) } } } - DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support operation_end(ret, simulate); return 0; } @@ -1130,6 +1107,36 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support return 0; } + if (function == "openrecoveryscript") { + operation_start("OpenRecoveryScript"); + if (simulate) { + simulate_progress_bar(); + } else { + // Check for the SCRIPT_FILE_TMP first as these are AOSP recovery commands + // that we converted to ORS commands during boot in recovery.cpp. + // Run those first. + int reboot = 0; + if (TWFunc::Path_Exists(SCRIPT_FILE_TMP)) { + ui_print("Processing AOSP recovery commands...\n"); + if (OpenRecoveryScript::run_script_file() == 0) { + reboot = 1; + } + } + // Check for the ORS file in /cache and attempt to run those commands. + if (OpenRecoveryScript::check_for_script_file()) { + ui_print("Processing OpenRecoveryScript file...\n"); + if (OpenRecoveryScript::run_script_file() == 0) { + reboot = 1; + } + } + if (reboot) { + usleep(2000000); // Sleep for 2 seconds before rebooting + TWFunc::tw_reboot(rb_system); + } else { + DataManager::SetValue("tw_page_done", 1); + } + } + } } else { -- cgit v1.2.3