[mythtv-theming] New MythTV notification center and theme...

Jean-Yves Avenard jyavenard at gmail.com
Sun Jul 14 08:46:39 UTC 2013


Hi

On 11 July 2013 21:01, Paul Harrison <mythtv at sky.com> wrote:

> You would probably add something like this in the default theme to replace
> your error image :-
>
>     <statetype name="errorstate">
>         <position>30,670</position>
>         <state name="ok" />
>         <state name="error">
>             <imagetype name="errorimage">
>                 <filename>error.png</filename>
>             </imagetype>
>         </state>
>     </statetype>
>
> And in your code usually in the Create() for your screen you would find and
> save the statetype
>
> UIUtilW::Assign(this, m_errorState, "errorstate");
>
> then when you need to update it
>
> bool error = ???; // set the error flag as appropriate
>
> if (m_errorState)
>       m_errorState->DisplayState(error ? "ok" : "noerror");
>
>
> The advantage is the themer can call the error image want ever they want or
> even use text to display the error state like this.
>
>     <statetype name="errorstate">
>         <position>30,670</position>
>         <state name="ok" />
>         <state name="error">
>             <text name="errortext" from="basetextarea">
>                 <font>basemediumred</font>
>                 <value>ERROR!</value>
>             </text>
>         </state>
>     </statetype>
>
>
> It would also be possible to add other error states like 'connectionerror' ,
> 'ituneserror' if that is something that you wanted.
>

I had a crack at it...

And I wish it was that simple.. But it's not

So sure I can create a state indicating the error.
But then how would I set my normal image if it's not an error?

I can't put my image type inside a state-type otherwise it's not a
direct children of my screen anymore, and I can't set it.

As you can't set a dependency on an image being displayed within a
statetype (I tried, that dependency never resolve), I would then have
to choose between the error being displayed, or the image I do want to
display. Or both at the same time...


More information about the mythtv-theming mailing list