From b49751bbf6464c36c421523710043f8908bcae99 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 24 Nov 2014 11:17:28 +0100 Subject: [PATCH] CShellWindow: optimize error review after error message Show close button in window, give user possibility to read error listing before close the window! Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/04ad939ea74bf39261b1183958ed818851c93464 Author: Thilo Graf Date: 2014-11-24 (Mon, 24 Nov 2014) --- src/gui/widget/shellwindow.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index e9771be34..1f7f27b1a 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -201,25 +201,31 @@ void CShellWindow::exec() void CShellWindow::showResult() { if (textBox){ + bool show_button = false; bool exit = false; - if (mode & ACKNOWLEDGE){ - int b_width = 150; - int b_height = 35; - int xpos = frameBuffer->getScreenWidth() - b_width; - int ypos = frameBuffer->getScreenHeight() - b_height; - CComponentsButton btn(xpos, ypos, b_width, b_height, LOCALE_MESSAGEBOX_OK, NEUTRINO_ICON_BUTTON_OKAY, NULL, true, true); - btn.paint(); + if (mode & ACKNOWLEDGE){ + show_button = true; } else if (mode & ACKNOWLEDGE_MSG){ if (*res != 0){ DisplayErrorMessage("Please press button"); + show_button = true; }else{ DisplayInfoMessage("...ready. Please press OK"); exit = true; } } + if (show_button){ + int b_width = 150; + int b_height = 35; + int xpos = frameBuffer->getScreenWidth() - b_width; + int ypos = frameBuffer->getScreenHeight() - b_height; + CComponentsButton btn(xpos, ypos, b_width, b_height, LOCALE_MESSAGEBOX_OK, NEUTRINO_ICON_BUTTON_OKAY, NULL, true, true); + btn.paint(); + } + neutrino_msg_t msg; neutrino_msg_data_t data; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);