Permalink
Browse files

Add a setting to configure how long the frontend remains idle before …

…we enter standby mode. Defaults to 90 minutes. A value of zero will disable the timer. Video playback suspends the timer, but currently listening to music does not.
  • Loading branch information...
1 parent d2edb8b commit a4ca569e0a46e649d96eef88c20793d0bf749bb6 @stuartm stuartm committed Mar 6, 2012
Showing with 22 additions and 3 deletions.
  1. +5 −3 mythtv/libs/libmythui/mythmainwindow.cpp
  2. +17 −0 mythtv/programs/mythfrontend/globalsettings.cpp
View
8 mythtv/libs/libmythui/mythmainwindow.cpp
@@ -2592,10 +2592,12 @@ void MythMainWindow::PauseIdleTimer(bool pause)
void MythMainWindow::IdleTimeout(void)
{
- if (!d->standby)
+
+ int idletimeout = gCoreContext->GetNumSetting("FrontendIdleTimeout",
+ STANDBY_TIMEOUT);
+
+ if (idletimeout > 0 && !d->standby)
{
- int idletimeout = gCoreContext->GetNumSetting("FrontendIdleTimeout",
- STANDBY_TIMEOUT);
LOG(VB_GENERAL, LOG_NOTICE, QString("Entering standby mode after "
"%1 minutes of inactivity")
.arg(idletimeout));
View
17 mythtv/programs/mythfrontend/globalsettings.cpp
@@ -1664,6 +1664,22 @@ static HostCheckBox *UseVirtualKeyboard()
return gc;
}
+static HostSpinBox *FrontendIdleTimeout()
+{
+ HostSpinBox *gs = new HostSpinBox("FrontendIdleTimeout", 0, 360, 15);
+ gs->setLabel(QObject::tr("Idle time before entering standby mode (minutes)"));
+ gs->setValue(90);
+ gs->setHelpText(QObject::tr("Number of minutes to wait when the frontend "
+ "is idle before entering standby mode. Standby "
+ "mode allows the backend to power down if "
+ "configured to do so. Any remote or mouse input "
+ "will cause the countdown to start again and/or "
+ "exit idle mode. Video playback suspends the "
+ "countdown. A value of zero prevents the "
+ "frontend automatically entering standby."));
+ return gs;
+}
+
static HostComboBox *OverrideExitMenu()
{
HostComboBox *gc = new HostComboBox("OverrideExitMenu");
@@ -3292,6 +3308,7 @@ MainGeneralSettings::MainGeneralSettings()
VerticalConfigurationGroup *shutdownSettings =
new VerticalConfigurationGroup(true, true, false, false);
shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings"));
+ shutdownSettings->addChild(FrontendIdleTimeout());
shutdownSettings->addChild(OverrideExitMenu());
shutdownSettings->addChild(HaltCommand());
shutdownSettings->addChild(RebootCommand());

0 comments on commit a4ca569

Please sign in to comment.