summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-01-05 21:58:36 +0100
committerDees Troy <dees_troy@teamw.in>2015-01-09 23:07:07 +0100
commit96af84a4094c2018d35c792e33813c07344f553c (patch)
tree025b4d6f6d5d7c517ef32370661cbf9147a58bb6 /gui/action.cpp
parentgui: fix action threading if background thread is busy (diff)
downloadandroid_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.tar
android_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.tar.gz
android_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.tar.bz2
android_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.tar.lz
android_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.tar.xz
android_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.tar.zst
android_bootable_recovery-96af84a4094c2018d35c792e33813c07344f553c.zip
Diffstat (limited to '')
-rw-r--r--gui/action.cpp19
1 files changed, 19 insertions, 0 deletions
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;