lcd4linux: add slots for more user involvement

Keeps gui stuff away from parts of /src/driver and
callbacks with messages should inform the user about possible
operations during activation or deactivation of service.
Reason: long breaks are mediating
freeze or unknown status that leave the user in the dark.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 826d56a575
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-06-30 (Wed, 30 Jun 2021)



------------------
This commit was generated by Migit
This commit is contained in:
2021-06-30 20:35:27 +02:00
committed by vanhofen
parent 65c1d83aa6
commit 1e1afaf19c
4 changed files with 83 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
Homepage: http://www.neutrino-images.de/
Copyright (C) 2016-2019 'TangoCash'
Copyright (C) 2021, Thilo Graf 'dbt'
License: GPL
@@ -153,6 +154,7 @@ void CLCD4l::InitLCD4l()
void CLCD4l::StartLCD4l()
{
OnBeforeStart();
if (!thrLCD4l)
{
dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] starting thread with mode %d \033[0m\n", __func__, __LINE__, g_settings.lcd4l_support);
@@ -161,12 +163,17 @@ void CLCD4l::StartLCD4l()
thrLCD4l = new std::thread(LCD4lProc, this);
dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] thread [%p] is running\033[0m\n", __func__, __LINE__, thrLCD4l);
}
if (g_settings.lcd4l_support)
exec_initscript("lcd4linux", "start");
{
if (exec_initscript("lcd4linux", "start"))
OnAfterStart();
}
}
void CLCD4l::StopLCD4l()
{
OnBeforeStop();
if (thrLCD4l)
{
dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] stopping thread [%p]\033[0m\n", __func__, __LINE__, thrLCD4l);
@@ -179,7 +186,9 @@ void CLCD4l::StopLCD4l()
thrLCD4l = NULL;
dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] thread [%p] terminated\033[0m\n", __func__, __LINE__, thrLCD4l);
}
exec_initscript("lcd4linux", "stop");
if (exec_initscript("lcd4linux", "stop"))
OnAfterStop();
}
void CLCD4l::SwitchLCD4l()
@@ -843,7 +852,11 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
m_Layout = Layout;
if (!firstRun)
exec_initscript("lcd4linux", "reload");
{
OnBeforeRestart();
if (exec_initscript("lcd4linux", "restart"))
OnAfterRestart();
}
}
}