From 8a6431c6afe1b26ea763ce69a73b105e9223fb18 Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 15 Nov 2022 22:43:21 +0100 Subject: [PATCH] lcd4l.cpp: restart script after changing timezone Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5cbd946de434eddafc2dfb788459c02dd1c07e7f Author: GetAway Date: 2022-11-15 (Tue, 15 Nov 2022) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/lcd4l.cpp | 18 +++++++++++++----- src/driver/lcd4l.h | 1 + src/gui/osdlang_setup.cpp | 7 ++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index c23272849..da5c574d9 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -200,6 +200,18 @@ void CLCD4l::StopLCD4l() OnError(); } +void CLCD4l::RestartLCD4lScript() +{ + OnBeforeStart(); + if (thrLCD4l && g_settings.lcd4l_support) + { + if (exec_initscript("lcd4linux", "restart")) + OnAfterRestart(); + else + OnError(); + } +} + void CLCD4l::SwitchLCD4l() { if (thrLCD4l) @@ -942,11 +954,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) if (!firstRun) { - OnBeforeRestart(); - if (exec_initscript("lcd4linux", "restart")) - OnAfterRestart(); - else - OnError(); + RestartLCD4lScript(); } } } diff --git a/src/driver/lcd4l.h b/src/driver/lcd4l.h index d8bbfed1c..3d5b69c71 100644 --- a/src/driver/lcd4l.h +++ b/src/driver/lcd4l.h @@ -56,6 +56,7 @@ class CLCD4l void StartLCD4l(); void StopLCD4l(); void SwitchLCD4l(); + void RestartLCD4lScript(); void ForceRun() { wait4daemon = false; } int CreateFile(const char *file, std::string content = "", bool convert = false); diff --git a/src/gui/osdlang_setup.cpp b/src/gui/osdlang_setup.cpp index b18765223..e2c7cdfdc 100644 --- a/src/gui/osdlang_setup.cpp +++ b/src/gui/osdlang_setup.cpp @@ -32,7 +32,9 @@ #ifdef HAVE_CONFIG_H #include #endif - +#ifdef ENABLE_LCD4LINUX +#include "driver/lcd4l.h" +#endif #include #include "osdlang_setup.h" @@ -126,6 +128,9 @@ int COsdLangSetup::showLocalSetup() delete localSettings; delete langNotifier; delete tzNotifier; +#ifdef ENABLE_LCD4LINUX + CLCD4l::getInstance()->RestartLCD4lScript(); +#endif return res; }