[mythtv] Mythgallery without deprecated mythdialog

Robert Siebert trebor_s at web.de
Mon May 16 14:54:14 UTC 2011


 Hello everybody,

 i'm currently working on improving the gallery plugin. Currently 
 MythDialog is used in the gallery plugin to create the opengl widget 
 which then shows the images. According to the source code documentation 
 MythDialog is deprecated and MythScreenType shall be used.

 I have changes the code so that when the user selects an image a new 
 window will be created and added to the stack.
 In the Create() method I create the layout which uses 
 GetMythMainWindow(). I then assign the QGLWidget object to the layout 
 which will display the images in OpenGl with the scaling, fading and so 
 on.

 This works fine so far, except one issue. This approach will overlap 
 all other screens like popup dialogs, the music widget and so on. What 
 can be done to improve this? Is this the right direction to get rid of 
 the MythDialog or should I use MythUIImage? Where should then the 
 effects be handled?

 Here are some small code snippets.

 bool ImageWidget::Create()
 {
   if (!LoadWindowFromXML("image-ui.xml", "slideshow", this))
     return false;
 
   <some more code here>

   m_layout = new QVBoxLayout(GetMythMainWindow());
   m_gliw = new GLImageWidget(this, NULL);
   m_layout->addWidget(m_gliw);
   m_gliw->hide();
   BuildFocusList();
   SetFocusWidget(m_selectedImage);
   return true;
 }

 The QGLWidget gets the ImageWidget object so it can forward the 
 keypresses or get some information from this object.

 GLImageWidget::GLImageWidget(ImageWidget *iw, QWidget *parent) : 
 QGLWidget(parent)
 ...


 Best regards

 Robert S



More information about the mythtv-dev mailing list