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

Jason Parekh jasonparekh at gmail.com
Thu Jul 8 07:01:37 EDT 2004


On Thu, 8 Jul 2004 01:46:24 -0500, joel at tamkin.net <joel at tamkin.net> wrote:
> All,
> 
> Has anyone considered allowing for scripting of/from xml menu files?
> 
> USAGE EXAMPLE:
> In mainmenu.xml:
> ..
> <button …>
>>        <action>EXEC /home/mythtv/buildxmlmenu.py</action>      ← gets
> run first
>        <action>MENU newmenu.xml</action>
> ← gets run second
> </button>
>> 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,
> etc.
> 
> I've implemented a change to themedmenu.cpp which allows multiple
> 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'm 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've noticed in testing this that there is an existing bug
> (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
> "returning to the main menu…".  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
> error...Example:
> 
> Button Z Is defined in mainmenu.xml with <action>MENU
> notthere.xml</action>
> User clicks button Z, receives error message, clicks ok.
> Mainmenu is displayed
> User attempts to exit mythtv ('q', remotecontrolbuttonofchoice, etc…)
> Mainmenu is displayed again (should have been the "are you sure you
> want to exit?" dialog
> User attempts to exit from THIS mainmenu, and now proceeds as normal.
> 
> Hope that makes sense?


Hey,

I'd love to test your code out as I was looking for something similar
to this as well but it was on my todo list..  This would be extremely
useful just to link simple programs to mythTV without having to create
a plugin for each one..

Anyway, if you could post/email me the files/patch I'd appreciate it..

thanks
jason


More information about the mythtv-dev mailing list