[mythtv] Re: mythmusic and LCDd segfault without LCDd OK

Leo Weppelman leo at wau.mis.ah.nl
Thu Jan 20 15:11:14 EST 2005


On Thu, Jan 20, 2005 at 09:45:03AM -0500, thor wrote:
> On Thursday 20 January 2005 02:02 am, Isaac Richards wrote:
> > On Thursday 20 January 2005 01:42 am, Leo Weppelman wrote:
> > > On Tue, Jan 18, 2005 at 09:55:23PM -0800, Eskil Heyn Olsen wrote:
> > > > On Sat, 2005-01-15 at 21:47 +0100, Leo Weppelman wrote:
> > > > > I have posted a patch that was intended for mythvideo, but should
> > > > > also do at least something in mythmusic, that displays the current
> > > > > choices in the video tree. That patch was on the UIManagedTreeType
> > > > > AFAIK - posted it quite a while ago.
> > > >
> > > > Oh yeah, found it. Simpler than mine - how come it's not in cvs ?
> > >
> > > Good question :-| There doesn't seem to be much interest in the LCD
> > > related patches...
> >
> > I was hoping that Thor would handle them, as he wrote all that code
> > originally.. =)
> >
> 
>  Ooops. And it's fallen off my local copy of -dev. 
> 
>  Leo, if it's not too much trouble, could you resend the patch? 

It is in the attachment... As far as I can see, it should apply on the
cvs tree from +/- 2 weeks ago that I have here. If you need something
newer, just say so and I'll send you one next weekend.

Leo.

<plugging my own patches>
For LCD:
  Configurable popup time
  Show selections in the playback backbox

Mythvideo:
  My video tree patch. An attemp to use the same module to create
  the list of available videos for the different mythvideo views.
</plugging my own patches>
-------------- 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