summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-09-10 19:36:41 +0200
committerGerrit Code Review <gerrit@198.50.184.117>2013-09-12 16:11:13 +0200
commitb21cc64ca8f5a9d936d6ece7da120bc0bc65b49f (patch)
tree47e1443a2b0591117a6ce5e20a5c3f05f61cca62 /gui/action.cpp
parentMerge "Kang in older minzip for building in CM9 & CM7" into twrp2.7 (diff)
downloadandroid_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.tar
android_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.tar.gz
android_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.tar.bz2
android_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.tar.lz
android_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.tar.xz
android_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.tar.zst
android_bootable_recovery-b21cc64ca8f5a9d936d6ece7da120bc0bc65b49f.zip
Diffstat (limited to 'gui/action.cpp')
-rw-r--r--gui/action.cpp25
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);