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

Joey Morris rjmorris.list at zoho.com
Sun Jul 28 22:02:56 UTC 2013


Paul Harrison <mythtv at sky.com> wrote on Thu, Jul 11, 2013 at 05:50:25PM +0100:
> 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 :)

Thanks for the thorough response, Paul! Sorry for taking so long to
respond.

Looking through Create() and finding toMap() calls is good advice.
However, it wouldn't have helped me in this case, because nodetype
isn't referenced in Create() and isn't in the metadata map. (Here, I'm
imagining the scenario where I know I want something that
distinguishes files from directories, but I don't know whether it
exists or what it's named. This would have been my situation if I
hadn't stumbled across nodetype in another theme.) UpdateItem() is
where I would have found nodetype. And for what it's worth, I also
found the childcount widget there, which isn't in the wiki. I'll add
both of these to the wiki.

I was thinking the complete set of widgets for a page might be stored
in some sort of collection, and I could add debugging code to iterate
over it and print them out. I looked for something like that but
didn't see anything, although I'm not very familiar with the codebase
and easily could have missed it.

Maybe just asking on the list is the most efficient way. :-)



More information about the mythtv-theming mailing list