Menu themes allow the user to customize where certain myth features are located. By creating a customized menu theme, users can tailor MythTV to their own usage. The goal of this guide is to familiarize users with the menu's XML format and to create a comprehensive list of actions that will allow the user to invoke plugins and other menus. This document assumes that mythtv is installed in the "/usr" directory. If it is installed in the "/usr/local" directory, substitute everywhere that says "/usr/" with "/usr/local/".

+

Menu themes allow the user to customize where certain myth features are located. By creating a customized menu theme, users can tailor MythTV to their own usage. The goal of this guide is to familiarize users with the menu's XML format and to create a comprehensive list of actions that will allow the user to invoke plugins and other menus. This document assumes that the main mythtv theme directories are in the "/usr/share/mythtv/themes" directory. If MythTV is installed in the "/usr/local" directory, substitute everywhere that says "/usr/" with "/usr/local/".

Line 7:

Line 7:

==Overview==

==Overview==

−

Menu themes are a series of XML documents. The XML document defines what "buttons" are shown on each menu. Each XML document describes one menu.

+

Menu themes are a series of XML documents used by the MythFrontend application to define what items are shown on each menu. Each XML document describes one menu.

+

Keep in mind that many of the pages within the MythTV user interface are not menus. Also, the XML documents in a menu theme control ''what'' text or message will appear for each item in the menu, and ''what happens'' when that item is selected. The ''appearance'' of the menu and menu items, and what graphics are associated with them, are controlled from the UI theme's XML files, not the menu theme's.

−

==First Step==

+

==Setting Up==

−

The first step is to create a directory to hold the menu's XML document. If unsure, a good place is in the home folder. The directory can be called anything that is not already a theme of any kind. To find out what not to call the menu theme, use the following command in a terminal:

+

The easiest way to get into menu theme development is to start by making changes to an existing theme. Select the menu theme you'd like to change from within MythFrontend (that should be found in Setup, Appearance). Launch a command line (if you need to). Normally, this will put you in your home directory. If you've already launched MythFrontend on your machine, then the .mythtv directory should have already been created, but if not, the following command will create it.

−

$ ls /usr/share/mythtv/themes

+

$ cd

+

$ if [ ! -d .mythtv ] ; then mkdir .mythtv; fi; cd .mythtv;

−

Type the following to create a directory for a menutheme in "~/mymenuthemes/mymenu".

+

Create a 'themes' directory if it doesn't already exist, and move into that directory:

−

$ mkdir -p ~/mymenuthemes/mymenu && cd ~/mymenuthemes/mymenu

+

$ mkdir themes; cd themes

−

It is generally a good idea to sketch out how the new menu is to be laid out. This will decrease the chance of error as well as speed up the development process.

+

Now create a directory with the same name as the menu theme you want to change. If you're using 'mediacentermenu,' then do this:

−

==Creating a Main Menu==

+

$ mkdir mediacentermenu; cd mediacentermenu

−

To create the main menu, create a new document called "mainmenu.xml" For example, this command can be typed at the terminal:

+

−

$ gedit mainmenu.xml

+

''NOTE: You '''cannot''' override the defaultmenu theme, you must choose a different theme (such as mediacentermenu) and modify it instead.''

−

Alternatively, you can copy the default menu theme to use as a template for creating your theme:

+

Now you're set up to experiment with editing the menus without having to change the original files. MythFrontend will check both its own themes directories for XML files, and the themes directory you just created. Any files appearing in your personal themes directories will override the regular ones, so you can copy theme files to the appropriate place in your .mythtv directory to edit them, but if you want to revert back to the way it was, just delete your file or recopy it from the main. Make sure you have configured MythFrontend to use the menu theme you are overriding.

−

$ cp /usr/share/mythtv/mainmenu.xml .

+

−

The first line of the document will always be

+

==Editing a Main Menu==

+

To edit the main menu, start by retrieving a copy of the existing main menu file.

+

+

$ cp /usr/share/mythtv/themes/defaultmenu/mainmenu.xml .

+

+

Note: if you're working with MythFrontend.app on a Mac, the theme files are contained in the app itself. If MythFrontend is installed in the default location, then you can access the theme files like this:

Edit the file with your preferred editing tool. The first line of the document will always be

<mythmenu name="MAIN">

<mythmenu name="MAIN">

Line 40:

Line 50:

<type>SOME_TYPE</type>

<type>SOME_TYPE</type>

<text>My Text</text>

<text>My Text</text>

−

<text lang="XX">My Text in XX</text>

<description>Longer description of actions</description>

<description>Longer description of actions</description>

<action>SOME_TYPE_ACTION</action>

<action>SOME_TYPE_ACTION</action>

Line 50:

Line 59:

* <type> This tag defines what kind of button this is. This will determine what picture is shown when the button is highlighted. A list of known types can be found in [[#Appendix A: Types|Appendix A: Types]].

* <type> This tag defines what kind of button this is. This will determine what picture is shown when the button is highlighted. A list of known types can be found in [[#Appendix A: Types|Appendix A: Types]].

* <text> The default text that appears on the screen. This is generally written in English.

* <text> The default text that appears on the screen. This is generally written in English.

−

* <text lang="XX"> Text that will appear if the user's locale is XX. There may be more than one of these tags

+

* <text lang="XX"> Text that will appear if the user's locale is XX. There may be more than one of these tags. <b>DEPRECATED, SHOULD NO LONGER BE USED!</b>

−

* <description> A description of this menu item which will optionally be shown in a theme when it is selected

+

* <description> A description of this menu item which will optionally be shown in a theme when it is selected.

−

* <action> The action that will result when the user selects the button. A complete list of known actions can be found in [[#Appendix B: Actions|Appendix B: Actions]]

+

* <action> The action that will result when the user selects the button. A complete list of known actions can be found in [[#Appendix B: Actions|Appendix B: Actions]].

−

* <depends> Indicates that the button will only be shown if the indicated plugin is installed

+

* <depends> Indicates that the button will only be shown if the indicated plugin is installed.

==More Menus==

==More Menus==

Line 66:

Line 75:

<type>MENU_TYPE</type>

<type>MENU_TYPE</type>

<text>Go to another Menu</text>

<text>Go to another Menu</text>

−

<text lang="XX">Ogay otay notheray enumay</text>

<action>MENU newmenu.xml</action>

<action>MENU newmenu.xml</action>

</button>

</button>

−

==Putting it all together==

+

==Testing==

−

After all of the xml files have been created, simply (as root) copy the folder into your mythtv installation themes folder. This will usually be in /usr/share/mythtv/themes. After that, run mythfrontend.

+

Conveniently, MythFrontend reads the XML files every time it enters a menu, so for every menu except the main menu, you can test it by saving the changes, then moving to the menu in MythFrontend. Make another change, save it, back up one level in MythFrontend, then go back down to the menu you're working on. This doesn't work with the main menu because there's no place to "back up" to; you'll have to quit and relaunch, or configure a hot key or menu item that commands MythFrontend to reload the UI.

−

/home/you/mymenuthemes/mymenu$ su

−

/home/you/mymenuthemes/mymenu# cd ..

−

/home/you/mymenuthemes# cp -r mymenu /usr/share/mythtv/themes

−

/home/you/mymenuthemes# exit

−

/home/you/mymenuthemes$ mythfrontend

−

−

To activate the new theme, go to the appearance settings in mythfrontend and select the new theme. Remember, if you want to switch back to another theme, your theme has to have a link somewhere to the appearace settings (SETTINGS APPEARANCE).

==Helpful Tips==

==Helpful Tips==

Line 88:

Line 89:

<text>Watch DVD</text>

<text>Watch DVD</text>

<action>EXEC xine --fullscreen dvd:/</action>

<action>EXEC xine --fullscreen dvd:/</action>

−

<depends>mythdvd</depends>

</button>

</button>

This should probably only be used on a personal level since another user may not have the custom program.

This should probably only be used on a personal level since another user may not have the custom program.

−

However, the action shown above--playing a DVD through xine--should probably be done directly using the following

+

However, the action shown above, playing a DVD, should probably be done directly using the following

<button>

<button>

Line 107:

Line 107:

<depends>mythvideo</depends>

<depends>mythvideo</depends>

</button>

</button>

+

+

In the development of 0.25, the code was changed to not be specific to DVD discs, so the jump target changed, so you would instead use the following

+

+

<button>

+

<type>DISC_PLAY</type>

+

<text>Play DVD</text>

+

<action>JUMP Play Disc</action>

+

</button>

+

+

+

If you're having trouble figuring out which file(s) you need to edit in order to change a particular part of the interface, there's a [http://howell.seattle.wa.us/mythtv graphical map] available that shows how the 'defaultmenu' theme works with the rest of the user interface

==Appendix A: Types==

==Appendix A: Types==

Line 160:

Line 171:

* DVD_SETTINGS_GENERAL

* DVD_SETTINGS_GENERAL

* DVD_SETTINGS_PLAY

* DVD_SETTINGS_PLAY

−

* DVD_SETTINGS_RIP

* DVD_PLAY

* DVD_PLAY

* VCD_PLAY

* VCD_PLAY

−

* DVD_RIP

+

====GAME====

====GAME====

* GAME

* GAME

Line 199:

Line 209:

==Appendix B: Actions==

==Appendix B: Actions==

+

Note: the relationship between an action and what MythTV actually does when that action is invoked does not appear to be documented anywhere. The "uses window XXX" notes added here were determined by trial and error. A more complete reference for these actions can be found as part of the [http://howell.seattle.wa.us/mythtv graphical map] mentioned earlier.

Introduction

Menu themes allow the user to customize where certain myth features are located. By creating a customized menu theme, users can tailor MythTV to their own usage. The goal of this guide is to familiarize users with the menu's XML format and to create a comprehensive list of actions that will allow the user to invoke plugins and other menus. This document assumes that the main mythtv theme directories are in the "/usr/share/mythtv/themes" directory. If MythTV is installed in the "/usr/local" directory, substitute everywhere that says "/usr/" with "/usr/local/".

Overview

Menu themes are a series of XML documents used by the MythFrontend application to define what items are shown on each menu. Each XML document describes one menu.
Keep in mind that many of the pages within the MythTV user interface are not menus. Also, the XML documents in a menu theme control what text or message will appear for each item in the menu, and what happens when that item is selected. The appearance of the menu and menu items, and what graphics are associated with them, are controlled from the UI theme's XML files, not the menu theme's.

Setting Up

The easiest way to get into menu theme development is to start by making changes to an existing theme. Select the menu theme you'd like to change from within MythFrontend (that should be found in Setup, Appearance). Launch a command line (if you need to). Normally, this will put you in your home directory. If you've already launched MythFrontend on your machine, then the .mythtv directory should have already been created, but if not, the following command will create it.

$ cd
$ if [ ! -d .mythtv ] ; then mkdir .mythtv; fi; cd .mythtv;

Create a 'themes' directory if it doesn't already exist, and move into that directory:

$ mkdir themes; cd themes

Now create a directory with the same name as the menu theme you want to change. If you're using 'mediacentermenu,' then do this:

$ mkdir mediacentermenu; cd mediacentermenu

NOTE: You cannot override the defaultmenu theme, you must choose a different theme (such as mediacentermenu) and modify it instead.

Now you're set up to experiment with editing the menus without having to change the original files. MythFrontend will check both its own themes directories for XML files, and the themes directory you just created. Any files appearing in your personal themes directories will override the regular ones, so you can copy theme files to the appropriate place in your .mythtv directory to edit them, but if you want to revert back to the way it was, just delete your file or recopy it from the main. Make sure you have configured MythFrontend to use the menu theme you are overriding.

Editing a Main Menu

To edit the main menu, start by retrieving a copy of the existing main menu file.

$ cp /usr/share/mythtv/themes/defaultmenu/mainmenu.xml .

Note: if you're working with MythFrontend.app on a Mac, the theme files are contained in the app itself. If MythFrontend is installed in the default location, then you can access the theme files like this:

<type> This tag defines what kind of button this is. This will determine what picture is shown when the button is highlighted. A list of known types can be found in Appendix A: Types.

<text> The default text that appears on the screen. This is generally written in English.

<text lang="XX"> Text that will appear if the user's locale is XX. There may be more than one of these tags. DEPRECATED, SHOULD NO LONGER BE USED!

<description> A description of this menu item which will optionally be shown in a theme when it is selected.

<action> The action that will result when the user selects the button. A complete list of known actions can be found in Appendix B: Actions.

<depends> Indicates that the button will only be shown if the indicated plugin is installed.

More Menus

One menu is usually not enough. To organize things, other menus can be created. A new menu will be an xml document of any name. New menus also start out with the tag <mythmenu name="NAME">. Replace "NAME" with an identifier of choice. Remember that the xml document must end with </mythmenu>.

Linking to another Menu

Testing

Conveniently, MythFrontend reads the XML files every time it enters a menu, so for every menu except the main menu, you can test it by saving the changes, then moving to the menu in MythFrontend. Make another change, save it, back up one level in MythFrontend, then go back down to the menu you're working on. This doesn't work with the main menu because there's no place to "back up" to; you'll have to quit and relaunch, or configure a hot key or menu item that commands MythFrontend to reload the UI.

Helpful Tips

To execute an external program through the MythTV menus and tell MythTV to ignore LIRC button presses until the program exits, add an EXEC action to the desired menu:

If you're having trouble figuring out which file(s) you need to edit in order to change a particular part of the interface, there's a graphical map available that shows how the 'defaultmenu' theme works with the rest of the user interface

Appendix A: Types

Other graphical theme writers may include other types in their themes. These types are the ones referenced to in the default theme.

TV

TV

TV_RECPRIORITIES_SETTINGS_GENERAL

TV_RECPRIORITIES_CHANNEL

TV_PROGRAM_GUIDE

TV_PROGFIND

TV_SEARCH_WORDS

TV_SEARCH_LISTS

TV_MANUAL_SCHEDULE

TV_RECPRIORITIES

TV_CONFLICTS

TV_SEARCH_TITLES

TV_SEARCH_KEYWORDS

TV_SEARCH_PEOPLE

TV_SEARCH_NEW_TITLES

TV_SEARCH_MOVIES

TV_SEARCH_CATEGORIES

TV_SEARCH_CHANNELS

TV_SEARCH_TIMES

TV_SETTINGS_GENERAL

TV_SETTINGS_PROGRAM_GUIDE

TV_SETTINGS_PLAYBACK

TV_SETTINGS_RECORDING_PROFILES

TV_SETTINGS_RECPRIORITIES

TV_WATCH_TV

TV_SCHEDULE_RECORDINGS

TV_WATCH_RECORDINGS

TV_DELETE

TV_STATUS

Music

MUSIC

MUSIC_SETTINGS_GENERAL

MUSIC_SETTINGS_PLAYER

MUSIC_SETTINGS_RIP

MUSIC_PLAY

MUSIC_PLAYLIST

MUSIC_RIP

MUSIC_SCAN

VIDEO

VIDEO

VIDEO_SETTINGS_GENERAL

VIDEO_SETTINGS_PLAYER

VIDEO_FILE_TYPES

VIDEO_BROWSER

VIDEO_LIST

VIDEO_MANAGER

DVD

DVD

DVD_SETTINGS_GENERAL

DVD_SETTINGS_PLAY

DVD_PLAY

VCD_PLAY

GAME

GAME

GAME_SETTINGS_GENERAL

GAME_SCAN

SETUP/SETTINGS

SETUP

SETTINGS_GENERAL

SETTINGS_APPEARANCE

SETTINGS_TV

SETTINGS_MUSIC

SETTINGS_VIDEO

SETTINGS_DVD

SETTINGS_FM

SETTINGS_IMAGES

SETTINGS_GAME

SETTINGS_WEATHER

SETTINGS_NEWS

SETTINGS_WEBPAGE

SETTINGS_RECIPE

SETTINGS_XBOX

SETUP_GENERAL

SETUP_CAPTURE_CARDS

SETUP_VIDEO_SOURCES

SETUP_INPUT_CONNECTIONS

SETUP_CHANNEL_EDITOR

MISC

FM

IMAGES

WEATHER

NEWS

WEBPAGE

RECIPE

SHUTDOWN

Appendix B: Actions

Note: the relationship between an action and what MythTV actually does when that action is invoked does not appear to be documented anywhere. The "uses window XXX" notes added here were determined by trial and error. A more complete reference for these actions can be found as part of the graphical map mentioned earlier.