Kodi Community Forum
Get label of the left side settings category ? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Get label of the left side settings category ? (/showthread.php?tid=184480)



Get label of the left side settings category ? - jurialmunkey - 2014-01-26

Hi,

I'm looking for something similar to Control.GetLabel(2) for settingscategory.xml, but for the left hand side grouplist (id=3)

e.g. When in appearance settings the categories are - skin, international, file lists, screensaver. I'm trying to get the label for what is currently selected in that grouplist. Control.GetLabel(2) returns the overall category (e.g. Appearance) but I want to get say for example 'international' if that is selected.

I've tried Control.GetLabel(3) and Control.GetLabel(10) [default category button] and Container(3).ListItem.Label but I can't figure anything out that works. It seems like I should be able to do it, but perhaps its not possible...

Any Ideas?


RE: Get label of the left side settings category ? - Hitcher - 2014-01-26

Not possible. What are you trying to do exactly?


RE: Get label of the left side settings category ? - `Black - 2014-01-26

Also tried that but it's not possible.


RE: Get label of the left side settings category ? - jurialmunkey - 2014-01-27

Ah that's a shame

@Hitcher - Its for a new skin I'm working on. I wanted to have a header such as: 'The International Settings for Appearance' so that I could hide the categories in a slide out menu. Also wanted to do a string match to change an icon in the header. Not the end of the world, but would have been a nice stylistic match for the rest of the skin...


RE: Get label of the left side settings category ? - jurialmunkey - 2014-02-06

@Black - I actually figured out a trick for this

For group id 3 I set a window property onfocus and ondown/onleft etc.
Code:
<onfocus>SetProperty(SettingLabel,$INFO[System.CurrentControl])</onfocus>
<ondown>SetProperty(SettingLabel,$INFO[System.CurrentControl])</ondown>

Then I have a label variable like such
Code:
<value condition="!ControlGroup(5).HasFocus()">$INFO[System.CurrentControl]</value>
<value>$INFO[Window.Property(SettingLabel)]</value>

Also, in the process of testing this I noticed that ControlGroup(3).HasFocus() doesn't work in SettingsCategory.xml, hence why I check controlgroup 5 instead.


RE: Get label of the left side settings category ? - `Black - 2014-02-06

Good to know, thanks for the tip.


RE: Get label of the left side settings category ? - jmarshall - 2014-02-07

Heh, nice hack Smile