diff options
Diffstat (limited to 'gui/action.cpp')
-rw-r--r-- | gui/action.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
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); |