mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
- menue: simplifying lcd code
Conflicts: src/gui/widget/menue.cpp
This commit is contained in:
@@ -94,12 +94,7 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I
|
|||||||
actObserv = NULL;
|
actObserv = NULL;
|
||||||
parent_widget = NULL;
|
parent_widget = NULL;
|
||||||
|
|
||||||
#ifdef ENABLE_GRAPHLCD
|
lcd_text = "";
|
||||||
graphlcd_text = "";
|
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_LCD4LINUX
|
|
||||||
lcd4l_text = "";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
@@ -246,35 +241,21 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text
|
|||||||
char str[len];
|
char str[len];
|
||||||
snprintf(str, len, "%s %s", left_text, right_text);
|
snprintf(str, len, "%s %s", left_text, right_text);
|
||||||
CVFD::getInstance()->showMenuText(0, str, -1, true);
|
CVFD::getInstance()->showMenuText(0, str, -1, true);
|
||||||
#ifdef ENABLE_GRAPHLCD
|
lcd_text = str;
|
||||||
if (g_settings.glcd_enable)
|
|
||||||
graphlcd_text = str;
|
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_LCD4LINUX
|
|
||||||
if(g_settings.lcd4l_support)
|
|
||||||
lcd4l_text = str;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CVFD::getInstance()->showMenuText(0, left_text, -1, true);
|
CVFD::getInstance()->showMenuText(0, left_text, -1, true);
|
||||||
#ifdef ENABLE_GRAPHLCD
|
lcd_text = left_text;
|
||||||
if (g_settings.glcd_enable)
|
|
||||||
graphlcd_text = left_text;
|
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_LCD4LINUX
|
|
||||||
if (g_settings.lcd4l_support)
|
|
||||||
lcd4l_text = left_text;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_GRAPHLCD
|
#ifdef ENABLE_GRAPHLCD
|
||||||
if (g_settings.glcd_enable)
|
if (g_settings.glcd_enable)
|
||||||
cGLCD::lockChannel(g_Locale->getText(LOCALE_MAINMENU_HEAD), graphlcd_text, 0);
|
cGLCD::lockChannel(g_Locale->getText(LOCALE_MAINMENU_HEAD), lcd_text, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_LCD4LINUX
|
#ifdef ENABLE_LCD4LINUX
|
||||||
if (g_settings.lcd4l_support)
|
if (g_settings.lcd4l_support)
|
||||||
LCD4l->CreateFile("/tmp/lcd/menu", lcd4l_text, g_settings.lcd4l_convert);
|
LCD4l->CreateFile("/tmp/lcd/menu", lcd_text, g_settings.lcd4l_convert);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1067,11 +1048,11 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
|
|
||||||
#ifdef ENABLE_GRAPHLCD
|
#ifdef ENABLE_GRAPHLCD
|
||||||
if (g_settings.glcd_enable)
|
if (g_settings.glcd_enable)
|
||||||
cGLCD::lockChannel(g_Locale->getText(LOCALE_MAINMENU_HEAD), item->graphlcd_text, 0);
|
cGLCD::lockChannel(g_Locale->getText(LOCALE_MAINMENU_HEAD), item->lcd_text, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_LCD4LINUX
|
#ifdef ENABLE_LCD4LINUX
|
||||||
if (g_settings.lcd4l_support)
|
if (g_settings.lcd4l_support)
|
||||||
LCD4l->CreateFile("/tmp/lcd/menu", item->lcd4l_text, g_settings.lcd4l_convert);
|
LCD4l->CreateFile("/tmp/lcd/menu", item->lcd_text, g_settings.lcd4l_convert);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch ( rv ) {
|
switch ( rv ) {
|
||||||
@@ -2552,7 +2533,10 @@ int CMenuSeparator::paint(bool selected)
|
|||||||
name_start_x = x + (dx >> 1) - (stringwidth >> 1);
|
name_start_x = x + (dx >> 1) - (stringwidth >> 1);
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(name_start_x-OFFSET_INNER_SMALL, y, stringwidth+2*OFFSET_INNER_SMALL, height, item_bgcolor);
|
frameBuffer->paintBoxRel(name_start_x-OFFSET_INNER_SMALL, y, stringwidth+2*OFFSET_INNER_SMALL, height, item_bgcolor);
|
||||||
|
#if 0
|
||||||
|
if ((type & LINE)) // use COL_MENUHEAD_TEXT for CMenuSeparators defined with LINE and STRING
|
||||||
|
item_color = COL_MENUHEAD_TEXT;
|
||||||
|
#endif
|
||||||
paintItemCaption(selected);
|
paintItemCaption(selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2581,6 +2565,7 @@ bool CZapProtection::check()
|
|||||||
hint = NONEXISTANT_LOCALE;
|
hint = NONEXISTANT_LOCALE;
|
||||||
int res;
|
int res;
|
||||||
std::string cPIN;
|
std::string cPIN;
|
||||||
|
// char systemstr[128];
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
cPIN = "";
|
cPIN = "";
|
||||||
@@ -2590,6 +2575,9 @@ bool CZapProtection::check()
|
|||||||
res = PINInput->exec(getParent(), "");
|
res = PINInput->exec(getParent(), "");
|
||||||
delete PINInput; PINInput = NULL;
|
delete PINInput; PINInput = NULL;
|
||||||
cPIN[4] = 0;
|
cPIN[4] = 0;
|
||||||
|
// strcpy(systemstr, CONFIGDIR "/pinentered.sh ");
|
||||||
|
// strcat(systemstr, cPIN.c_str());
|
||||||
|
// system(systemstr);
|
||||||
|
|
||||||
hint = LOCALE_PINPROTECTION_WRONGCODE;
|
hint = LOCALE_PINPROTECTION_WRONGCODE;
|
||||||
} while ( (cPIN != *validPIN) && !cPIN.empty() &&
|
} while ( (cPIN != *validPIN) && !cPIN.empty() &&
|
||||||
|
@@ -209,12 +209,7 @@ class CMenuItem : public CComponentsSignals
|
|||||||
void setInfoIconRight(const char * const IconName_Info_right);
|
void setInfoIconRight(const char * const IconName_Info_right);
|
||||||
const char* getInfoIconRight(){return iconName_Info_right;}
|
const char* getInfoIconRight(){return iconName_Info_right;}
|
||||||
|
|
||||||
#ifdef ENABLE_GRAPHLCD
|
std::string lcd_text;
|
||||||
std::string graphlcd_text;
|
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_LCD4LINUX
|
|
||||||
std::string lcd4l_text;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMenuSeparator : public CMenuItem
|
class CMenuSeparator : public CMenuItem
|
||||||
|
Reference in New Issue
Block a user