summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorbigbiff <bigbiff@teamw.in>2015-12-13 00:30:21 +0100
committerEthan Yonker <dees_troy@teamw.in>2016-08-01 05:20:18 +0200
commitce8f83c48d200106ff61ad530c863b15c16949d9 (patch)
tree2908e48dfb44eae96c49113a177108f3cbb714f2 /gui/action.cpp
parentBlack screen patch for some HiSilicon devices (FBIOPAN_DISPLAY) (diff)
downloadandroid_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.gz
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.bz2
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.lz
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.xz
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.zst
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.zip
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