From 886e45ef733635e17cfac3935d9a6a3274187834 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Sep 2018 00:15:22 +0200 Subject: [PATCH] lcd4l-setup: restart lcd after brightness change Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab8a9b2aaa45bb61972347a5915ea5739641adef Author: vanhofen Date: 2018-09-10 (Mon, 10 Sep 2018) Origin message was: ------------------ - lcd4l-setup: restart lcd after brightness change ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lcd4l_setup.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/gui/lcd4l_setup.cpp b/src/gui/lcd4l_setup.cpp index 0f6fe1341..c7e48bf66 100644 --- a/src/gui/lcd4l_setup.cpp +++ b/src/gui/lcd4l_setup.cpp @@ -133,6 +133,7 @@ int CLCD4lSetup::show() int temp_lcd4l_display_type = g_settings.lcd4l_display_type; int temp_lcd4l_skin = g_settings.lcd4l_skin; + int temp_lcd4l_brightness = g_settings.lcd4l_brightness; // lcd4l setup CMenuWidget* lcd4lSetup = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_LCD4L_SETUP); @@ -159,7 +160,7 @@ int CLCD4lSetup::show() mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SKIN_RADIO); lcd4lSetup->addItem(mc); - nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&g_settings.lcd4l_brightness, true, 1, 7, this); + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&temp_lcd4l_brightness, true, 1, 7, this); nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS); lcd4lSetup->addItem(nc); @@ -196,17 +197,28 @@ int CLCD4lSetup::show() // the things to do on exit + bool initlcd4l = false; + if (g_settings.lcd4l_display_type != temp_lcd4l_display_type) { g_settings.lcd4l_display_type = temp_lcd4l_display_type; - LCD4l->InitLCD4l(); + initlcd4l = true; } if (g_settings.lcd4l_skin != temp_lcd4l_skin) { g_settings.lcd4l_skin = temp_lcd4l_skin; - LCD4l->InitLCD4l(); + initlcd4l = true; } + if (g_settings.lcd4l_brightness != temp_lcd4l_brightness) + { + g_settings.lcd4l_brightness = temp_lcd4l_brightness; + initlcd4l = true; + } + + if (initlcd4l) + LCD4l->InitLCD4l(); + return res; }