[mythtv] [PATCH] Sleep on OSD menu.

Oscar Carlsson webmaster at trekotor.se
Sun Nov 28 21:52:44 UTC 2004


tommy wrote, On 2004-11-25 00:47:
> 
> Adds access to sleep functionality from the main osd menu on media/live 
> tv playback.

Hey Tommy

Looked at this today, and it just doesn't make sense to me. I'd say that 
it should look somthing like this?:

Any comments? Completely untested since I'm watching TV.

Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.230
diff -u -r1.230 tv_play.cpp
--- libs/libmythtv/tv_play.cpp  25 Nov 2004 21:23:21 -0000      1.230
+++ libs/libmythtv/tv_play.cpp  28 Nov 2004 21:50:01 -0000
@@ -4057,17 +4057,19 @@
      subitem = new OSDGenericTree(item, tr("2.0X"), "TOGGLESTRETCH2.0");

      // add sleep items to menu
-    QString SleepOn = tr("Sleep 60");
-    QString SleepOff = tr("Sleep Off");
+    //QString SleepOn = tr("Sleep 60");
+    //QString SleepOff = tr("Sleep Off");

-    QString sleepval = sleepTimer->isActive() ? SleepOff : SleepOn;
+    //QString sleepval = sleepTimer->isActive() ? SleepOff : SleepOn;

-    item = new OSDGenericTree(treeMenu, tr("Sleep"), "TOGGLESLEEP");
-    subitem = new OSDGenericTree(item, sleepval, "TOGGLESLEEPONOFF");
-    subitem = new OSDGenericTree(item, "30", "TOGGLESLEEP30");
-    subitem = new OSDGenericTree(item, "60", "TOGGLESLEEP60");
-    subitem = new OSDGenericTree(item, "90", "TOGGLESLEEP90");
-    subitem = new OSDGenericTree(item, "120", "TOGGLESLEEP120");
+    item = new OSDGenericTree(treeMenu, tr("Sleep"), "TOGGLESLEEPON");
+    if (sleepTimer->isActive())
+        subitem = new OSDGenericTree(item, tr("Sleep Off"), 
"TOGGLESLEEPON");
+//    subitem = new OSDGenericTree(item, sleepval, "TOGGLESLEEPONOFF");
+    subitem = new OSDGenericTree(item, "30 " + tr("minutes"), 
"TOGGLESLEEP30");
+    subitem = new OSDGenericTree(item, "60 " + tr("minutes"), 
"TOGGLESLEEP60");
+    subitem = new OSDGenericTree(item, "90 " + tr("minutes"), 
"TOGGLESLEEP90");
+    subitem = new OSDGenericTree(item, "120 " + tr("minutes"), 
"TOGGLESLEEP120");
  }

  void TV::ToggleAutoExpire(void)


More information about the mythtv-dev mailing list