diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp
index 219d932..3cf1d81 100644
a
|
b
|
using namespace std; |
44 | 44 | #include "mythsignalingtimer.h" |
45 | 45 | #include "mythcorecontext.h" |
46 | 46 | #include "mythmedia.h" |
| 47 | #include "mythsystem.h" |
47 | 48 | |
48 | 49 | // libmythui headers |
49 | 50 | #include "myththemebase.h" |
… |
… |
void MythMainWindow::IdleTimeout(void) |
2604 | 2605 | LOG(VB_GENERAL, LOG_NOTICE, QString("Entering standby mode after " |
2605 | 2606 | "%1 minutes of inactivity") |
2606 | 2607 | .arg(idletimeout)); |
2607 | | EnterStandby(false); |
2608 | | if (gCoreContext->GetNumSetting("idleTimeoutSecs", 0)) |
| 2608 | |
| 2609 | int standbyAction = gCoreContext->GetNumSetting("FrontendStandbyAction",0); |
| 2610 | if (standbyAction == 1) //(STANDBY_QUIT == 1) |
| 2611 | { |
| 2612 | LOG(VB_GENERAL, LOG_NOTICE, "Quitting frontend"); |
| 2613 | qApp->quit(); |
| 2614 | } |
| 2615 | else if (standbyAction == 2) //(STANDBY_COMMAND == 2) |
2609 | 2616 | { |
2610 | | d->enteringStandby = true; |
2611 | | JumpTo("Standby Mode"); |
| 2617 | LOG(VB_GENERAL, LOG_NOTICE, "Executing standby command"); |
| 2618 | QString standby_cmd = |
| 2619 | gCoreContext->GetSetting("FrontendStandbyCommand", ""); |
| 2620 | if (!standby_cmd.isEmpty()) |
| 2621 | myth_system(standby_cmd); |
| 2622 | } |
| 2623 | else // (standbyAction == STANDBY_SCREEN == 0) |
| 2624 | { |
| 2625 | EnterStandby(false); |
| 2626 | if (gCoreContext->GetNumSetting("idleTimeoutSecs", 0)) |
| 2627 | { |
| 2628 | d->enteringStandby = true; |
| 2629 | JumpTo("Standby Mode"); |
| 2630 | } |
2612 | 2631 | } |
2613 | 2632 | } |
2614 | 2633 | } |
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
index d4b88f4..21a72c5 100644
a
|
b
|
static HostSpinBox *FrontendIdleTimeout() |
1696 | 1696 | return gs; |
1697 | 1697 | } |
1698 | 1698 | |
| 1699 | static HostComboBox *FrontendStandbyAction() |
| 1700 | { |
| 1701 | HostComboBox *gc = new HostComboBox("FrontendStandbyAction"); |
| 1702 | gc->setLabel(QObject::tr("Action to take upon entering standby")); |
| 1703 | gc->addSelection(QObject::tr("Standby Screen"), "0"); |
| 1704 | gc->addSelection(QObject::tr("Quit Frontend"), "1"); |
| 1705 | gc->addSelection(QObject::tr("Run script"), "2"); |
| 1706 | gc->setHelpText(QObject::tr("Select standby behavior. By default, the standby screen is displayed." |
| 1707 | "Here you can select to run the standby defined command below or exit the " |
| 1708 | "frontend.")); |
| 1709 | return gc; |
| 1710 | } |
| 1711 | |
| 1712 | static HostLineEdit *FrontendStandbyCommand() |
| 1713 | { |
| 1714 | HostLineEdit *ge = new HostLineEdit("FrontendStandbyCommand"); |
| 1715 | ge->setLabel(QObject::tr("Standby command")); |
| 1716 | ge->setValue(""); |
| 1717 | ge->setHelpText(QObject::tr("Optional. Script to run if you select " |
| 1718 | "the run script option in standby action.")); |
| 1719 | return ge; |
| 1720 | } |
| 1721 | |
1699 | 1722 | static HostComboBox *OverrideExitMenu() |
1700 | 1723 | { |
1701 | 1724 | HostComboBox *gc = new HostComboBox("OverrideExitMenu"); |
… |
… |
MainGeneralSettings::MainGeneralSettings() |
3359 | 3382 | new VerticalConfigurationGroup(true, true, false, false); |
3360 | 3383 | shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings")); |
3361 | 3384 | shutdownSettings->addChild(FrontendIdleTimeout()); |
| 3385 | shutdownSettings->addChild(FrontendStandbyAction()); |
| 3386 | shutdownSettings->addChild(FrontendStandbyCommand()); |
3362 | 3387 | shutdownSettings->addChild(OverrideExitMenu()); |
3363 | 3388 | shutdownSettings->addChild(HaltCommand()); |
3364 | 3389 | shutdownSettings->addChild(RebootCommand()); |