[mythtv] Change windowname?

Michael Anthon michael at anthon.net
Sun Oct 26 11:59:01 EST 2003


On Saturday 11 October 2003 09:49, Chris wrote:

> sense in all contexts.  I've seen some suggestions on how to get around
> the fewer-buttons problem (like making [ and ] navigate the menus), but
> how about if mythfrontend changes its window name depending on what it
> does?  irxevent can send keypresses directly to a named window instead
> of just CurrentWindow, and it supports multiple definitions in one file,
> so I could have a definition of "VOL+ = Right-arrow" for "mythfrontend
> - menu" and another definition of "VOL+ = ]" for "mythfrontend -

I had a bit of a go at doing his since it was annoying me as well.

There are 2 patches attached.  

captions.patch is some changes to mythdialogs that add 2 methods to the class.
	SetCaption(QString Caption) to set the caption
	GetCaption() to retrieve the current caption

Calling gContext->GetMainWindow()->SetCaption("some caption") will set the 
caption of the main window.

The second patch (themedmenu.patch) is a really awful (and very incomplete) 
attempt at using this change to make it do something useful and I'm only 
including it as a reference.  C/C++ is not a language I'm particularly 
comfortable with yet and I'm still trying to figure out the best place to 
hack this in.  Perhaps someone could offer some suggestions on where to put 
it.  As it stands it works for plugins (it will change the caption to the 
name of the plugin e.g. mythmusic) and I have modified my .lircrc file and it 
works.

As an example, the following entries allows the VOL_UP button on my remote to 
work as volume up in mythmusic and as the right arrow in any other part of 
the system. 

begin
    prog = irxevent
    button = VOL_UP
    repeat = 3
    config = Key bracketright mythmusic
end

begin
    prog = irxevent
    button = VOL_UP
    repeat = 3
    config = Key Right mythfrontend
end

 An interesting thing I found with irxevent is that if it can't find a match 
for the window name then it seems to match on the program name instead.  This 
means that you can have a set of default mappings that work through all of 
mythfrontend even when the caption says something else and then just override 
the mappings you want to change for a specific plugin.

Now I just have to figure out the best place to set the caption...

Cheers,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: captions.patch
Type: text/x-diff
Size: 1169 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20031026/91ccfa63/captions.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: themedmenu.patch
Type: text/x-diff
Size: 1656 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20031026/91ccfa63/themedmenu.bin


More information about the mythtv-dev mailing list