From 990dc117b44a9c4c3c78c12fc38bbbd2a2ef4f66 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 18 Jul 2013 14:40:10 +0400 Subject: [PATCH] gui/vfd_setup.cpp: add buttons backlight menu --- src/gui/vfd_setup.cpp | 30 ++++++++++++++++++++++++++++++ src/gui/vfd_setup.h | 1 + src/neutrino_menue.h | 1 + 3 files changed, 32 insertions(+) diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index 30f62d1ab..6c15f1359 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -129,6 +129,14 @@ int CVfdSetup::showSetup() mf->setHint("", LOCALE_MENU_HINT_POWER_LEDS); vfds->addItem(mf); } + if(cs_get_revision() == 9) + { + CMenuWidget * blMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP_BACKLIGHT); + showBacklightSetup(blMenu); + mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_BACKLIGHT, true, NULL, blMenu, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); + mf->setHint("", LOCALE_MENU_HINT_BACKLIGHT); + vfds->addItem(mf); + } vfds->addItem(GenericMenuSeparatorLine); @@ -214,6 +222,24 @@ void CVfdSetup::showLedSetup(CMenuWidget *mn_led_widget) mn_led_widget->addItem(mc); } +void CVfdSetup::showBacklightSetup(CMenuWidget *mn_led_widget) +{ + CMenuOptionChooser * mc; + mn_led_widget->addIntroItems(LOCALE_LEDCONTROLER_BACKLIGHT); + + mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_BACKLIGHT_TV, &g_settings.backlight_tv, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_LEDS_TV); + mn_led_widget->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.backlight_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_LEDS_STANDBY); + mn_led_widget->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.backlight_deepstandby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_LEDS_DEEPSTANDBY); + mn_led_widget->addItem(mc); +} + bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void */* data */) { @@ -235,5 +261,9 @@ bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void */* data * { CVFD::getInstance()->setled(); } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LEDCONTROLER_BACKLIGHT_TV)) + { + CVFD::getInstance()->setBacklight(g_settings.backlight_tv); + } return false; } diff --git a/src/gui/vfd_setup.h b/src/gui/vfd_setup.h index ca8dc6a47..b5eb7dfdd 100644 --- a/src/gui/vfd_setup.h +++ b/src/gui/vfd_setup.h @@ -44,6 +44,7 @@ int showSetup(); void showBrightnessSetup(CMenuWidget *mn_widget); void showLedSetup(CMenuWidget *mn_led_widget); + void showBacklightSetup(CMenuWidget *mn_led_widget); virtual bool changeNotify(const neutrino_locale_t OptionName, void *data); int brightness; int brightnessstandby; diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 7e5781e93..686fba91b 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -91,6 +91,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_VFDSETUP, MN_WIDGET_ID_VFDSETUP_LCD_SLIDERS, MN_WIDGET_ID_VFDSETUP_LED_SETUP, + MN_WIDGET_ID_VFDSETUP_BACKLIGHT, //keybind setup MN_WIDGET_ID_KEYSETUP,