[mythtv] Create XML menus dynamically - plus existing bug in themedmenus.cpp

joel at tamkin.net joel at tamkin.net
Thu Jul 8 02:46:24 EDT 2004


Has anyone considered allowing for scripting of/from xml menu files? =20

In mainmenu.xml:
<button =1B$B!D=1B(B>
	<action>EXEC /home/mythtv/buildxmlmenu.py</action>	=1B$B"+=1B(B gets
run first
	<action>MENU newmenu.xml</action> 			=09
=1B$B"+=1B(B gets run second
By allowing for multiple actions (executed serially), the
buildxmlmenu.py script dynamically creates newmenu.xml, which could have
similar submenus, all dynamically created using your favorite scripting
language.  One could also play sounds, etc, before navigating to menus,
I=1B$B!G=1B(Bve implemented a change to themedmenu.cpp which allows =
actions to be defined (using a vector<QString> of actions, instead of a
single QString.  Also made the necessary changes to run handleAction for
each defined action).

I=1B$B!G=1B(Bm planning on using this to build a simple voicemail =
manager for my
AsteriskPBX, but I can think of many uses for it - particularly for
simple apps which lend themselves to perl/python/shell scripts, etc.

Please let me know if you're interested in seeing/testing the code... I
haven't done C++ development since college, and am relatively new to
Linux, so I have yet to master the patch generation process... but my
changes seem to work well.

Joel Tamkin

BUG:  I=1B$B!G=1B(Bve noticed in testing this that there is an existing =
(feature?)  in the current CVS themedmenus.cpp.  When a MENU action
points to a non-existent .xml file, an error is raised with the user
=1B$B!H=1B(Breturning to the main menu=1B$B!D!I=1B(B.  Fine.  However, =
the resulting
mainmenu is presented as a sub-menu of the current menu, even if the
current menu was the main menu.  It sounds like the menulevel variable
needs to be decremented (or reinitialized to zero?) after this

Button Z Is defined in mainmenu.xml with <action>MENU
User clicks button Z, receives error message, clicks ok.
Mainmenu is displayed
User attempts to exit mythtv (=1B$B!F=1B(Bq=1B$B!G=1B(B, =
remotecontrolbuttonofchoice, etc=1B$B!D=1B(B)
Mainmenu is displayed again (should have been the =1B$B!H=1B(Bare you =
sure you
want to exit?=1B$B!I=1B(B dialog
User attempts to exit from THIS mainmenu, and now proceeds as normal.

Hope that makes sense?

More information about the mythtv-dev mailing list