Kodi Community Forum

Full Version: script.skinshortcuts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I think I might have to add this to the skin settings instead by loading the skinshortcuts-mainmenu include and then letting the user select from a list of widgets for each entry.
Hi Unfledged

I have a custom items list that i want to use them as widgets in the home screen optional from the script's manage dialog. These custom items are set through a custom manage dialog that i call for several other reasons (hide or show items in skin settings) by setting a window property depending on what items i want to edit/manage.
Now, when i call that custom dialog with the property to show and edit/manage those custom items from skin settings, it works fine. When i call the same custom dialog with the same window property from the script's manage dialog i get an empty dialog.

Is that a bug of the script or am i doing something wrong here ?

This is the button that use to call the custom dialog with the property to show and edit/manage the custom items from Skin Settings :
PHP Code:
<control type="button" id="8603">
  <include>
SettingsButton</include>
  <
label>$LOCALIZE[31395]</label>
  <
onclick>SetProperty(ManageButtons,customitems)</onclick>
  <
onclick>ActivateWindow(1118)</onclick>
  <
visible>!Skin.HasSetting(DisableQuickNav)</visible>
</
control

and this is the button when call it from script's manage dialog:
PHP Code:
<control type="button" id="30003">
  <
width>400</width>
  <
height>40</height>
  <
font>FontSize_20</font>
  <
textcolor>77white</textcolor>
  <
focusedcolor>white</focusedcolor>
  <
disabledcolor>33white</disabledcolor>
  <
shadowcolor>99000000</shadowcolor>
  <
texturefocus>buttons/focus.png</texturefocus>
  <
texturenofocus>-</texturenofocus>
  <
align>left</align>
  <
textoffsetx>10</textoffsetx>
  <
label>$LOCALIZE[31395]</label>
  <
onclick>SetProperty(ManageButtons,customitems)</onclick>
  <
onclick>ActivateWindow(1118)</onclick>
  <
visible>StringCompare(Window.Property("groupname"),mainmenu) + StringCompare(Container(211).ListItem.Property(Widget),CustomItems)</visible>
</
control


This is the list of the custom items in my custom dialog
http://pastebin.com/LywN2uKF


The window property is cleared in every <onunload> of my custom manage dialog
PHP Code:
<onunload condition="!IsEmpty(Window(SkinSettings).Property(ManageButtons))">ClearProperty(ManageButtons,SkinSettings)</onunload


Cheers
Nessus

removed151214

I'll look properly this evening, but my first thought would be to directly specify which window you're setting the property to.

Code:
SetProperty(ManageButtons,customitems,skinsettings)

If I'm understanding right, you're setting the property to the skin shortcuts window, but your custom dialog is reading it from the skinsettings window.
You are correct. I've totally miss that Confused
Sorry, my bad Big Grin

Re-thinking on how to do that i have another question. Is it possible when i am setting a custom item instead of using favorites script (or SuperFavorites, or directly an addon selection etc), to use scripts shortcuts ?. If yes, what's the command for that ?

I mean with the super.favourites script i use this...
PHP Code:
<control type="button" id="8661">
  <
description>Custom Item 1</description>
  <
width>435</width>
  <include>
DialogsButton</include>
  <
label>$LOCALIZE[313961</label>
  <
label2>[COLOR=selected]$INFO[Skin.String(CustomItem1.Label)][/COLOR]</label2>
  <
onclick>RunScript(special://home/addons/plugin.program.super.favourites/chooser.py,property=CustomItem1&amp;changetitle=true)</onclick>
</control

and the item in the list it looks like this...
PHP Code:
<item id="1">
  <
label>$INFO[Skin.String(CustomItem1.Label)]</label>
  <
thumb>$INFO[Skin.String(CustomItem1.Icon)]</thumb>
  <
onclick>PreviousMenu</onclick>
  <
onclick>$INFO[Skin.String(CustomItem1.Path)]</onclick>
  <
visible>!IsEmpty(Skin.String(CustomItem1.Path))</visible>
</
item

How it will be if use skinshortcuts script to set the custom item (path and label) ?

Cheers
Nessus

removed151214

That would be the "Just Select Shortcut" function - detailed in Advanced Usage.txt, but for the label and action something like

Code:
RunScript(script.skinshortcuts,type=shortcuts&amp;skinLabel=CustomItem1.Label&amp;skinAction=CustomItem1.Path)
Thanks. Works great.

By the way, you've miss the "s" in "type=shortcut(s)" in your post Wink

Cheers
Nessus

removed151214

Technically I added an extra 's' when I wrote the function, and forgot to remove it before I published Wink Updated the post.
Cool
(2014-11-09, 17:16)Unfledged Wrote: [ -> ]That would be the "Just Select Shortcut" function - detailed in Advanced Usage.txt, but for the label and action something like

Code:
RunScript(script.skinshortcuts,type=shortcuts&amp;skinLabel=CustomItem1.Label&amp;skinAction=CustomItem1.Path)
I have one more question about this. Is it possible with this command to allow users to change the label and the thumb by adding some more parameters, or do i have to add separate buttons with Skin.SetString and Skin.SetImage onclick actions ?


Cheers
Nessus

removed151214

Yes, you'd need to use SetString and SetImage. At present, it's entirely up to the skin to manage the shortcut that's returned.
Ok, thanks
Hi Unfledged,
I think I've found a very small issue with the script...
In my skin I include some custom playlists. The skinshortcuts script will allow the user to select from both their own playlists and the ones the skin provides to assign it to a shortcut.

Well, that all goes well for the users own playlists, but with the skin provides shortcuts there's a slash to many in the path.
For example this:

PlayMedia(C:\Users\mvand_000\AppData\Roaming\XBMC\addons\skin.titan\playlists\/recommendedmusic.xsp)

Regards,

Marcel

removed151214

Phate89 Has done an amazing job completely revamping (and inordinately improving) the listing of playlists in the management dialog on the git version, so would you mind testing to see if the issue still exists with the latest git? Thanks Smile
Unfledged, the shortcuts inside the groups in the select dialog are not sorted alphabetically. I mean for example when you go to VideoAddons group the addons are not sorted by name using latest git. Is that on purpose ?. I am 90% sure that they were sorted by name in previous versions but again i might be wrong.

Also when open the select dialog to select a shortcut is it possible to have an "None" option on top, like it is in the widgets select dialog ?
I know that usually user will always select a shortcut for a mainmenu or submenu item but when you use the "Just Select Shortcut" function for something else (eg for custom widgets like we talk in the above posts) user might want to reset the specific item.

Cheers
Nessus

removed151214

The script doesn't do (and never has done) any sorting on any of the items it displays in the select dialog (I think - I would need to scour through the source code to be sure - but I'm definitely sure (because I just had a look Wink it doesn't for add-ons). In the case of add-ons, it just returns them in the order the json call Addons.GetAddons returns them in. I actually don't have enough add ons installed on the machine I'm sat in front of to check whether they're returned alphabetically here. I'll take a look on a different machine tomorrow - if they're not, it may be possible to apply a sort to the json call though I'm not convinced theres an alphabetical sort method available there. I don't particularly want to start sorting them manually Wink

Should be easy enough to add a "None" option. What would you expect it set the skin strings passed in to the script to?