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.

removed151214

Any last issues do let me know, as I'd really like to try to get the request for an update on the repo in tomorrow, so I can finally take it easy for those few days I tried to last week Wink
I seem to have found a issue with adding a playlist to the submenu, version="0.3.4". I've tried both skin & video playlists.
Here are the results from the script-skinshortcuts-includes.xml.

Code:
<item id="9">
            <onclick>::PLAYLIST::</onclick>
            <label>Top 250</label>
            <label2>Skin Playlist</label2>
            <icon>DefaultPlaylist.png</icon>
            <thumb />
            <property name="labelID">top250</property>
            <property name="group">x10</property>
            <visible>StringCompare(System.ProfileName,Master user)</visible>
        </item>
        <item id="10">
            <onclick>::PLAYLIST::</onclick>
            <label>top250</label>
            <label2>Video Playlist</label2>
            <icon>DefaultPlaylist.png</icon>
            <thumb />
            <property name="labelID">top250</property>
            <property name="group">x10</property>
            <visible>StringCompare(System.ProfileName,Master user)</visible>
        </item>

removed151214

(2014-06-25, 04:34)Steveb Wrote: [ -> ]I seem to have found a issue with adding a playlist to the submenu, version="0.3.4". I've tried both skin & video playlists.

You have indeed. Fixed on git. Thanks for the bug report Smile
(2014-06-24, 22:41)Unfledged Wrote: [ -> ]I had shelved it but, as you've asked, I've just pushed the code for item id's to git.
Thanks for adding it, works fine for me.

Btw. in readme file in git repo is written that you will prefer include method over Gotham lists in future. Do you plan to add better some support for standalone (without relation to main menu) menus/list into include method part? Something like manage+list where you reference only group name without necessary link to mainmenuID like in buildxml. Same goes for Widgets, i would like to have possibility to access them independently from any menus/list, only by some widgetId or something like. Btw I'm using your script only for 2 days so please correct me if something written above is wrong Smile.

removed151214

(2014-06-25, 12:06)bambi73 Wrote: [ -> ]
(2014-06-24, 22:41)Unfledged Wrote: [ -> ]I had shelved it but, as you've asked, I've just pushed the code for item id's to git.
Thanks for adding it, works fine for me.

Btw. in readme file in git repo is written that you will prefer include method over Gotham lists in future. Do you plan to add better some support for standalone (without relation to main menu) menus/list into include method part? Something like manage+list where you reference only group name without necessary link to mainmenuID like in buildxml. Same goes for Widgets, i would like to have possibility to access them independently from any menus/list, only by some widgetId or something like. Btw I'm using your script only for 2 days so please correct me if something written above is wrong Smile.

Support should already be there for standalone lists. You can manage any list you want by calling type=manage&amp;group=[group].

Just throw in any old ID for the mainmenuID when building the main menu (that's an oversight that that's always required, but not a major one - seriously, use any random number for that property if you're not linking to a main menu), and list any groups you want built in the groups parameter, separated by a pipe (the | symbol).

Then you can include "skinshortcuts-group-[group] to just display that group without any visibility condition based on a main menu.

As a general rule, featurewise the includes method should be equal-or-better than the Gotham list filling method already, and is the prefered method to use Smile If there's something missing, though, do say! (And actually using it for both a main menu-based system, and a completely standalone menu won't work right now but should be easy enough to add)

Not sure what you mean by widgets - the script just adds a widget property to menu items so that you as the skinner can display the relevant widget. Not sure how you'd access them independantly Huh

Edit: Actually, building main menu and standalone menus is easy enough to add, and sensible enough, it's now on git - invoked by using mainmenu as the first group passed in the group parameter

group=mainmenu|mygroup1|mygroup2...
I'm currently using it same way how you described and have list completely unrelated to Home screen and its menu and it's working fine. But from generated include file and brief look into code I thought that mainmenuID is mandatory. If not then it's better for me Smile.

About widgets, in my use-case I have custom Video hub window with list (filled by script) and up to 3 widgets. If I remember correctly (not at home now, so can't check it) widget property is filled to list items, but in my case I want to show same widget(s) aside from position in list. I can hardcode widgets to look for property at specific index but it'll make user configuration mess and can possibly cause problem with lists shorter than 3 items. I guess your approach is based on mainmenu + 1 widget per menu on Home screen point of view where it's logical, but it's bit limiting for other use-cases. My idea was to have possibility to save widget properties directly to Home window like script.skinshortcuts.[widgetID].widget or something similar. But maybe I'm over thinking things and there is some easy solution already available Smile

removed151214

The code for widgets (and backgrounds) is designed only with the script providing menus in mind. In your situation, it sounds like the widgets aren't something you want to link to the items returned by the script at all, so the script isn't the place to be managing them Smile There's lots of examples in lots of skins on using a custom window to set a skin string to manage things such as widgets.
That's one thing I thought about myself actually - the ability to use this script for selecting a single custom shortcut as it would a much more efficient way to do to it.

ie Pass a parameter when running the script (eg shortcut1) and let the user choose it's type, name, etc and the script produces the relevant include file.

A lot easier than coding custom shortcuts. Wink

removed151214

There's the Just Select method - though I'm probably misunderstanding what you mean:

PHP Code:
RunScript(script.skinshortcuts,type=shortcuts&amp;custom=[True/False]&amp;skinLabel=[skinLabel]&amp;skinAction=[skinAction]&amp;skinType=[skinType]&amp;skinThumbnail=[skinThumbnail]) 

(where the properties are all optional skin strings to be set.) Doesn't create the includes file, though, it just passes the shortcut off to the skin to manage. (Reading back, I'm guessing I am misunderstanding Smile)
Just a shortcut (or more if needed) that's independent of any other other list so no visible condition needed.

I think that's what bambi73 meant as well.

removed151214

That's what type=manage&amp;group=[mygroupname] does...? The shortcuts will still be grouped together, but can be accessed with <include>skinshortcuts-group-mygroupname</include>, and have no visibility condition based on any other list.
Sorry, need to read the manual again. Confused

removed151214

One of these days I'll spend some time making the doc's actually understandable Wink
My idea was to let user have same configuration possibilities for all custom elements (lists, widgets, maybe backgrounds too) regardless where they are placed in skin. I already thought about workaround how to use shortcuts in my use-case so I only asked for change because it would make my situation much easier Smile.

removed151214

If it was a simple code change, I'd be happy to do it. But it'd require re-writing the widget (and maybe backgrounds too Wink) code, including changing where the code is within the script. Too much work for something which still feels like its better handled skin-side.

You did say previously, though, that you'd looked at the code. If you want to try and re-write the widget code and send a pull request, it'd be very welcome (and I can provide pointers as to what changes would be needed.) Smile