summaryrefslogtreecommitdiffstats
path: root/abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2019-01-30 15:48:09 (GMT)
committerBritney Fransen <brfransen@gmail.com>2019-01-30 15:48:09 (GMT)
commitfb52b64b5af9edfe83c361916a51c28d802b1d36 (patch)
tree7f6d8c693a47eb3ab348e45785c61a9199ee277e /abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch
parent9b6c8730fe90c05fa38880963f4fea2ac7ab7391 (diff)
downloadlinhes_pkgbuild-fb52b64b5af9edfe83c361916a51c28d802b1d36.zip
linhes_pkgbuild-fb52b64b5af9edfe83c361916a51c28d802b1d36.tar.gz
linhes_pkgbuild-fb52b64b5af9edfe83c361916a51c28d802b1d36.tar.bz2
mythtv mythplugins mythweb: add fixes/30 branch. refs#1034
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")
+ {