- 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.

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-07-15 00:41:40 +02:00
committed by Thilo Graf
parent 2bf474958e
commit 28fab3c6da
3 changed files with 7 additions and 5 deletions

View File

@@ -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

View File

@@ -769,7 +769,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();
@@ -990,14 +990,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;
}

View File

@@ -585,7 +585,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;
@@ -637,7 +637,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);