menue: fix lcd4l-support for directly started items; ...

this fixes missing lcd4l-support in mode_upnp


Origin commit data
------------------
Branch: ni/coolstream
Commit: da62cd195b
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-26 (Sun, 26 Mar 2017)

Origin message was:
------------------
- menue: fix lcd4l-support for directly started items; ...

this fixes missing lcd4l-support in mode_upnp


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-03-26 23:21:29 +02:00
parent b80fd4d8c3
commit 3ba4cfb126
2 changed files with 20 additions and 3 deletions

View File

@@ -95,6 +95,8 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I
height = 0; height = 0;
actObserv = NULL; actObserv = NULL;
parent_widget = NULL; parent_widget = NULL;
lcd4l_text = ""; //NI lcd4l-support
} }
void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX) void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX)
@@ -222,15 +224,19 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text
CVFD::getInstance()->showMenuText(0, str, -1, true); CVFD::getInstance()->showMenuText(0, str, -1, true);
//NI lcd4l-support //NI lcd4l-support
if(g_settings.lcd4l_support) if(g_settings.lcd4l_support)
LCD4l->CreateFile("/tmp/lcd/menu", str, g_settings.lcd4l_convert); lcd4l_text = str;
} }
else else
{ {
CVFD::getInstance()->showMenuText(0, left_text, -1, true); CVFD::getInstance()->showMenuText(0, left_text, -1, true);
//NI lcd4l-support //NI lcd4l-support
if (g_settings.lcd4l_support) if (g_settings.lcd4l_support)
LCD4l->CreateFile("/tmp/lcd/menu", left_text, g_settings.lcd4l_convert); lcd4l_text = left_text;
} }
//NI lcd4l-support
if (g_settings.lcd4l_support)
LCD4l->CreateFile("/tmp/lcd/menu", lcd4l_text, g_settings.lcd4l_convert);
} }
//left text //left text
@@ -938,6 +944,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
case (CRCInput::RC_ok): case (CRCInput::RC_ok):
{ {
if(hasItem() && selected > -1 && (int)items.size() > selected) { if(hasItem() && selected > -1 && (int)items.size() > selected) {
//NI lcd4l-support
LCD4l->RemoveFile("/tmp/lcd/menu");
//exec this item... //exec this item...
CMenuItem* item = items[selected]; CMenuItem* item = items[selected];
if (!item->isSelectable()) if (!item->isSelectable())
@@ -945,6 +954,11 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
item->msg = msg; item->msg = msg;
fader.StopFade(); fader.StopFade();
int rv = item->exec( this ); int rv = item->exec( this );
//NI lcd4l-support
if (g_settings.lcd4l_support)
LCD4l->CreateFile("/tmp/lcd/menu", item->lcd4l_text, g_settings.lcd4l_convert);
switch ( rv ) { switch ( rv ) {
case menu_return::RETURN_EXIT_ALL: case menu_return::RETURN_EXIT_ALL:
retval = menu_return::RETURN_EXIT_ALL; retval = menu_return::RETURN_EXIT_ALL;

View File

@@ -197,6 +197,9 @@ class CMenuItem : public CComponentsSignals
void activateNotify(void); void activateNotify(void);
virtual void disableByCondition(const menu_item_disable_cond_t& condition); virtual void disableByCondition(const menu_item_disable_cond_t& condition);
void setParentWidget(CMenuWidget* parent){parent_widget = parent;} void setParentWidget(CMenuWidget* parent){parent_widget = parent;}
//NI lcd4l-support
std::string lcd4l_text;
}; };
class CMenuSeparator : public CMenuItem class CMenuSeparator : public CMenuItem