Permalink
Browse files

Add a MEDIA menu item type to the main menus.

This type allows you to add menu items that can call one of the media handlers.
For example you could add a menu item to show a particular web page or to play
a video using the internal player.

An example item to run MythBrowser

    <button>
        <type>WEBPAGE</type>
        <text>WebMail</text>
        <description>Show email</description>
        <action>MEDIA WebBrowser https://example.domain.com/signin/webmail/</action>
        <depends>mythbrowser</depends>
    </button>

An example to play a video file

    <button>
        <type>VIDEO</type>
        <text>Show Example Video</text>
        <description>Show an example video</description>
        <action>MEDIA Internal /media/videos/example.mpg/</action>
    </button>
  • Loading branch information...
1 parent e73e476 commit d4a4aa39202179e5ba19fda03e62984d871f6361 Paul Harrison committed May 1, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 mythtv/libs/libmythui/myththemedmenu.cpp
@@ -849,6 +849,14 @@ bool MythThemedMenu::handleAction(const QString &action, const QString &password
QString rest = action.right(action.length() - 5);
GetMythMainWindow()->JumpTo(rest, false);
}
+ else if (action.left(6) == "MEDIA ")
+ {
+ // the format is MEDIA HANDLER URL
+ // TODO: allow spaces in the url
+ QStringList list = action.simplified().split(' ');
+ if (list.size() >= 3)
+ GetMythMainWindow()->HandleMedia(list[1], list[2]);
+ }
else
{
m_selection = action;

0 comments on commit d4a4aa3

Please sign in to comment.