String.Contains function.....helpppp....
#1
i'd like to use string.contains for addon settings, but i don't get the setting visble.
i use this condition for visible attribute:
Code:
visible="String.Contains(System.OSVersionInfo,Windows 7)"
how to fix and get it visible?
empty signature
Reply
#2
(2017-11-21, 17:50)harryberlin Wrote: i'd like to use string.contains for addon settings, but i don't get the setting visble.
i use this condition for visible attribute:
Code:
visible="String.Contains(System.OSVersionInfo,Windows 7)"
how to fix and get it visible?  
 All depends on the returned string, so check using a label to see what is shown for System.OSVersionInfo.
Reply
#3
The Label shows this string:
Code:
Windows 7 SP1 (kernel: Windows NT 6.1)
empty signature
Reply
#4
Maybe try -

xml:
visible="String.Contains(System.OSVersionInfo,Windows)" + "String.Contains(System.OSVersionInfo,7)"
Reply
#5
the problem with the System.OSVersionInfo infolabel is that it takes a while for kodi to retrieve the value.
if a use it in a skin label, it will initially display 'Busy' for a fraction of a second.

when testing it in addon settings, the first time i open the settings, the visible condition returns false,
but after closing and re-opening the settings, it will return true.


(moved your question to addon dev)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
i never get it visible.
it's in a further category. not first category.
the full setting example is this:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="one">
</category>
<category label="two">
</category>
<category label="three">
</category>
<category label="PiBUS">
<description>PiBus</description>
<setting label="Install Shutdown script for LibreElec" type="action" action="" id="pibus_install_power_off" enable="true" visible="String.Contains(System.OSVersionInfo,Windows 7)" />
</category>
<category label="five">
</category>
</settings>
empty signature
Reply
#7
(2017-11-22, 09:50)harryberlin Wrote: i never get it visible.
it's in a further category. not first category.
the full setting example is this:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="one">
</category>
<category label="two">
</category>
<category label="three">
</category>
<category label="PiBUS">
<description>PiBus</description>
<setting label="Install Shutdown script for LibreElec" type="action" action="" id="pibus_install_power_off" enable="true" visible="String.Contains(System.OSVersionInfo,Windows 7)" />
</category>
<category label="five">
</category>
</settings>
can't test on windows, but if i adopt the condition for linux, it works as for me the second time i enter settings.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
String.Contains function.....helpppp....0