From 95848d32b2ca78503fe971cecd3ec7f4924b0e30 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 21 May 2016 21:42:27 +0200 Subject: [PATCH] hdd_menu: add key confirmation to hdd-check result Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5b6421b8b0d1289892f90e1f3cec03c26132fe84 Author: vanhofen Date: 2016-05-21 (Sat, 21 May 2016) Origin message was: ------------------ - hdd_menu: add key confirmation to hdd-check result ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/hdd_menu.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 5b3cf5730..a8afb2431 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -1010,6 +1010,11 @@ int CHDDMenuHandler::checkDevice(std::string dev) int percent = 0, opercent = 0; char buf[256] = { 0 }; + bool loop; + uint64_t timeoutEnd; + neutrino_msg_t msg; + neutrino_msg_data_t data; + std::string devname = "/dev/" + dev; printf("CHDDMenuHandler::checkDevice: dev %s\n", dev.c_str()); @@ -1079,7 +1084,16 @@ int CHDDMenuHandler::checkDevice(std::string dev) progress->showGlobalStatus(100); progress->showStatusMessageUTF(buf); - sleep(2); + + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + loop = true; + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_ok || msg == CRCInput::RC_home) + loop = false; + } + progress->hide(); delete progress;