summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
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;