diff options
author | Britney Fransen <brfransen@gmail.com> | 2019-03-19 20:11:10 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2019-03-19 20:11:10 (GMT) |
commit | 73cfb83a5baecfe0529fda59ca57233d8843f783 (patch) | |
tree | 2dba2103a6f6e43912fc645ca8b48a85ab500ad2 /abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch | |
parent | 7b41a9288f5d1332c8136df798bb8ca2465bc21c (diff) | |
parent | 448cb8d0708224d78c24ce3615dc7eef44d4689b (diff) | |
download | linhes_pkgbuild-73cfb83a5baecfe0529fda59ca57233d8843f783.zip linhes_pkgbuild-73cfb83a5baecfe0529fda59ca57233d8843f783.tar.gz linhes_pkgbuild-73cfb83a5baecfe0529fda59ca57233d8843f783.tar.bz2 |
Merge branch 'testing'
Diffstat (limited to 'abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch')
-rw-r--r-- | abs/core/mythtv/stable-30/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch | 50 |
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") + { |