[mythtv] mythvideo+mythui: get statetype "watchedstate" working for DLG_TREE

Paul Harrison mythtv at sky.com
Fri Nov 25 07:21:46 UTC 2011


On 11/24/11, Markus Schulz <msc at antzsystem.de> wrote:
> hello
>
> i'm trying to allow the statetype "watchedstate" (and all other
> statetypes like userratingstate, ...) to work inside the DLG_TREE.
>
> Currently something like:
>                 <statetype name="watchedstate">
>                     <state name="no">
>                         <textarea name="uhuh">
>                             <area>974,56,50,30</area>
>                             <align>allcenter</align>
>                             <font>basesmallgreen</font>
>                             <alpha>210</alpha>
>                             <value>New</value>
>                         </textarea>
>                     </state>
>                     <state name="yes" />
>                 </statetype>
>
> in your video-ui buttonlist don't work if the user use the DLG_TREE.
>
> For type != DLG_TREE it works because in VideoDialog::loadData() the
> m_videoButtonList was initialized with new MythUIButtonListItem() items
> and each item was passed thru UpdateItem() where the handleState() stuff
> was done.
>
> for the DLG_TREE we need a different solution.
> at best by iterate thru all ButtonLists/Items from the ButtonTree and
> call UpdateItem() for each ButtonListItem.
> But with current API this is not possible.(please correct me if i am
> wrong)
>
> Another solution (my current choice) connects the
> SIGNAL(itemVisible(MythUIButtonListItem *))
> from the VideoButtonTree with a new function and do the handlestate()
> stuff inside this one.(patch attached to this mail)
> But this solution has the drawback, that the signal itemVisible occurs
> rather often (one signal for each item currently visible on each move)
> and i need it only once after building the tree.
>
> i have attached my current version and would like to hear some comments.
>
> regards
> msc
>

If I understand your problem correctly you probably want to look at
sub classing MythGenericTree and overriding CreateListButton() thats
what I do in MythMusic. That way you can do what you like with the
created MythUIButtonListItem allowing you to add any images or update
any statesypes or text areas etc.

If you need any more help let me know and I can post some example code
I just don't have access to it at the moment.

Paul H.


More information about the mythtv-dev mailing list