From 1b190166eb1295c6339f6100e4fbb92c81b81ea6 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 5 Dec 2016 15:25:19 -0600 Subject: Add boot slot support Change-Id: I7eaf80e327985f53791f90fbdebad022a9650d31 --- gui/action.cpp | 13 +++++++ gui/objects.hpp | 1 + gui/theme/common/languages/en.xml | 6 ++++ gui/theme/common/portrait.xml | 76 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) (limited to 'gui') 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 @@ Enable compression Skip MD5 generation during backup Disable free space check before backup + Current Slot: %tw_active_slot% + Slot A + Slot B + Changing Boot Slot + Changing Boot Slot Complete Refresh Sizes Swipe to Backup Append Date @@ -675,5 +680,6 @@ path: {1} not found in partititon list Copied kernel log to {1} Include Kernel Log + Error changing bootloader boot slot to {1} 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 @@ + + + + {@current_boot_slot=Current Slot: %tw_active_slot%} + + + + + + main @@ -2779,6 +2817,44 @@ + + + + {@current_boot_slot=Current Slot: %tw_active_slot%} + + + + + + main -- cgit v1.2.3