2#include <QCoreApplication>
20 m_haltCommand(
gCoreContext->GetSetting(
"HaltCommand",
"")),
21 m_rebootCommand(
gCoreContext->GetSetting(
"RebootCommand",
"")),
22 m_suspendCommand(
gCoreContext->GetSetting(
"SuspendCommand",
""))
25 LOG(VB_GENERAL, LOG_INFO,
"Created ExitPrompter");
36 LOG(VB_GENERAL, LOG_INFO,
"Deleted ExitPrompter");
65 LOG(VB_GENERAL, LOG_ERR,
"User defined HaltCommand failed, falling back to "
66 "alternative methods.");
101 LOG(VB_GENERAL, LOG_ERR,
"User defined RebootCommand failed, falling back to "
102 "alternative methods.");
127 bool handled =
false;
138 LOG(VB_GENERAL, LOG_ERR,
139 "User defined SuspendCommand failed, falling back to alternative methods.");
169 bool allowExit =
false;
170 bool allowReboot =
false;
171 bool allowShutdown =
false;
172 bool allowStandby =
false;
173 bool allowSuspend =
false;
180 haveshutdown =
false;
197 allowShutdown = haveshutdown;
204 allowShutdown = haveshutdown;
208 allowReboot = havereboot;
209 allowShutdown = haveshutdown;
212 allowShutdown = haveshutdown;
215 allowReboot = havereboot;
218 allowReboot = havereboot;
219 allowShutdown = haveshutdown;
225 allowSuspend = havesuspend;
229 allowSuspend = havesuspend;
233 allowReboot = havereboot;
234 allowShutdown = haveshutdown;
235 allowSuspend = havesuspend;
246 LOG(VB_GENERAL, LOG_ERR,
"Can't create Exit Prompt dialog?");
255 bool confirm =
m_confirm || !frontendOnly;
294 msg.prepend(tr(
"Mythbackend is running on this system. "));
An action (for this plugin) consists of a description, and a set of key sequences.
void MainDialogClosed(const QString &, int Id)
void Confirm(MythPower::Feature Action)
Dialog asking for user confirmation.
bool IsFrontendOnly(void)
is there a frontend, but no backend, running on this host
int GetNumSetting(const QString &key, int defaultval=0)
Basic menu dialog, message and a list of options.
void AddButton(const QString &title)
void SetReturnEvent(QObject *retobject, const QString &resultid)
void Closed(QString, int)
bool Create(void) override
MythScreenStack * GetStack(const QString &Stackname)
virtual bool RequestFeature(Feature Request, bool Delay=true)
bool IsFeatureSupported(Feature Supported)
static MythPower * AcquireRelease(void *Reference, bool Acquire, std::chrono::seconds MinimumDelay=0s)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
@ GENERIC_EXIT_OK
Exited with no error.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
VERBOSE_PREAMBLE Most true