Pull ROM info from build.prop for backup names

Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768
diff --git a/data.cpp b/data.cpp
index c766f00..0b0ad15 100644
--- a/data.cpp
+++ b/data.cpp
@@ -853,7 +853,7 @@
 	mValues.insert(make_pair("tw_backup_list", make_pair("/system;/data;/boot;", 1)));
 #endif
 	mConstValues.insert(make_pair(TW_MIN_SYSTEM_VAR, TW_MIN_SYSTEM_SIZE));
-	mValues.insert(make_pair(TW_BACKUP_NAME, make_pair("(Current Date)", 0)));
+	mValues.insert(make_pair(TW_BACKUP_NAME, make_pair("(Auto Generate)", 0)));
 	mValues.insert(make_pair(TW_BACKUP_SYSTEM_VAR, make_pair("1", 1)));
 	mValues.insert(make_pair(TW_BACKUP_DATA_VAR, make_pair("1", 1)));
 	mValues.insert(make_pair(TW_BACKUP_BOOT_VAR, make_pair("1", 1)));
diff --git a/gui/action.cpp b/gui/action.cpp
index d67e697..78e8625 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -701,6 +701,27 @@
 		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 @@
 				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);
diff --git a/gui/button.cpp b/gui/button.cpp
index 9fc85a0..3f9c2df 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -110,10 +110,11 @@
 	}
 
 	int x, y, w, h;
+	TextPlacement = TOP_LEFT;
 	if (mButtonImg) {
 		mButtonImg->GetRenderPos(x, y, w, h);
 	} else if (hasFill) {
-		LoadPlacement(node->first_node("placement"), &x, &y, &w, &h);
+		LoadPlacement(node->first_node("placement"), &x, &y, &w, &h, &TextPlacement);
 	}
 	SetRenderPos(x, y, w, h);
 	return;
@@ -150,14 +151,12 @@
 		mButtonLabel->GetCurrentBounds(w, h);
 		if (w != mTextW) {
 			mTextW = w;
-			// As a special case, we'll allow large text which automatically moves it to the right.
-			if (mTextW > mRenderW)
-			{
+			if (TextPlacement == CENTER_X_ONLY) {
+				mTextX = ((mRenderW - mRenderX) / 2);
+			} else if (mTextW > mRenderW) { // As a special case, we'll allow large text which automatically moves it to the right.
 				mTextX = mRenderW + mRenderX + 5;
 				mRenderW += mTextW + 5;
-			}
-			else
-			{
+			} else {
 				mTextX = mRenderX + ((mRenderW - mTextW) / 2);
 			}
 			mButtonLabel->SetRenderPos(mTextX, mTextY);
@@ -231,14 +230,12 @@
 	if (mButtonLabel)   mButtonLabel->GetCurrentBounds(mTextW, mTextH);
 	if (mTextW)
 	{
-		// As a special case, we'll allow large text which automatically moves it to the right.
-		if (mTextW > mRenderW)
-		{
+		if (TextPlacement == CENTER_X_ONLY) {
+			mTextX = ((mRenderW - mRenderX) / 2);
+		} else if (mTextW > mRenderW) { // As a special case, we'll allow large text which automatically moves it to the right.
 			mTextX = mRenderW + mRenderX + 5;
 			mRenderW += mTextW + 5;
-		}
-		else
-		{
+		} else {
 			mTextX = mRenderX + ((mRenderW - mTextW) / 2);
 		}
 	}
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index 2b7d20e..bbcaae1 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -1733,8 +1733,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1776,12 +1776,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%cancel_button_y%" />
+				<placement x="%col2_x%" y="%cancel_button_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col3_x%" y="%cancel_button_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel / Clear</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1791,7 +1800,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1799,7 +1808,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index b625174..97b98c0 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -1733,8 +1733,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1776,12 +1776,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%cancel_button_y%" />
+				<placement x="%col2_x%" y="%cancel_button_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col3_x%" y="%cancel_button_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel / Clear</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1791,7 +1800,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1799,7 +1808,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml
index 25d3ed8..5ba884b 100644
--- a/gui/devices/1080x1920/res/ui.xml
+++ b/gui/devices/1080x1920/res/ui.xml
@@ -1341,7 +1341,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1459,8 +1459,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1502,12 +1502,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1517,7 +1526,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1525,7 +1534,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index b86f991..66861f2 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -1733,8 +1733,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1776,12 +1776,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%cancel_button_y%" />
+				<placement x="%col2_x%" y="%cancel_button_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col3_x%" y="%cancel_button_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel / Clear</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1791,7 +1800,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1799,7 +1808,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index 157005f..d1a7829 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -1733,8 +1733,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1776,12 +1776,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%cancel_button_y%" />
+				<placement x="%col2_x%" y="%cancel_button_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col3_x%" y="%cancel_button_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel / Clear</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1791,7 +1800,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1799,7 +1808,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index 3d6b65f..23b7c3e 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -169,7 +169,7 @@
 		<variable name="filemanager_select_y" value="1360" />
 		<variable name="backup_name_text_y" value="440" />
 		<variable name="backup_name_button_y" value="950" />
-		<variable name="col_right_x" value="1870" />
+		<variable name="col_right_x" value="2510" />
 		<variable name="cancel_button_y" value="430" />
 		<variable name="terminal_console_y" value="0" />
 		<variable name="terminal_console_height" value="810" />
@@ -1733,8 +1733,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1776,12 +1776,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%cancel_button_y%" />
+				<placement x="%col2_x%" y="%cancel_button_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col3_x%" y="%cancel_button_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel / Clear</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1791,7 +1800,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1799,7 +1808,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index 0719a94..893c90c 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -1328,7 +1328,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1446,8 +1446,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1489,12 +1489,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1504,7 +1513,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1512,7 +1521,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index b7b527b..6900281 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -1328,7 +1328,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1446,8 +1446,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1489,12 +1489,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1504,7 +1513,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1512,7 +1521,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index cb6577f..09c5077 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -1327,7 +1327,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1445,8 +1445,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1488,12 +1488,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1503,7 +1512,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1511,7 +1520,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index 078f1ae..f636e2e 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -1328,7 +1328,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1446,8 +1446,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1489,12 +1489,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1504,7 +1513,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1512,7 +1521,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index d2896cc..316b20e 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -1341,7 +1341,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1459,8 +1459,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1502,12 +1502,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1517,7 +1526,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1525,7 +1534,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index ba7dba3..b850841 100755
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -1329,7 +1329,7 @@
 			<object type="button">
 				<highlight color="%highlight_color%" />
 				<fill color="%button_fill_color%" />
-				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" />
+				<placement x="%col1_x%" y="%row1_header_y%" w="%button_fill_full_width%" h="%button_fill_quarter_height%" placement="5" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Backup Name: %tw_backup_name%</text>
 				<actions>
@@ -1447,8 +1447,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1490,12 +1490,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_y%" />
+				<placement x="%col1_x%" y="%row2_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col2_x%" y="%row2_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1505,7 +1514,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1513,7 +1522,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index ba262bc..cbd3b7d 100755
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -1741,8 +1741,8 @@
 
 		<page name="backupname1">
 			<object type="action">
-				<condition var1="tw_backup_name" op="=" var2="(Current Date)" />
-				<action function="set">tw_backup_name=</function>
+				<condition var1="tw_backup_name" op="=" var2="(Auto Generate)" />
+				<action function="generatebackupname"></function>
 			</object>
 
 			<object type="action">
@@ -1784,12 +1784,21 @@
 
 			<object type="button">
 				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%cancel_button_y%" />
+				<placement x="%col2_x%" y="%cancel_button_y%" />
+				<font resource="font" color="%button_text_color%" />
+				<text>Append Date</text>
+				<image resource="main_button" />
+				<action function="appenddatetobackupname"></action>
+			</object>
+
+			<object type="button">
+				<highlight color="%highlight_color%" />
+				<placement x="%col3_x%" y="%cancel_button_y%" />
 				<font resource="font" color="%button_text_color%" />
 				<text>Cancel / Clear</text>
 				<image resource="main_button" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
@@ -1799,7 +1808,7 @@
 			<object type="action">
 				<touch key="home" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">main</action>
 				</actions>
 			</object>
@@ -1807,7 +1816,7 @@
 			<object type="action">
 				<touch key="back" />
 				<actions>
-					<action function="set">tw_backup_name=(Current Date)</action>
+					<action function="set">tw_backup_name=(Auto Generate)</action>
 					<action function="page">backup</action>
 				</actions>
 			</object>
diff --git a/gui/objects.hpp b/gui/objects.hpp
index d37b43e..1e272b2 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -380,6 +380,7 @@
 	bool hasFill;
 	COLOR mFillColor;
 	COLOR mHighlightColor;
+	Placement TextPlacement;
 };
 
 class GUICheckbox: public RenderObject, public ActionObject, public Conditional
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 78fbfa4..4e72117 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -670,10 +670,11 @@
 
 	DataManager::GetValue(TW_BACKUPS_FOLDER_VAR, Backup_Folder);
 	DataManager::GetValue(TW_BACKUP_NAME, Backup_Name);
-	if (Backup_Name == "(Current Date)" || Backup_Name == "0" || Backup_Name.empty()) {
-		char timestamp[255];
-		sprintf(timestamp,"%04d-%02d-%02d--%02d-%02d-%02d",t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
-		Backup_Name = timestamp;
+	if (Backup_Name == "(Current Date)") {
+		Backup_Name = TWFunc::Get_Current_Date();
+	} else if (Backup_Name == "(Auto Generate)" || Backup_Name == "0" || Backup_Name.empty()) {
+		TWFunc::Auto_Generate_Backup_Name();
+		DataManager::GetValue(TW_BACKUP_NAME, Backup_Name);
 	}
 	LOGINFO("Backup Name is: '%s'\n", Backup_Name.c_str());
 	Full_Backup_Path = Backup_Folder + "/" + Backup_Name + "/";
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 48a9552..2329972 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -950,3 +950,51 @@
 	}
 	return 0;
 }
+
+string TWFunc::Get_Current_Date() {
+	string Current_Date;
+	time_t seconds = time(0);
+	struct tm *t = localtime(&seconds);
+	char timestamp[255];
+	sprintf(timestamp,"%04d-%02d-%02d--%02d-%02d-%02d",t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+	Current_Date = timestamp;
+	return Current_Date;
+}
+
+void TWFunc::Auto_Generate_Backup_Name() {
+	bool mount_state = PartitionManager.Is_Mounted_By_Path("/system");
+	std::vector<string> buildprop;
+	if (!PartitionManager.Mount_By_Path("/system", true)) {
+		DataManager::SetValue(TW_BACKUP_NAME, Get_Current_Date());
+		return;
+	}
+	if (TWFunc::read_file("/system/build.prop", buildprop) != 0) {
+		LOGINFO("Unable to open /system/build.prop for getting backup name.\n");
+		DataManager::SetValue(TW_BACKUP_NAME, "");
+		if (!mount_state)
+			PartitionManager.UnMount_By_Path("/system", false);
+		return;
+	}
+	int line_count = buildprop.size();
+	int index;
+	size_t start_pos = 0, end_pos;
+	string propname, propvalue;
+	for (index = 0; index < line_count; index++) {
+		end_pos = buildprop.at(index).find("=", start_pos);
+		propname = buildprop.at(index).substr(start_pos, end_pos);
+		if (propname == "ro.build.display.id") {
+			propvalue = buildprop.at(index).substr(end_pos + 1, buildprop.at(index).size());
+			string Backup_Name = Get_Current_Date();
+			Backup_Name += " " + propvalue;
+			if (Backup_Name.size() > MAX_BACKUP_NAME_LEN)
+				Backup_Name.resize(MAX_BACKUP_NAME_LEN);
+			DataManager::SetValue(TW_BACKUP_NAME, Backup_Name);
+			break;
+		}
+	}
+	if (propvalue.empty()) {
+		LOGINFO("ro.build.display.id not found in build.prop\n");
+	}
+	if (!mount_state)
+		PartitionManager.UnMount_By_Path("/system", false);
+}
\ No newline at end of file
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index 4040d2e..b3019bd 100644
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -55,6 +55,8 @@
 	static int Try_Decrypting_File(string fn, string password); // -1 for some error, 0 for failed to decrypt, 1 for decrypted, 3 for decrypted and found gzip format
 	static bool Try_Decrypting_Backup(string Restore_Path, string Password); // true for success, false for failed to decrypt
 	static int Wait_For_Child(pid_t pid, int *status, string Child_Name); // Waits for pid to exit and checks exit status
+	static string Get_Current_Date(void);                               // Returns the current date in ccyy-m-dd--hh-nn-ss format
+	static void Auto_Generate_Backup_Name();                            // Populates TW_BACKUP_NAME with a backup name based on current date and ro.build.display.id from /system/build.prop
 
 private:
 	static void Copy_Log(string Source, string Destination);
diff --git a/twrp.cpp b/twrp.cpp
index d4e861d..5e1956f 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -200,7 +200,7 @@
 
 	bool Keep_Going = true;
 	if (Perform_Backup) {
-		DataManager::SetValue(TW_BACKUP_NAME, "(Current Date)");
+		DataManager::SetValue(TW_BACKUP_NAME, "(Auto Generate)");
 		if (!OpenRecoveryScript::Insert_ORS_Command("backup BSDCAE\n"))
 			Keep_Going = false;
 	}