summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2016-06-01 04:31:22 +0200
committerEthan Yonker <dees_troy@teamw.in>2016-08-19 18:06:34 +0200
commit9a2a20503c214ed25a897c34981be3aaef44c36d (patch)
treec4cf870b699812a3892ec278d493796677d99ae2 /gui/action.cpp
parentFinish creating disable_free_space_check variable (diff)
downloadandroid_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.tar
android_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.tar.gz
android_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.tar.bz2
android_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.tar.lz
android_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.tar.xz
android_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.tar.zst
android_bootable_recovery-9a2a20503c214ed25a897c34981be3aaef44c36d.zip
Diffstat (limited to 'gui/action.cpp')
-rw-r--r--gui/action.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 56336f408..328fc2c52 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -180,6 +180,7 @@ GUIAction::GUIAction(xml_node<>* node)
ADD_ACTION(cancelzip);
ADD_ACTION(queueclear);
ADD_ACTION(sleep);
+ ADD_ACTION(sleepcounter);
ADD_ACTION(appenddatetobackupname);
ADD_ACTION(generatebackupname);
ADD_ACTION(checkpartitionlist);
@@ -779,6 +780,23 @@ int GUIAction::sleep(std::string arg)
return 0;
}
+int GUIAction::sleepcounter(std::string arg)
+{
+ operation_start("SleepCounter");
+ // Ensure user notices countdown in case it needs to be cancelled
+ blankTimer.resetTimerAndUnblank();
+ int total = atoi(arg.c_str());
+ for (int t = total; t > 0; t--) {
+ int progress = (int)(((float)(total-t)/(float)total)*100.0);
+ DataManager::SetValue("ui_progress", progress);
+ ::sleep(1);
+ DataManager::SetValue("tw_sleep", t-1);
+ }
+ DataManager::SetValue("ui_progress", 100);
+ operation_end(0);
+ return 0;
+}
+
int GUIAction::appenddatetobackupname(std::string arg __unused)
{
operation_start("AppendDateToBackupName");
@@ -1024,12 +1042,6 @@ int GUIAction::flash(std::string arg)
reinject_after_flash();
PartitionManager.Update_System_Details();
- if (DataManager::GetIntValue("tw_install_reboot") > 0 && ret_val == 0) {
- gui_msg("install_reboot=Rebooting in 5 seconds");
- usleep(5000000);
- TWFunc::tw_reboot(rb_system);
- usleep(5000000); // another sleep while we wait for the reboot to occur
- }
operation_end(ret_val);
// This needs to be after the operation_end call so we change pages before we change variables that we display on the screen
DataManager::SetValue(TW_ZIP_QUEUE_COUNT, zip_queue_index);