summaryrefslogtreecommitdiffstats
path: root/abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch')
-rw-r--r--abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch b/abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch
new file mode 100644
index 0000000..b14e2e0
--- /dev/null
+++ b/abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch
@@ -0,0 +1,50 @@
+diff --git a/mythtv/libs/libmythui/myththemedmenu.cpp b/mythtv/libs/libmythui/myththemedmenu.cpp
+index ed2e54c..77aaf73 100644
+--- a/mythtv/libs/libmythui/myththemedmenu.cpp
++++ b/mythtv/libs/libmythui/myththemedmenu.cpp
+@@ -308,6 +308,8 @@ void MythThemedMenu::ShowMenu()
+ return;
+
+ int override_menu = GetMythDB()->GetNumSetting("OverrideExitMenu");
++ int MythShutdownLock = GetMythDB()->GetNumSetting("MythShutdownLock");
++ int idleTimeoutSecs = GetMythDB()->GetNumSetting("idleTimeoutSecs");
+ QString label = tr("System Menu");
+ MythScreenStack* mainStack = GetMythMainWindow()->GetMainStack();
+ m_menuPopup = new MythDialogBox(label, mainStack, "menuPopup");
+@@ -325,6 +327,21 @@ void MythThemedMenu::ShowMenu()
+ if (override_menu != 7)
+ m_menuPopup->AddButton(tr("Exit application"), QVariant("exit"));
+
++ // don't offer to enable/disable auto shutdown if auto shutdown is disabled
++ if (idleTimeoutSecs != 0)
++ {
++ if (MythShutdownLock == 0)
++ {
++ m_menuPopup->AddButton(tr("Disable Auto Shutdown"),
++ QVariant("lockShutdown"));
++ }
++ else
++ {
++ m_menuPopup->AddButton(tr("Enable Auto Shutdown"),
++ QVariant("unlockShutdown"));
++ }
++ }
++
+ switch (override_menu)
+ {
+ case 2:
+@@ -416,6 +433,14 @@ void MythThemedMenu::customEvent(QEvent *event)
+ QString arg("exiting_app");
+ m_state->m_callback(m_state->m_callbackdata, arg);
+ }
++ else if (action == "lockShutdown")
++ {
++ GetMythDB()->SaveSettingOnHost("MythShutdownLock", "1", NULL);
++ }
++ else if (action == "unlockShutdown")
++ {
++ GetMythDB()->SaveSettingOnHost("MythShutdownLock", "0", NULL);
++ }
+ }
+ else if (resultid == "password")
+ {