[mythtv-theming] New MythTV notification center and theme...
Paul Harrison
mythtv at sky.com
Thu Jul 11 11:01:28 UTC 2013
On 11/07/13 11:30, Jean-Yves Avenard wrote:
> On 11 July 2013 18:40, Paul Harrison <mythtv at sky.com> wrote:
>> I wonder if this should not be a statetype so the theme designer can decide
>> whether to use an image or text or whatever they chose rather than hard
>> coding an image filename?
> Happy to do so... if you point me to an example making use of this..
>
> unfortunately, the documentation from a developer perspective (not
> theme developer) is somewhat.... lacking :(
>
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.
Paul H.
More information about the mythtv-theming
mailing list