From 64c5c0a9ba01f590d15bd0969d92d1473daf6600 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 6 Mar 2017 12:42:54 -0600 Subject: Add TWRP app install to landscape and watch themes Change-Id: Id48245218dc3ee3c6506521ce0134e6a579b6f4a --- gui/action.cpp | 9 ++-- gui/theme/common/landscape.xml | 111 ++++++++++++++++++++++++++++++++++++++--- gui/theme/common/watch.xml | 108 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 213 insertions(+), 15 deletions(-) (limited to 'gui') diff --git a/gui/action.cpp b/gui/action.cpp index 3899f5047..a39515828 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1892,7 +1892,7 @@ int GUIAction::checkforapp(std::string arg __unused) LOGINFO("Unable to read sdk version from build prop\n"); else LOGINFO("SDK version too low for TWRP app (%i < 14)\n", sdkver); - DataManager::SetValue("tw_app_install_status", 1); // 0 = no status, 1 = not installed, 2 = already installed + DataManager::SetValue("tw_app_install_status", 1); // 0 = no status, 1 = not installed, 2 = already installed or do not install goto exit; } if (PartitionManager.Mount_By_Path("/system", false)) { @@ -1905,7 +1905,7 @@ int GUIAction::checkforapp(std::string arg __unused) install_path += "/twrpapp"; if (TWFunc::Path_Exists(install_path)) { LOGINFO("App found at '%s'\n", install_path.c_str()); - DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed + DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install goto exit; } } @@ -1920,11 +1920,14 @@ int GUIAction::checkforapp(std::string arg __unused) continue; closedir(d); LOGINFO("App found at '%s/%s'\n", parent_path, p->d_name); - DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed + DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install goto exit; } closedir(d); } + } else { + LOGINFO("Data partition cannot be mounted during app check\n"); + DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install } } else simulate_progress_bar(); diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index 8ca508f51..6d544833f 100644 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -726,7 +726,7 @@ tw_action=reboot - tw_action_param=system + tw_reboot_param=system tw_has_action2=0 tw_text1={@no_os1=No OS Installed! Are you} tw_text2={@no_osrb=sure you wish to reboot?} @@ -972,7 +972,7 @@ - %tw_action_param% + appcheck @@ -981,6 +981,28 @@ + + + + + + + + + %tw_reboot_param% + + + + + rebootapp + + + + + %tw_reboot_param% + + +