From 2e62944648e13710165637b8dbc28c743d74791e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 15 Jul 2018 00:41:40 +0200 Subject: [PATCH] menu: fix return value of getSelectedLine() for RC_timeout and RC_setup This fixes the bahaviour of StartPosSelectionMenu in moviebrowser. When this menu was closed by its timeout or RC_setup was pressed the movie starts anyway. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/70cbc65483598c1a69d57b0dbc179e1864598405 Author: vanhofen Date: 2018-07-15 (Sun, 15 Jul 2018) Origin message was: ------------------ - menu: fix return value of getSelectedLine() for RC_timeout and RC_setup This fixes the bahaviour of StartPosSelectionMenu in moviebrowser. When this menu was closed by its timeout or RC_setup was pressed the movie starts anyway. ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.h | 2 +- src/gui/widget/menue.cpp | 6 ++++-- src/gui/widget/menue.h | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index d51cca4a2..6f0a9fbe1 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -409,7 +409,7 @@ class CMenuWidgetSelection : public CMenuWidget { public: CMenuWidgetSelection(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 30) : CMenuWidget(Name, Icon, mwidth){;}; - int getSelectedLine(void){return exit_pressed ? -1 : selected;}; + int getSelectedLine(void){return no_action ? -1 : selected;}; }; class CFileChooser : public CMenuWidget diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index eea668d05..c56a60521 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -790,7 +790,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) bool bAllowRepeatLR = false; CVFD::MODES oldLcdMode = CVFD::getInstance()->getMode(); - exit_pressed = false; + no_action = false; frameBuffer->Lock(); @@ -1019,14 +1019,16 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; case (CRCInput::RC_home): - exit_pressed = true; + no_action = true; msg = CRCInput::RC_timeout; break; case (CRCInput::RC_timeout): + no_action = true; break; case (CRCInput::RC_setup): //close any menu on menu-key { + no_action = true; msg = CRCInput::RC_timeout; retval = menu_return::RETURN_EXIT_ALL; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 11165f095..75a387548 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -588,7 +588,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals unsigned int item_start_y; unsigned int current_page; unsigned int total_pages; - bool exit_pressed; + bool no_action; int from_wizard; bool fade; bool washidden; @@ -640,7 +640,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals void initSelectable(); int getSelected()const { return selected; }; void move(int xoff, int yoff); - int getSelectedLine(void)const {return exit_pressed ? -1 : selected;}; + int getSelectedLine(void)const {return no_action ? -1 : selected;}; void setWizardMode(int _from_wizard) { from_wizard = _from_wizard;}; void enableFade(bool _enable) { fade = _enable; }; void enableSaveScreen(bool enable);