From 96af84a4094c2018d35c792e33813c07344f553c Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 5 Jan 2015 14:58:36 -0600 Subject: Allow flashing of images via the GUI - Use the Images... button in the lower right of the zip install page - Unify image flashing functions between restore and image flash - boot and recovery partitions are flashable by default - use fstab flag flashimg=1 or 0 to override defaults - file system partitions are currently not flashable Change-Id: I822dc446030543c55d2153e219d67a1292374ffc --- gui/action.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gui/action.cpp') diff --git a/gui/action.cpp b/gui/action.cpp index 750d73b8d..96f620957 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -201,6 +201,7 @@ GUIAction::GUIAction(xml_node<>* node) mf["decrypt_backup"] = &GUIAction::decrypt_backup; mf["repair"] = &GUIAction::repair; mf["changefilesystem"] = &GUIAction::changefilesystem; + mf["flashimage"] = &GUIAction::flashimage; } // First, get the action @@ -1651,6 +1652,24 @@ int GUIAction::stopmtp(std::string arg) return 0; } +int GUIAction::flashimage(std::string arg) +{ + int op_status = 0; + + operation_start("Flash Image"); + string path, filename, full_filename; + DataManager::GetValue("tw_zip_location", path); + DataManager::GetValue("tw_file", filename); + full_filename = path + "/" + filename; + if (PartitionManager.Flash_Image(full_filename)) + op_status = 0; // success + else + op_status = 1; // fail + + operation_end(op_status); + return 0; +} + int GUIAction::getKeyByName(std::string key) { if (key == "home") return KEY_HOME; -- cgit v1.2.3