Unconsistent behavior in textboxscrollup and defines in MP 1.13 (1 Viewer)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Guys :) i really not understand :) maybe it's when it's related to skin lol
    What is the best xml to setup to trigger the issue ?
    It could be nice to have some screenshot to what should be OK and when it is not :)
     

    XMaM

    Portal Member
    December 15, 2012
    39
    46
    Asturias
    Home Country
    Spain Spain
    What is the best xml to setup to trigger the issue ?

    There are different combinations, so I would suggest, for example, using the titan skin:

    In references.xml:
    XML:
    <define>#test_textcolor_ref:ff00ff00</define>
    <define property="true">#test_textcolor_property_ref:ffff0000</define>
    <define>#test_textstring_ref:This is text in define in references.xml</define>
    <define property="true">#test_textstring_property_ref:This is text in define with property="true" in references.xml</define>


    In any window skin xml file with textboxscrollup, let's say in myvideo.xml:
    XML:
    <define>#test_textcolor_xml:ff00ff00</define>
    <define property="true">#test_textcolor_property_xml:ffff0000</define>
     
    <define>#test_textstring_xml:This is text in define</define>
    <define property="true">#test_textstring_property_xml:This is text in define with property="true"</define>
    <define property="true" evaluateNow="true">#test_textstring_propertyEvaluated_xml:This is text in define with property="true" and evaluateNow="true"</define>
     
    <define>#test_textplot_xml:Plot - #plot</define>
    <define property="true">#test_textplot_property_xml:Plot with property="true" - #plot</define>
    <define property="true" evaluateNow="true">#test_textplot_propertyEvaluated_xml:Plot with property="true" and evaluateNow="true" - #plot</define>


    Then, it's time to use the definitions. In myvideo.views.default.xml look for the textboxscrollup control:
    XML:
    <control Style="textBox">
            <description>Summary (list)</description>
            <type>textboxscrollup</type>
            <id>1025</id>
            ...
    </control>

    and replaces <label>#plot</label> with every text definition to check the <label> tag. This is the result in 1.12, in My Videos with list view (you should see the plot of the movie):
    Code:
    <label>#test_textstring_ref</label>  | does not work | show: nothing/blank
    <label>#test_textstring_property_ref</label>  | does not work | show: nothing/blank
    <label>#test_textstring_xml</label>  | does not work | show: #test_textstring_xml
    <label>#test_textstring_property_xml</label>  | work |
    <label>#test_textstring_propertyEvaluated_xml</label>  | work |
    <label>#test_textplot_xml</label>  | does not work | show: #test_textplot_xml
    <label>#test_textplot_property_xml</label>  | does not work | show: Plot with property="true" - #plot
    <label>#test_textplot_propertyEvaluated_xml</label>  | does not work | show: Plot with property="true" and evaluateNow="true" - #plot


    Then, check others tags, like <textcolor>. In the same textboxscrollup control, restore <label> to the original value (<label>#plot</label>), add the <textcolor> tag and check every color definition. Again, this is the result in 1.12:
    Code:
    <textcolor>#test_textcolor_ref</textcolor>   | work |
    <textcolor>#test_textcolor_property_ref</textcolor>   | work |
    <textcolor>#test_textcolor_xml</textcolor>   | does not work | show: nothing/blank
    <textcolor>#test_textcolor_property_xml</textcolor>   | does not work | show: nothing/blank

    I can't test 1.13 :( because now I am only running 1.12.

    I know that this is very complex, but maybe only (hopefully) the symptoms are complex because the multiple combinations, but the solution can be unique and easier :LOL:

    Thanks
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    It could be nice to be easy, i will reread you but will be hard to debug (at least for me lol)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    @XMaM to confirm you that i'm a noob in xml, i don't even know where to put the define entry lol, so if you can prepare xml for titan it could be nice :)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    It seems that i have correctly placed your code in xml but i'm not sure where going to displaying it in Titan, i'm going to Title view in myvideo :)

    upload_2016-1-15_19-9-28.png
     

    Attachments

    • XML.zip
      6.7 KB

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Ok i just setup an xml to reproduce the original issue :)
    The one explain in Jira.

    If i understand correctly, sometimes we need to not translate the define for ex :

    <define property="true" evaluateNow="false">#desc.text: Dean is surprised when he checks Bobbys cell phone and hears a message that says Bobby or his next of kin have been named as a beneficiary in an heiress will. Hoping that means extra money, Dean talks Sam into hitting the road to claim their fortune. However, what they encounter at the house is far from a treasure chest. </define>

    The value is the text : Dean ......

    To have it displayed, MP is checking the key (#desc.text) and after convert it to the value (Dean...).

    But in your ex, we need to convert it.

    So really no clue right now because skin and me is a nightmare lol
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Ok, now i remember when debugging the original issue, we have this in \mediaportal\Core\guilib\GUITextScrollUpControl.cs :

    The '_containsProperty' is set to true when and only when the property start with #......

    So for ex :
    <define property="true" evaluateNow="false">#desc.text: Dean is surprised when he checks Bobbys cell phone and hears a message that says Bobby or his next of kin have been named as a beneficiary in an heiress will. Hoping that means extra money, Dean talks Sam into hitting the road to claim their fortune. However, what they encounter at the house is far from a treasure chest. </define>

    This property start with #desc.text, so when GUITextScrollUpControl code detect #desc.text, _containsProperty is true and then the text is displayed.

    The fix from Jira, does that :

    C#:
    if (text.Length > 0 && text[0] == '#' && control.Type != "textboxscrollup")
              {
                string foundDefine = null;
    
                if (defines.TryGetValue(text, out foundDefine))
                {
                  text = foundDefine;
                }
                else
                {
                  if (_cachedDefines.TryGetValue(text, out foundDefine))
                  {
                    text = foundDefine;
                  }
                }
              }

    If the property start with # (here #desc.text) we will not try to look/search if #desc.text contain a define value (the text : Dean is surprised .....) because if the property will be converted to a text (here), the code from GUITextScrollUpControl will not be used and then nothing displayed.

    To summarize :
    Before the Jira, the property was checked and if a define value was found, the property was converted to the text and then textboxscrollup display nothing.
    With the Jira, it doesn't try to convert/find a define from the property and then textboxscrollup does his job and do the convertion.

    But now in your example, it seems that we need to convert the property with the correspondent value like you can see it working on 1.12.

    So i don't know what to do right now lol
     

    XMaM

    Portal Member
    December 15, 2012
    39
    46
    Asturias
    Home Country
    Spain Spain
    It seems that i have correctly placed your code in xml but i'm not sure where going to displaying it in Titan
    (well done! ;))

    Correct and wrong images:

    correct_view.jpg wrong_view.jpg

    Here are the three modified files (the files that you attached) . References.xml and myvideo.xml are more or less the same that you have. Mayors changes in myvideo.views.default.xml. In this last file, look for control id 1025 (<id>1025</id>) and see the comments. You must uncomment one line at a time, and check it.

    I think it should be easier check only one line that fails (and work over that). Please, note that I have MP 1.12, and the defines that work and don't, are differents in both versions.

    Again, thantks, thanks.
     

    Attachments

    • XML_modified.zip
      6.9 KB

    Users who are viewing this thread

    Top Bottom