summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/action.cpp')
-rw-r--r--gui/action.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index aac2c313f..d98a81420 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -1180,9 +1180,8 @@ int GUIAction::nandroid(std::string arg)
DataManager::GetValue(TW_BACKUP_NAME, Backup_Name);
string auto_gen = gui_lookup("auto_generate", "(Auto Generate)");
if (Backup_Name == auto_gen || Backup_Name == gui_lookup("curr_date", "(Current Date)") || Backup_Name == "0" || Backup_Name == "(" || PartitionManager.Check_Backup_Name(true) == 0) {
- ret = PartitionManager.Run_Backup();
- }
- else {
+ ret = PartitionManager.Run_Backup(false);
+ } else {
operation_end(1);
return -1;
}
@@ -1728,12 +1727,16 @@ int GUIAction::flashimage(std::string arg __unused)
{
int op_status = 0;
+ PartitionSettings part_settings;
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))
+ DataManager::GetValue("tw_zip_location", part_settings.Restore_Name);
+ DataManager::GetValue("tw_file", part_settings.Backup_FileName);
+ unsigned long long total_bytes = TWFunc::Get_File_Size(part_settings.Restore_Name + "/" + part_settings.Backup_FileName);
+ ProgressTracking progress(total_bytes);
+ part_settings.progress = &progress;
+ part_settings.adbbackup = false;
+ part_settings.PM_Method = PM_RESTORE;
+ if (PartitionManager.Flash_Image(&part_settings))
op_status = 0; // success
else
op_status = 1; // fail