summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-12-05 22:25:19 +0100
committerEthan Yonker <dees_troy@teamw.in>2016-12-13 21:04:48 +0100
commit1b190166eb1295c6339f6100e4fbb92c81b81ea6 (patch)
tree6493cc3a385c67f079d52873b97963656cf084d2 /gui
parentSupport new AB OTA zips (diff)
downloadandroid_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.tar
android_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.tar.gz
android_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.tar.bz2
android_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.tar.lz
android_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.tar.xz
android_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.tar.zst
android_bootable_recovery-1b190166eb1295c6339f6100e4fbb92c81b81ea6.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/action.cpp13
-rw-r--r--gui/objects.hpp1
-rw-r--r--gui/theme/common/languages/en.xml6
-rw-r--r--gui/theme/common/portrait.xml76
4 files changed, 96 insertions, 0 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 223d75e25..8600186ee 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -228,6 +228,7 @@ GUIAction::GUIAction(xml_node<>* node)
ADD_ACTION(changefilesystem);
ADD_ACTION(flashimage);
ADD_ACTION(twcmd);
+ ADD_ACTION(setbootslot);
}
// First, get the action
@@ -1866,3 +1867,15 @@ int GUIAction::setlanguage(std::string arg __unused)
operation_end(op_status);
return 0;
}
+
+int GUIAction::setbootslot(std::string arg)
+{
+ operation_start("Set Boot Slot");
+ if (!simulate)
+ {
+ PartitionManager.Set_Active_Slot(arg);
+ } else
+ simulate_progress_bar();
+ operation_end(0);
+ return 0;
+}
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 0d969279a..8d4484aec 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -357,6 +357,7 @@ protected:
int mountsystemtoggle(std::string arg);
int setlanguage(std::string arg);
int twcmd(std::string arg);
+ int setbootslot(std::string arg);
int simulate;
};
diff --git a/gui/theme/common/languages/en.xml b/gui/theme/common/languages/en.xml
index b82aecff4..ee772bfd9 100644
--- a/gui/theme/common/languages/en.xml
+++ b/gui/theme/common/languages/en.xml
@@ -209,6 +209,11 @@
<string name="enable_backup_comp_chk">Enable compression</string>
<string name="skip_md5_backup_chk">Skip MD5 generation during backup</string>
<string name="disable_backup_space_chk" version="2">Disable free space check before backup</string>
+ <string name="current_boot_slot">Current Slot: %tw_active_slot%</string>
+ <string name="boot_slot_a">Slot A</string>
+ <string name="boot_slot_b">Slot B</string>
+ <string name="changing_boot_slot">Changing Boot Slot</string>
+ <string name="changing_boot_slot_complete">Changing Boot Slot Complete</string>
<string name="refresh_sizes_btn">Refresh Sizes</string>
<string name="swipe_backup">Swipe to Backup</string>
<string name="append_date_btn">Append Date</string>
@@ -675,5 +680,6 @@
<string name="partition_not_found">path: {1} not found in partititon list</string>
<string name="copy_kernel_log">Copied kernel log to {1}</string>
<string name="include_kernel_log">Include Kernel Log</string>
+ <string name="unable_set_boot_slot">Error changing bootloader boot slot to {1}</string>
</resources>
</language>
diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml
index 11ae8740e..f0ba791fb 100644
--- a/gui/theme/common/portrait.xml
+++ b/gui/theme/common/portrait.xml
@@ -1699,6 +1699,44 @@
<data variable="tw_disable_free_space"/>
</checkbox>
+ <text style="text_m">
+ <condition var1="tw_has_boot_slots" var2="1"/>
+ <placement x="%center_x%" y="%row17_y%" placement="5"/>
+ <text>{@current_boot_slot=Current Slot: %tw_active_slot%}</text>
+ </text>
+
+ <button style="main_button">
+ <condition var1="tw_has_boot_slots" var2="1"/>
+ <placement x="%indent%" y="%row19_y%"/>
+ <text>{@boot_slot_a=Slot A}</text>
+ <actions>
+ <action function="set">tw_back=backup_options</action>
+ <action function="set">tw_action=setbootslot</action>
+ <action function="set">tw_action_param=A</action>
+ <action function="set">tw_has_action2=0</action>
+ <action function="set">tw_action_text1={@changing_boot_slot=Changing Boot Slot}</action>
+ <action function="set">tw_action_text2=</action>
+ <action function="set">tw_complete_text1={@changing_boot_slot_complete=Change Boot Slot Complete}</action>
+ <action function="page">action_page</action>
+ </actions>
+ </button>
+
+ <button style="main_button">
+ <condition var1="tw_has_boot_slots" var2="1"/>
+ <placement x="%center_x%" y="%row19_y%"/>
+ <text>{@boot_slot_b=Slot B}</text>
+ <actions>
+ <action function="set">tw_back=backup_options</action>
+ <action function="set">tw_action=setbootslot</action>
+ <action function="set">tw_action_param=B</action>
+ <action function="set">tw_has_action2=0</action>
+ <action function="set">tw_action_text1={@changing_boot_slot=Changing Boot Slot}</action>
+ <action function="set">tw_action_text2=</action>
+ <action function="set">tw_complete_text1={@changing_boot_slot_complete=Change Boot Slot Complete}</action>
+ <action function="page">action_page</action>
+ </actions>
+ </button>
+
<action>
<touch key="home"/>
<action function="page">main</action>
@@ -2779,6 +2817,44 @@
</actions>
</button>
+ <text style="text_m">
+ <condition var1="tw_has_boot_slots" var2="1"/>
+ <placement x="%center_x%" y="%row17_y%" placement="5"/>
+ <text>{@current_boot_slot=Current Slot: %tw_active_slot%}</text>
+ </text>
+
+ <button style="main_button">
+ <condition var1="tw_has_boot_slots" var2="1"/>
+ <placement x="%indent%" y="%row19_y%"/>
+ <text>{@boot_slot_a=Slot A}</text>
+ <actions>
+ <action function="set">tw_back=reboot</action>
+ <action function="set">tw_action=setbootslot</action>
+ <action function="set">tw_action_param=A</action>
+ <action function="set">tw_has_action2=0</action>
+ <action function="set">tw_action_text1={@changing_boot_slot=Changing Boot Slot}</action>
+ <action function="set">tw_action_text2=</action>
+ <action function="set">tw_complete_text1={@changing_boot_slot_complete=Change Boot Slot Complete}</action>
+ <action function="page">action_page</action>
+ </actions>
+ </button>
+
+ <button style="main_button">
+ <condition var1="tw_has_boot_slots" var2="1"/>
+ <placement x="%center_x%" y="%row19_y%"/>
+ <text>{@boot_slot_b=Slot B}</text>
+ <actions>
+ <action function="set">tw_back=reboot</action>
+ <action function="set">tw_action=setbootslot</action>
+ <action function="set">tw_action_param=B</action>
+ <action function="set">tw_has_action2=0</action>
+ <action function="set">tw_action_text1={@changing_boot_slot=Changing Boot Slot}</action>
+ <action function="set">tw_action_text2=</action>
+ <action function="set">tw_complete_text1={@changing_boot_slot_complete=Change Boot Slot Complete}</action>
+ <action function="page">action_page</action>
+ </actions>
+ </button>
+
<action>
<touch key="home"/>
<action function="page">main</action>