[mythtv] [patch]Make LCD function during mythvideo-videotree selection

Leo Weppelman leo at wau.mis.ah.nl
Wed Oct 27 11:14:03 UTC 2004


This patch makes the LCD display functional during a selection of a
video file in the videotree-type menu. It should work for all the
parts of the gui using UIManagedTreeListType (like mythmusic playlists).

Leo.
-------------- next part --------------
Index: uitypes.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/uitypes.cpp,v
retrieving revision 1.86
diff -u -r1.86 uitypes.cpp
--- uitypes.cpp	26 Sep 2004 01:26:32 -0000	1.86
+++ uitypes.cpp	27 Oct 2004 11:05:55 -0000
@@ -5,6 +5,7 @@
 #include "uitypes.h"
 #include "mythdialogs.h"
 #include "mythcontext.h"
+#include "lcddevice.h"
 
 LayerSet::LayerSet(const QString &name)
 {
@@ -2426,6 +2427,41 @@
         return;
     }
 
+    class LCD * lcddev = LCD::Get();
+
+    if (lcddev) {
+        QString msg = current_node->getString();
+        GenericTree *parent = current_node->getParent();
+        if (parent == NULL) {
+            cerr << __FILE__ << ":  UIManagedTreeListType: no parent" << endl;
+        }
+        else {
+            QPtrListIterator<GenericTree> an_it =
+                                parent->getFirstChildIterator(visual_order);
+            GenericTree *lnode;
+            QPtrList<LCDMenuItem> menuItems;
+            menuItems.setAutoDelete(true);
+            bool selected;
+
+            while ((lnode = an_it.current()) != 0) {
+                if (lnode == current_node) {
+                    selected = true;
+                }
+                else {
+                    selected = false;
+                }
+                menuItems.append(new LCDMenuItem(selected, NOTCHECKABLE,
+                                                        lnode->getString()));
+                ++an_it;
+            }
+
+            QString title;
+            title = (parent->getParent()) ? "<< " : "   ";
+            if (!menuItems.isEmpty())
+                lcddev->switchToMenu(&menuItems, title);
+        }
+    }
+
     bool draw_up_arrow = false;
     bool draw_down_arrow = false;
 


More information about the mythtv-dev mailing list