[mythtv] [patch]Adjustable active time for LCD-device
Leo Weppelman
leo at wau.mis.ah.nl
Fri Feb 4 22:20:54 UTC 2005
This patch make the active time for the LCD display adjustable. I was
annoyed by the short time (5 secs.) that I had to read the menu before
the display went in-active. So I liked to prolong the active time. Some
people chimed in that they wanted a configurable amount of active time,
so that what I did....
This is a re-submit of a patch I posted a few months ago. Since then a
lot has changed in mythfrontend/globalsettings.cpp so here is an updated
patch.
Leo.
-------------- next part --------------
Index: libs/libmyth/lcddevice.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/lcddevice.cpp,v
retrieving revision 1.35
diff -u -r1.35 lcddevice.cpp
--- libs/libmyth/lcddevice.cpp 25 Oct 2004 23:56:10 -0000 1.35
+++ libs/libmyth/lcddevice.cpp 4 Feb 2005 22:09:07 -0000
@@ -340,6 +340,8 @@
lcd_showvolume=(gContext->GetSetting("LCDShowVolume", "1")=="1");
lcd_showmenu=(gContext->GetSetting("LCDShowMenu", "1")=="1");
lcd_backlighton=(gContext->GetSetting("LCDBacklightOn", "1")=="1");
+ aString = gContext->GetSetting("LCDPopupTime", "5");
+ lcd_popuptime = aString.toInt() * 1000;
connected = TRUE;
@@ -831,7 +833,7 @@
popMenuTimer->stop();
// Start the unPop timer if this is a popup menu
if (popMenu)
- popMenuTimer->start(5000, true);
+ popMenuTimer->start(lcd_popuptime, true);
// QPtrListIterator doesn't contain a deep copy constructor. . .
// This will contain a copy of the menuItems for scrolling purposes
Index: libs/libmyth/lcddevice.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/lcddevice.h,v
retrieving revision 1.17
diff -u -r1.17 lcddevice.h
--- libs/libmyth/lcddevice.h 23 Oct 2004 20:00:03 -0000 1.17
+++ libs/libmyth/lcddevice.h 4 Feb 2005 22:09:08 -0000
@@ -281,6 +281,7 @@
bool lcd_showchannel;
bool lcd_showvolume;
bool lcd_backlighton;
+ int lcd_popuptime;
int (*GetLEDMask)(void);
};
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.217
diff -u -r1.217 globalsettings.cpp
--- programs/mythfrontend/globalsettings.cpp 2 Feb 2005 07:11:10 -0000 1.217
+++ programs/mythfrontend/globalsettings.cpp 4 Feb 2005 22:09:13 -0000
@@ -2333,6 +2333,16 @@
return gc;
}
+static HostSpinBox *LCDPopupTime()
+{
+ HostSpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);
+ gs->setLabel(QObject::tr("Menu Pop-up Time"));
+ gs->setHelpText(QObject::tr("The time (in seconds) that the menu will "
+ "remain visible after navigation."));
+ gs->setValue(5);
+ return gs;
+}
+
static HostCheckBox *LCDShowMusic()
{
HostCheckBox *gc = new HostCheckBox("LCDShowMusic");
@@ -2910,6 +2920,7 @@
lcdscreen->setLabel(QObject::tr("LCD device display"));
lcdscreen->addChild(LCDShowTime());
lcdscreen->addChild(LCDShowMenu());
+ lcdscreen->addChild(LCDPopupTime());
lcdscreen->addChild(LCDShowMusic());
lcdscreen->addChild(LCDShowChannel());
lcdscreen->addChild(LCDShowVolume());
More information about the mythtv-dev
mailing list