2014-05-25, 23:51
I'm pretty lost on this one.
I implemented the ability to set custom items in my home menu.
In a custom configuration dialog the user clicks one of the custom item buttons. An example of one of these buttons:
Another custom window (96) is opened. Here the user sets the type of item (folder, add-on or playlist)
To keep things clear I'll only show the code used when the user has chosen a folder to be set as custom item, as this is where the problem lies.
The customitem.video1.path string is what we're looking at:
When everything is set, this button is added to the home menu:
And everything works perfectly... Until the XBMC system language is changed, said button will not open the user specified path anymore.
I added a label control on home to display "customitem.video1.path" just to be sure, and it shows the correct path.
I am not using any non-localized strings here, and certainly not in the path. Guess I am overlooking something really simple but I can't seem to find it.
Hopefully someone can make sense out of the snippets
I implemented the ability to set custom items in my home menu.
In a custom configuration dialog the user clicks one of the custom item buttons. An example of one of these buttons:
PHP Code:
<control type="button" id="103">
<width>484</width>
<label>Custom Item 1</label>
<label2>$INFO[Skin.String(customitem.video1.label)]</label2>
<!--(re)set category-->
<onclick>ClearProperty(customitem.category,Home)</onclick>
<onclick>SetProperty(customitem.category,video,Home)</onclick>
<!--reset previous item values-->
<onclick>Skin.Reset(customitem.video1.path)</onclick>
<onclick>Skin.Reset(customitem.video1.type)</onclick>
<!--set up new item value-->
<onclick>SetProperty(customitem.video.number,1,Home)</onclick>
<onclick>ActivateWindow(96)</onclick>
<include>dialog_Radio-alt</include>
<enable>!Skin.HasSetting(homemenu.videos.disable)</enable>
</control>
Another custom window (96) is opened. Here the user sets the type of item (folder, add-on or playlist)
To keep things clear I'll only show the code used when the user has chosen a folder to be set as custom item, as this is where the problem lies.
The customitem.video1.path string is what we're looking at:
PHP Code:
<onclick condition="StringCompare(Window(Home).Property(customitem.category),video) + StringCompare(Window(Home).Property(customitem.video.number),1)">Skin.Reset(customitem.video1.type)</onclick>
<onclick condition="StringCompare(Window(Home).Property(customitem.category),video) + StringCompare(Window(Home).Property(customitem.video.number),1)">Skin.Reset(customitem.video1.label)</onclick>
<onclick condition="StringCompare(Window(Home).Property(customitem.category),video) + StringCompare(Window(Home).Property(customitem.video.number),1)">Skin.SetString(customitem.video1.type,$LOCALIZE[20334])</onclick>
<onclick condition="StringCompare(Window(Home).Property(customitem.category),video) + StringCompare(Window(Home).Property(customitem.video.number),1)">Skin.SetPath(customitem.video1.path)</onclick>
<onclick condition="StringCompare(Window(Home).Property(customitem.category),video) + StringCompare(Window(Home).Property(customitem.video.number),1)">Skin.SetString(customitem.video1.label)</onclick>
When everything is set, this button is added to the home menu:
PHP Code:
<!--custom video entry 1-->
<control type="button" id="103">
<label>$INFO[Skin.String(customitem.video1.label)]</label>
<onleft>100</onleft>
<onback>100</onback>
<onclick condition="Skin.String(customitem.video1.type,$LOCALIZE[20334])">ActivateWindow(Videos,$INFO[Skin.String(customitem.video1.path)],return)</onclick>
<onclick condition="Skin.String(customitem.video1.type,$LOCALIZE[559])">ActivateWindow(VideoLibrary,$INFO[Skin.String(customitem.video1.playlistpath)],return)</onclick>
<onclick condition="Skin.String(customitem.video1.type,$LOCALIZE[24000])">RunAddon($INFO[Skin.String(customitem.video1.addonpath)])</onclick>
<include>home_SubMenuButton</include>
<visible>!IsEmpty(Skin.String(customitem.video1.label)) + [Control.HasFocus(1111) | Control.HasFocus(103) | Skin.String(HomeSub,$LOCALIZE[3])]</visible>
</control>
And everything works perfectly... Until the XBMC system language is changed, said button will not open the user specified path anymore.
I added a label control on home to display "customitem.video1.path" just to be sure, and it shows the correct path.
I am not using any non-localized strings here, and certainly not in the path. Guess I am overlooking something really simple but I can't seem to find it.
Hopefully someone can make sense out of the snippets