From b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f Mon Sep 17 00:00:00 2001 From: Dees Troy Date: Tue, 10 Sep 2013 17:36:41 +0000 Subject: Pull ROM info from build.prop for backup names Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768 --- gui/action.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'gui/action.cpp') diff --git a/gui/action.cpp b/gui/action.cpp index d67e697b0..78e862526 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -701,6 +701,27 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) return 0; } + if (function == "appenddatetobackupname") + { + operation_start("AppendDateToBackupName"); + string Backup_Name; + DataManager::GetValue(TW_BACKUP_NAME, Backup_Name); + Backup_Name += TWFunc::Get_Current_Date(); + if (Backup_Name.size() > MAX_BACKUP_NAME_LEN) + Backup_Name.resize(MAX_BACKUP_NAME_LEN); + DataManager::SetValue(TW_BACKUP_NAME, Backup_Name); + operation_end(0, simulate); + return 0; + } + + if (function == "generatebackupname") + { + operation_start("GenerateBackupName"); + TWFunc::Auto_Generate_Backup_Name(); + operation_end(0, simulate); + return 0; + } + if (isThreaded) { if (function == "fileexists") @@ -893,14 +914,14 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) if (arg == "backup") { string Backup_Name; DataManager::GetValue(TW_BACKUP_NAME, Backup_Name); - if (Backup_Name == "(Current Date)" || Backup_Name == "0" || Backup_Name == "(" || PartitionManager.Check_Backup_Name(true) == 0) { + if (Backup_Name == "(Auto Generate)" || Backup_Name == "(Current Date)" || Backup_Name == "0" || Backup_Name == "(" || PartitionManager.Check_Backup_Name(true) == 0) { ret = PartitionManager.Run_Backup(); } else { operation_end(1, simulate); return -1; } - DataManager::SetValue(TW_BACKUP_NAME, "(Current Date)"); + DataManager::SetValue(TW_BACKUP_NAME, "(Auto Generate)"); } else if (arg == "restore") { string Restore_Name; DataManager::GetValue("tw_restore", Restore_Name); -- cgit v1.2.3