Skip to content

Commit

Permalink
Android: Disable suspend, reboot and shutdown settings/options
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Jan 27, 2020
1 parent 7238608 commit 0f16864
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mythtv/programs/mythfrontend/exitprompt.cpp
Expand Up @@ -146,6 +146,12 @@ void ExitPrompter::HandleExit()
bool havereboot = !m_rebootCommand.isEmpty();
bool havesuspend = !m_suspendCommand.isEmpty();

#ifdef Q_OS_ANDROID
haveshutdown = false;
havereboot = false;
havesuspend = false;
#endif

if (m_power)
{
havereboot |= m_power->IsFeatureSupported(MythPower::FeatureRestart);
Expand Down
7 changes: 7 additions & 0 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Expand Up @@ -1955,6 +1955,7 @@ static HostComboBoxSetting *OverrideExitMenu(MythPower *Power)
return gc;
}

#ifndef Q_OS_ANDROID
static HostTextEditSetting *RebootCommand(MythPower *Power)
{
auto *ge = new HostTextEditSetting("RebootCommand");
Expand Down Expand Up @@ -2011,6 +2012,7 @@ static HostTextEditSetting *HaltCommand(MythPower *Power)
ge->setHelpText(help);
return ge;
}
#endif

static HostTextEditSetting *LircDaemonDevice()
{
Expand Down Expand Up @@ -3953,9 +3955,11 @@ ShutDownRebootSetting::ShutDownRebootSetting()
addChild(FrontendIdleTimeout());
auto *power = MythPower::AcquireRelease(this, true);
addChild(m_overrideExitMenu = OverrideExitMenu(power));
#ifndef Q_OS_ANDROID
addChild(m_haltCommand = HaltCommand(power));
addChild(m_rebootCommand = RebootCommand(power));
addChild(m_suspendCommand = SuspendCommand(power));
#endif
if (power)
MythPower::AcquireRelease(this, false);
connect(m_overrideExitMenu,SIGNAL(valueChanged(StandardSetting *)),
Expand All @@ -3964,6 +3968,9 @@ ShutDownRebootSetting::ShutDownRebootSetting()

void ShutDownRebootSetting::childChanged(StandardSetting*)
{
if (!m_haltCommand || !m_suspendCommand || !m_rebootCommand)
return;

switch (m_overrideExitMenu->getValue().toInt())
{
case 2:
Expand Down

0 comments on commit 0f16864

Please sign in to comment.