mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
- vfd-setup: formatting code using astyle; some manual code nicenings
Conflicts: src/gui/vfd_setup.cpp Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -57,7 +57,6 @@
|
||||
#include <system/helpers.h>
|
||||
#include <cs_api.h>
|
||||
|
||||
|
||||
CVfdSetup::CVfdSetup()
|
||||
{
|
||||
width = 40;
|
||||
@@ -68,14 +67,14 @@ CVfdSetup::~CVfdSetup()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int CVfdSetup::exec(CMenuTarget *parent, const std::string &actionKey)
|
||||
{
|
||||
dprintf(DEBUG_DEBUG, "init lcd setup\n");
|
||||
if (parent != NULL)
|
||||
parent->hide();
|
||||
|
||||
if(actionKey=="def") {
|
||||
if (actionKey == "def")
|
||||
{
|
||||
brightness = DEFAULT_VFD_BRIGHTNESS;
|
||||
brightnessstandby = DEFAULT_VFD_STANDBYBRIGHTNESS;
|
||||
brightnessdeepstandby = DEFAULT_VFD_STANDBYBRIGHTNESS;
|
||||
@@ -84,7 +83,9 @@ int CVfdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
CVFD::getInstance()->setBrightnessStandby(brightnessstandby);
|
||||
CVFD::getInstance()->setBrightnessDeepStandby(brightnessdeepstandby);
|
||||
return menu_return::RETURN_REPAINT;
|
||||
} else if (actionKey == "brightness") {
|
||||
}
|
||||
else if (actionKey == "brightness")
|
||||
{
|
||||
return showBrightnessSetup();
|
||||
}
|
||||
|
||||
@@ -93,12 +94,12 @@ int CVfdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
return res;
|
||||
}
|
||||
|
||||
#define LCDMENU_STATUSLINE_OPTION_COUNT 2
|
||||
#define LCDMENU_STATUSLINE_OPTION_COUNT 3
|
||||
const CMenuOptionChooser::keyval LCDMENU_STATUSLINE_OPTIONS[LCDMENU_STATUSLINE_OPTION_COUNT] =
|
||||
{
|
||||
{ 0, LOCALE_LCDMENU_STATUSLINE_PLAYTIME },
|
||||
{ 1, LOCALE_LCDMENU_STATUSLINE_VOLUME }
|
||||
//,{ 2, LOCALE_LCDMENU_STATUSLINE_BOTH }
|
||||
{ 1, LOCALE_LCDMENU_STATUSLINE_VOLUME },
|
||||
{ 2, LOCALE_OPTIONS_OFF }
|
||||
};
|
||||
|
||||
#define LEDMENU_OPTION_COUNT 4
|
||||
@@ -123,6 +124,8 @@ const CMenuOptionChooser::keyval LCD_INFO_OPTIONS[LCD_INFO_OPTION_COUNT] =
|
||||
|
||||
int CVfdSetup::showSetup()
|
||||
{
|
||||
// int temp_lcd_settings_status = g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME];
|
||||
|
||||
CMenuWidget *vfds = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP);
|
||||
vfds->addIntroItems(LOCALE_LCDMENU_HEAD);
|
||||
|
||||
@@ -229,7 +232,30 @@ int CVfdSetup::showSetup()
|
||||
}
|
||||
else
|
||||
res = vfds->exec(NULL, "");
|
||||
|
||||
#if 0
|
||||
if (temp_lcd_settings_status != g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME])
|
||||
{
|
||||
if (g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME] == 2 /* off */)
|
||||
{
|
||||
// to lazy for a loop. the effect is the same.
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR8, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR7, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR6, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR5, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR4, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR3, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR2, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_BAR1, false);
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_FRAME, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
CVFD::getInstance()->ShowIcon(FP_ICON_FRAME, true);
|
||||
CVFD::getInstance()->showVolume(g_settings.current_volume);
|
||||
//CVFD::getInstance()->showPercentOver(???);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
delete vfds;
|
||||
return res;
|
||||
}
|
||||
@@ -338,20 +364,33 @@ void CVfdSetup::showBacklightSetup(CMenuWidget *mn_led_widget)
|
||||
|
||||
bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void * /* data */)
|
||||
{
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESS)) {
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESS))
|
||||
{
|
||||
CVFD::getInstance()->setBrightness(brightness);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY))
|
||||
{
|
||||
CVFD::getInstance()->setBrightnessStandby(brightnessstandby);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY))
|
||||
{
|
||||
CVFD::getInstance()->setBrightnessStandby(brightnessdeepstandby);
|
||||
CVFD::getInstance()->setBrightnessDeepStandby(brightnessdeepstandby);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_DIM_BRIGHTNESS)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_DIM_BRIGHTNESS))
|
||||
{
|
||||
CVFD::getInstance()->setBrightness(g_settings.lcd_setting_dim_brightness);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LEDCONTROLER_MODE_TV)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LEDCONTROLER_MODE_TV))
|
||||
{
|
||||
CVFD::getInstance()->setled();
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LEDCONTROLER_BACKLIGHT_TV)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LEDCONTROLER_BACKLIGHT_TV))
|
||||
{
|
||||
CVFD::getInstance()->setBacklight(g_settings.backlight_tv);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_SCROLL) || ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_SCROLL_REPEATS)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_SCROLL) || ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_SCROLL_REPEATS))
|
||||
{
|
||||
CVFD::getInstance()->setScrollMode(g_settings.lcd_scroll);
|
||||
}
|
||||
|
||||
@@ -360,19 +399,28 @@ bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void * /* data
|
||||
|
||||
void CVfdSetup::activateNotify(const neutrino_locale_t OptionName)
|
||||
{
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY)) {
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY))
|
||||
{
|
||||
g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] = brightnessstandby;
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_STANDBY);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY))
|
||||
{
|
||||
g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] = brightnessdeepstandby;
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_STANDBY);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESS)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDCONTROLER_BRIGHTNESS))
|
||||
{
|
||||
g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS] = brightness;
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
|
||||
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_DIM_BRIGHTNESS)) {
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCDMENU_DIM_BRIGHTNESS))
|
||||
{
|
||||
g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS] = g_settings.lcd_setting_dim_brightness;
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS] = brightness;
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8);
|
||||
}
|
||||
|
@@ -59,5 +59,4 @@
|
||||
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user