diff --git a/src/gui/sleeptimer.cpp b/src/gui/sleeptimer.cpp index 8779552cd..eeb5dd079 100644 --- a/src/gui/sleeptimer.cpp +++ b/src/gui/sleeptimer.cpp @@ -28,6 +28,7 @@ #include +#include #include #include @@ -52,7 +53,7 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) } is_running = true; - int shutdown_min = 0; + shutdown_min = 0; char value[16]; CStringInput *inbox; bool permanent = (actionKey == "permanent"); @@ -123,3 +124,16 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey) return res; } + +const char * CSleepTimerWidget::getTargetValue() +{ + shutdown_min = g_Timerd->getSleepTimerRemaining(); + if (shutdown_min > 0) + { + shutdown_min_string = to_string(shutdown_min); + shutdown_min_string += " "; + shutdown_min_string += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + return shutdown_min_string.c_str(); + } + return NULL; +} diff --git a/src/gui/sleeptimer.h b/src/gui/sleeptimer.h index dd02a34a8..f52f9bebc 100644 --- a/src/gui/sleeptimer.h +++ b/src/gui/sleeptimer.h @@ -29,9 +29,12 @@ class CSleepTimerWidget: public CMenuTarget { private: static bool is_running; + int shutdown_min; + std::string shutdown_min_string; public: int exec(CMenuTarget* parent, const std::string & actionKey); + const char * getTargetValue(); };