[mythtv] "global" keys?

Joseph A. Caputo jcaputo1 at comcast.net
Wed Sep 24 15:43:11 EDT 2003


> -----Original Message-----
> From: mythtv-dev-bounces at mythtv.org
> [mailto:mythtv-dev-bounces at mythtv.org]On Behalf Of Renchi Raju
> Sent: Wednesday, September 24, 2003 12:36 PM
> To: Development of mythtv
> Subject: Re: [mythtv] "global" keys?
>
>
>
> On Wed, 24 Sep 2003, thor wrote:
>
> > On Wednesday 24 September 2003 10:48 am, henri at qais.com wrote:
> > >
> > > also would like to try a few other "global" keys.
> > >
> > > looking at the source i wasn't too sure what the cleanest
> > > way to do that would be...
> >
> > 	Not easy. You could .... make every module return exit codes
> > (signalling what the user wanted to do next), and then rewrite all of
> > them to accept certain global keypresses, shut themselves down and
> > spit out the right exit codes.
> >
> > - thor
>
> an easy way is to install a global eventfilter in all modules (fairly easy
> with QObject::installEventFilter) and then let this handle the
> keypresses and
> ignore any that it can't understand. For this to be done, make a class
> derived from qobject which installs the eventfilter. All myth modules can
> inherit from this class instead of qobject directly.


The problem (as I see it) is not simply how to catch and process global
events.  The problem is that currently Myth has a hierarchical window
architecture.  Most windows are coded so as to be instantiated and displayed
only from a certain path in the code.  A good global event architecture
would require changes to this.  Some windows would have to be made 'global';
i.e. able to be called up by some static or always-in-scope function.  If
the window already exists it should be popped to the front instead of
creating a new instance.  Other windows are non-global; that is they are
only ever instantiated as a child of another window or dialog.

This is a very simplistic explanation, but if you think about the
ramifications, you may start to wonder how to make global events work
(robustly, extensibly and elegantly, that is) without largely rewriting the
Myth GUI architecture.

-JAC



More information about the mythtv-dev mailing list