From dde30a382ed47a3d9e1b8058bf4056eab50bf8d2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 29 Apr 2018 03:13:07 +0200 Subject: [PATCH] src/gui/widget/msgbox.cpp: add missing handling of RC_home message Required in case of usage without explicit undefined home button. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ebffa8073fdd72b254b4929d71940fee24dfbcdb Author: Thilo Graf Date: 2018-04-29 (Sun, 29 Apr 2018) --- src/gui/widget/msgbox.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 51238adcc..700698999 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -219,7 +219,7 @@ void CMsgBox::initButtons() //define default selected button from default_result if (v_buttons.size() > 1){ for (size_t i = 0; i< v_buttons.size(); i++){ - if (v_buttons[i].btn_result == result){ + if (v_buttons[i].btn_result == default_result){ ccw_footer->setSelectedButton(i); break; } @@ -313,13 +313,14 @@ int CMsgBox::exec() loop = false; } } - //***action button ok with preselected button*** + //***action button 'ok' handled with selected button and its predefined result*** if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - //***cancel button*** - else if (msg == CRCInput::RC_home) { + //***action button 'home' with general cancel result*** + else if (msg == CRCInput::RC_home){ + result = mbrCancel; loop = false; } //***ignore***