summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-25 16:01:29 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-25 16:10:48 +0100
commit6ed34b7f61c144a09d457d608290eea81aae702d (patch)
treef1d6a3d3b680fb69e7e9520e4e92e564f594e119 /gui
parentConvert AOSP commands to ORS for encrypted devices (diff)
downloadandroid_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.gz
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.bz2
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.lz
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.xz
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.zst
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/action.cpp53
-rwxr-xr-xgui/devices/1024x600/res/ui.xml20
-rw-r--r--gui/devices/1024x768/res/ui.xml20
-rw-r--r--gui/devices/1280x800/res/ui.xml20
-rw-r--r--gui/devices/1920x1200/res/ui.xml20
-rw-r--r--gui/devices/2560x1600/res/ui.xml22
-rw-r--r--gui/devices/320x480/res/ui.xml20
-rw-r--r--gui/devices/480x800/res/ui.xml20
-rw-r--r--gui/devices/480x854/res/ui.xml20
-rw-r--r--gui/devices/540x960/res/ui.xml20
-rw-r--r--gui/devices/720x1280/res/ui.xml24
-rwxr-xr-xgui/devices/800x1280/res/ui.xml20
-rwxr-xr-xgui/devices/800x480/res/ui.xml20
-rw-r--r--gui/gui.cpp1
14 files changed, 93 insertions, 207 deletions
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
{
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index 4bed8502b..8a14faffd 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -3451,26 +3451,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3507,7 +3494,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index 1cdd77ab7..21d429c62 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -3451,26 +3451,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3507,7 +3494,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index 11fa7dc44..9c8430453 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -3451,26 +3451,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3507,7 +3494,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index c829e9b73..40df4a877 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -3451,26 +3451,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3507,7 +3494,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index ac00deeb6..d2f5a1308 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -3451,26 +3451,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3507,7 +3494,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
@@ -3528,7 +3518,7 @@
<sort name="tw_gui_sort_order" />
<icon folder="folder_icon" file="file_icon" />
<background color="%fileselector_background%" />
- <font resource="font" spacing="%fileselector_spacing%" color="%text_color%" />
+ <font resource="filelist" spacing="%fileselector_spacing%" color="%text_color%" />
<filter folders="1" files="0" />
<path name="tw_terminal_location" default="/" />
<data name="tw_terminal" />
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index 778d49f55..2cc401b2b 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -3428,26 +3428,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3484,7 +3471,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index 0c2c03f99..bb214c8ff 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -3427,26 +3427,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3483,7 +3470,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index b1cf00c6d..819d24569 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -3426,26 +3426,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3482,7 +3469,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index 481beca5f..e4cf5c03d 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -3427,26 +3427,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3483,7 +3470,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index eed6c58fa..e3eabf366 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -1556,9 +1556,7 @@
</object>
<object type="action">
- <conditions>
- <condition var1="tw_operation_state" var2="1" />
- </conditions>
+ <condition var1="tw_operation_state" var2="1" />
<actions>
<action function="set">tw_back=backup</action>
<action function="set">tw_complete_text1=Backup Complete</action>
@@ -3434,26 +3432,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3490,7 +3475,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index 88768f14b..2b6e3efee 100755
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -3428,26 +3428,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3484,7 +3471,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index 6096c57af..b41811132 100755
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -3451,26 +3451,13 @@
<text>Cancel</text>
<image resource="main_button" />
<actions>
+ <action function="set">tw_page_done=1</action>
<action function="page">main</action>
</actions>
</object>
<object type="template" name="keyboardtemplate" />
- <object type="action">
- <touch key="home" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
- <object type="action">
- <touch key="back" />
- <actions>
- <action function="page">main</action>
- </actions>
- </object>
-
<object type="template" name="footer" />
</page>
@@ -3507,7 +3494,10 @@
<condition var1="tw_operation_state" var2="1" />
<condition var1="tw_operation_status" op="=" var2="0" />
</conditions>
- <action function="page">main</action>
+ <actions>
+ <action function="set">tw_page_done=1</action>
+ <action function="page">main</action>
+ </actions>
</object>
</page>
diff --git a/gui/gui.cpp b/gui/gui.cpp
index c431d8fe0..92eab2983 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -615,6 +615,7 @@ extern "C" int gui_startPage(const char* page_name)
gGuiInputRunning = 1;
}
+ DataManager::SetValue("tw_page_done", 0);
return runPage(page_name);
}