Adding a new boolean condition
#1
Hi,

I need to add a new boolean property for my work on hiding unavailable library items.

I've successfully hidden items by using the "IsSpecial" FileItem property like this

In Kodi core:
pItem->SetProperty("isspecial", true);

and in the skin xml (ViewVideoLibrary.xml):
<visible>!ListItem.Property(IsSpecial)</visible>

But of course, isspecial is used by other parts of Kodi so I need to move this to another property. Creating the property in Kodi core seems to work with pItem->SetProperty("isavailable", true); But how do I create a corresponding "getter" for the skin, like ListItem.Property(IsAvailable)?
Reply
#2
props are just string<->value pairs and the support is general. set a property, and the skin can read it.
Reply
#3
My media import work has a similar functionality because it knows which media providers are available and which aren't and therefore knows which items are available and which aren't. I've added an "enabled" property to CFileItem for this and in the skinning engine it can be used with ListItem.IsEnabled. See https://github.com/Montellese/xbmc/commi...27deff9a38 (but that will soon be outdated as this code is being refactored right now by someone else).
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#4
(2015-09-02, 09:15)ironic_monkey Wrote: props are just string<->value pairs and the support is general. set a property, and the skin can read it.
Thanks, didn't expect it to be that easy Blush

(2015-09-02, 09:47)Montellese Wrote: My media import work has a similar functionality because it knows which media providers are available and which aren't and therefore knows which items are available and which aren't. I've added an "enabled" property to CFileItem for this and in the skinning engine it can be used with ListItem.IsEnabled. See https://github.com/Montellese/xbmc/commi...27deff9a38 (but that will soon be outdated as this code is being refactored right now by someone else).

Thanks, I'll check it out.
Reply

Logout Mark Read Team Forum Stats Members Help
Adding a new boolean condition2