[mythtv-theming] list of widgets available on each window

Paul Harrison mythtv at sky.com
Thu Jul 11 16:50:25 UTC 2013


On 11/07/13 13:09, Joey Morris wrote:
> Is there a way to get a full list of the widgets available on a
> window, such as the "tree" window in video-ui.xml? The wiki page is
> the obvious place to look, but it's out of date in some cases. For
> example, I wanted a way to distinguish directories from videos in the
> tree window, but I didn't see anything in the wiki related to that.
> Then I was looking at another theme and noticed it used the "nodetype"
> statetype with states "subfolder" and "upfolder". Perhaps it also
> defines a "file" or "video" state, but I'm not sure.
>
> I don't mind looking in the source code to find the widget names if
> that's the best solution, but could someone give me a hint on where to
> look? I do plan to update the wiki with the new widgets I find.
>

If the info is not on the wiki page then looking at the source is the 
only way I think.

Clone the source using git then you can use the git tools to help find 
what you want.

git grep video-ui.xml  - will tell you which file or files to look in. 
videodlg.cpp looks promising.

git log --grep nodetype - will tell you the commits that mention 
nodetype in the log

commit a7b6c2a34b98 from Stuart M. looks relevant but unfortunately not 
much info in the commit log :( so looking at what changed might show 
more info

git show a7b6c2a34b98 - would show you what was changed.

There are many other tools in git to help you find what you want.

Most of the time simply looking for a function called Create() you tell 
you what widgets a screen is looking for. The one for the MythVideo 
browser screens looks like this

     if (m_d->m_type == DLG_TREE)
         UIUtilE::Assign(this, m_videoButtonTree, "videos", &err);
     else
         UIUtilE::Assign(this, m_videoButtonList, "videos", &err);

     UIUtilW::Assign(this, m_titleText, "title");
     UIUtilW::Assign(this, m_novideoText, "novideos");
     UIUtilW::Assign(this, m_positionText, "position");
     UIUtilW::Assign(this, m_crumbText, "breadcrumbs");

     UIUtilW::Assign(this, m_coverImage, "coverart");
     UIUtilW::Assign(this, m_screenshot, "screenshot");
     UIUtilW::Assign(this, m_banner, "banner");
     UIUtilW::Assign(this, m_fanart, "fanart");

     UIUtilW::Assign(this, m_trailerState, "trailerstate");
     UIUtilW::Assign(this, m_parentalLevelState, "parentallevel");
     UIUtilW::Assign(this, m_watchedState, "watchedstate");
     UIUtilW::Assign(this, m_studioState, "studiostate");

So you can see the names of the widgets "videos", "title, ""novideos", 
"position" etc and also you can work out the type of widget from the 
variable names usually. UIUtilE means it's a compulsory widget (throws 
an error if not found) and UIUtilW means it's optional (just shows a 
warning) so only the "video" buttontree or buttonlist is compulsory all 
the others are optional.

Also looking for functions called something like toMap() can be useful 
like the one in metadatacommon.cpp will show you the names of text areas 
or names that can be used in tempates etc.

If in doubt you can always ask here :)

Paul H.


More information about the mythtv-theming mailing list