Conditional Visibility Custom Condition (1 Viewer)

steve42

MP Donator
  • Premium Supporter
  • November 9, 2008
    79
    30
    Ettlingen
    Home Country
    Germany Germany
    Hi all,

    I'm the developer of the FritzManager / FritzBox Manager plugin. The plugin detects new messages on the voicebox and I want to show a control (a button) on the home screen, which says "there are new messages, please click to show".

    So I want to use conditional visibility and a adjusted home screen skin file, but I found no way to define a custom condition in my plugin.

    This page MediaPortal1_Development/SkinArchitecture/skin_conditional_visibility - MediaPortal Manual Documentation referes to all "internal" conditions, but nothind is say about how to define new custom conditions.

    Any hints? (If the answer will be "read the source code", then please include filename and line number.)

    steve
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    Define a new skin property (something like #FritzBox.NewMessageCount) in your plugin. To do this use:
    Code:
    GUIPropertyManager.SetProperty("#FritzBox.NewMessageCount", string.empty);
    at plugin initialization. Then whenever the new message count changes use:
    Code:
    GUIPropertyManager.SetProperty("#FritzBox.NewMessageCount", newMessageCount.ToString());
    where newMessageCount is a local (int I assume) variable holding the message count.
    In the modified skin use the following condition:
    Code:
    <visible>!string.equals(#FritzBox.NewMessageCount,0)</visible>
     

    steve42

    MP Donator
  • Premium Supporter
  • November 9, 2008
    79
    30
    Ettlingen
    Home Country
    Germany Germany
    Hi arion,

    Code:
    <visible>!string.equals(#FritzBox.NewMessageCount,0)</visible>

    it looks like that this expression has a problem with the "!" at the beginning. without negation everthing works as expected, but when I add
    the ! the condition is always true.

    Looks like a bug.
     

    Users who are viewing this thread


    Write your reply...
    Top Bottom