From 8f621ef472dc9e48ec7aadcbfd9bd7d330e03509 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 16 Oct 2014 14:05:30 +0200 Subject: [PATCH] neutrino.cpp: add signal OnBeforeRestart This allows to handle events inside from objects with matching slots and events without explicit calls in neutrino.cpp. Used here general for stopping of thread in timer object. In some cases it could be necessary to stop timer thread otherwise it is possible that restart is blocked here. This happens here automatically, without separate instances of timer objects. Conflicts: src/neutrino.h --- src/neutrino.cpp | 3 +++ src/neutrino.h | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 364002b1c..c59e2e750 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3869,6 +3869,9 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) return menu_return::RETURN_EXIT_ALL; } else if(actionKey=="restart") { + //usage of slots from any classes + OnBeforeRestart(); + if (recordingstatus) DisplayErrorMessage(g_Locale->getText(LOCALE_SERVICEMENU_RESTART_REFUSED_RECORDING)); else { diff --git a/src/neutrino.h b/src/neutrino.h index 0a704617b..51b000e51 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -39,7 +39,7 @@ #include "gui/personalize.h" #include "gui/user_menue.h" #include - +#include #include #define ANNOUNCETIME (1 * 60) @@ -57,7 +57,7 @@ class CFrameBuffer; class CConfigFile; class CScanSettings; -class CNeutrinoApp : public CMenuTarget, CChangeObserver +class CNeutrinoApp : public CMenuTarget, CChangeObserver, sigc::trackable { public: enum @@ -228,6 +228,8 @@ public: void stopPlayBack(bool lock = false); bool adjustToChannelID(const t_channel_id channel_id); void screensaver(bool); + //signal/event handler before restart of neutrino gui + sigc::signal OnBeforeRestart; }; #endif