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.
(2016-04-25, 19:59)BobCratchett Wrote: [ -> ]
(2016-04-25, 17:00)willcmuk Wrote: [ -> ]The bit that appears to be causing issues is this part in the template file

<property name="content" tag="property" attribute="name|widgetPath" />

if I hard code the attribute to a plugin url it is displayed which suggests there is an issue with the dynamic attribute and yet I've confirmed that in skin-shortcuts-includes.xml there is a property under the submenu id called widgetPath which is populated with the correct plugin url.

Has anyone got any ideas?

Also please can someone confirm this is the version I should be using from Github which Bob mentioned in an earlier post?
https://github.com/BigNoid/script.skinsh...master.zip

And what appears in the built template in the script-skinshortcuts-includes.xml file? (And yes, that's the zip for the latest version)

Hi Bob, I got the sub widgets to appear but had to "hard-code" the template in the includes_home.xml file so that I could use a variable in the content markup rather than use the template.xml file and $SKINSHORTCUTS[content] - for some reason the output in script.skinshortcuts-includes.xml was not working, to my eyes at least it looks correct...

http://pastebin.com/g2qpJNDc
(2016-05-02, 06:17)willcmuk Wrote: [ -> ]
(2016-04-25, 19:59)BobCratchett Wrote: [ -> ]And what appears in the built template in the script-skinshortcuts-includes.xml file? (And yes, that's the zip for the latest version)

Hi Bob, I got the sub widgets to appear but had to "hard-code" the template in the includes_home.xml file so that I could use a variable in the content markup rather than use the template.xml file and $SKINSHORTCUTS[content] - for some reason the output in script.skinshortcuts-includes.xml was not working, to my eyes at least it looks correct...

http://pastebin.com/g2qpJNDc

Sounds like you still need to check what appears in the built template.

Within the template.xml file - I presume (I haven't looked at any code you may have linked to, though I have looked at your most recent link - which only confirms that a menu item has a widgetPath property) - you have a template, presumably of the correct type. Within that template you are pulling out the widgetPath property as you've said:-

Code:
<property name="content" tag="property" attribute="name|widgetPath" />

and then you'll be using it somewhere:-

Code:
<content>$SKINSHORTCUTS[content]</content>

The first check you need to do to debug this issue is checking what the script is doing with those two lines. - that means finding the relevant code in the built script-skinshortcuts-includes.xml file and looking to see what the <content>$SKINSHORTCUTS[content]</content> line looks like once the template has been processed.

(Can't find the <content> line? Add...

Code:
<description>TEST</description>

... right above it in the template and search for that once it's built)

The second check you'll need to do will vary depending on what it does look like. One of three things is likely...

(1) Your template isn't being built at all - check you're using the correct type of template, check there are items that would trigger that template (including checking the conditions for your template), enable the scripts own debug logging option and check the Kodi log

(2) It still says $SKINSHORTCUTS[content] - normally caused by a typo in the template, but also enable the scripts own debug logging option and check the Kodi log

(3) You see exactly the value you expect to see instead of $SKINSHORTCUTS[content] - the script is working right, but you have a problem on the skinning side.
(2016-05-02, 09:10)BobCratchett Wrote: [ -> ]
(2016-05-02, 06:17)willcmuk Wrote: [ -> ]
(2016-04-25, 19:59)BobCratchett Wrote: [ -> ]And what appears in the built template in the script-skinshortcuts-includes.xml file? (And yes, that's the zip for the latest version)

Hi Bob, I got the sub widgets to appear but had to "hard-code" the template in the includes_home.xml file so that I could use a variable in the content markup rather than use the template.xml file and $SKINSHORTCUTS[content] - for some reason the output in script.skinshortcuts-includes.xml was not working, to my eyes at least it looks correct...

http://pastebin.com/g2qpJNDc

Sounds like you still need to check what appears in the built template.

Within the template.xml file - I presume (I haven't looked at any code you may have linked to, though I have looked at your most recent link - which only confirms that a menu item has a widgetPath property) - you have a template, presumably of the correct type. Within that template you are pulling out the widgetPath property as you've said:-

Code:
<property name="content" tag="property" attribute="name|widgetPath" />

and then you'll be using it somewhere:-

Code:
<content>$SKINSHORTCUTS[content]</content>

The first check you need to do to debug this issue is checking what the script is doing with those two lines. - that means finding the relevant code in the built script-skinshortcuts-includes.xml file and looking to see what the <content>$SKINSHORTCUTS[content]</content> line looks like once the template has been processed.

(Can't find the <content> line? Add...

Code:
<description>TEST</description>

... right above it in the template and search for that once it's built)

The second check you'll need to do will vary depending on what it does look like. One of three things is likely...

(1) Your template isn't being built at all - check you're using the correct type of template, check there are items that would trigger that template (including checking the conditions for your template), enable the scripts own debug logging option and check the Kodi log

(2) It still says $SKINSHORTCUTS[content] - normally caused by a typo in the template, but also enable the scripts own debug logging option and check the Kodi log

(3) You see exactly the value you expect to see instead of $SKINSHORTCUTS[content] - the script is working right, but you have a problem on the skinning side.

Hi Bob,

Yes template.xml is setup correctly as far as I'm aware, here's the code for the sub menu widget - http://pastebin.com/j2wrR0Jr
There are two content properties (I copied it from the acrtic.zephyr main widget code but made some changes including changing the content variable to reference the sub menu instead of the main one) I presume the second content property is a fallback? In either case both don't seem to be working.

The <content> is outputting in script.shortcuts.include like so:

Code:
<content limit="50" target="" />

which doesn't seem right to me - there's nothing there, in the main menu widget the same field is outputting like so:

Code:
<content limit="50" target="video">plugin://script.extendedinfo?info=trendingmovies</content>

Which is strange as my sub-menu widget code in template.xml is more or less a duplicate of the main menu widget (code for main menu widget - http://pastebin.com/cHPCZgHe ) - am I missing something?
(2016-05-02, 22:38)willcmuk Wrote: [ -> ]Hi Bob,

Yes template.xml is setup correctly as far as I'm aware, here's the code for the sub menu widget - http://pastebin.com/j2wrR0Jr
There are two content properties (I copied it from the acrtic.zephyr main widget code but made some changes including changing the content variable to reference the sub menu instead of the main one) I presume the second content property is a fallback? In either case both don't seem to be working.

The <content> is outputting in script.shortcuts.include like so:

Code:
<content limit="50" target="" />

which doesn't seem right to me - there's nothing there, in the main menu widget the same field is outputting like so:

Code:
<content limit="50" target="video">plugin://script.extendedinfo?info=trendingmovies</content>

Which is strange as my sub-menu widget code in template.xml is more or less a duplicate of the main menu widget (code for main menu widget - http://pastebin.com/cHPCZgHe ) - am I missing something?

OK, there's a (4) I overlooked Wink

(4) The template is built, but the property is empty (an empty value is written to the template instead of the value from the menu item). This means the menu item that the template is being built from doesn't have any value in the property specified or the template doesn't support properties (mainmenu and submenu templates). The most common cause for this is that the wrong type of template is being used and so the template isn't being built from the properties you think it is - and indeed you're using a submenu template (which builds a template which displays each individual submenu of each main menu item), rather than a submenuOther template, which builds a template based on the properties of each individual submenu item.

Review the docs for the different types of template, but it should be as simple as changing <submenu /> to <submenuOther />.
Hi Bob,

A quick question;

What the difference in functionality of "307 Change shortcut action" and "401 Select shortcut via select dialog"?
Both controls seem to do the same thing apart from 307 which allows you to enter a custom action.

Cheers
(2016-05-09, 00:39)Mr. V Wrote: [ -> ]What the difference in functionality of "307 Change shortcut action" and "401 Select shortcut via select dialog"?
Both controls seem to do the same thing apart from 307 which allows you to enter a custom action.

307 only changes the action. 401 sets the action, the label and the icon of the menu item.
Thanks. Not sure how I missed that.
Could someone please help me with the overrides.

Im running Kodi 16.1 on a Windows PC

Skin = Aeon Madnox

I have tried creating the overrides.xml file and in it I am doing the following.

<?xml version="1.0" encoding="UTF-8"?>
<overrides>
<override action="Minimize">
<action>CleanLibrary(video)</action>
<action>UpdateLibrary(video)</action>
</override>
</overrides>

Just to make sure it is working.

I have linked a sub menu item to the command "Minimize" but when pressed it does minimize Kodi

Any help is appreciated!

If it helps I have placed the overrides.xml in the /userdata directory and even created a /profile directory to try is as the help page says

"To do this you need to create an overrides.xml file in your profile directory."
I'm not in a position to test your specific overrides.xml file, however I know the basic functionality of overriding an action from an overrides.xml in special://profile works as I use the following in mine:-

Code:
<?xml version="1.0" encoding="UTF-8"?>
<overrides>
    <override action="SearchMovies">
        <action>ActivateWindow(Videos,MovieTitles,Return)</action>
        <action>SendClick(8)</action>
    </override>
</overrides>

Most likely causes for it not working:-
  • overrides.xml is in the wrong location - it should be in special://profile (which is what the docs say - not just 'in your profile directory Wink) - for the master profile, this would be userdata (wiki), for other profiles, it's where their userdata folder is - see special protocol (wiki)
  • The script can't process the file (this should be logged when both Kodi's and the scripts own logging are enabled)
  • The action of the menu item doesn't exactly match the action of the override (it's case sensitive, for example)
Is it possible to add an icon to a node like a shortcut in overrides.xml ?
Not quite sure what you mean. Can you give more details of what you want to achieve?
On some items I have not icon because they are node and there is no default icons for this

Image

Code:
<node label="32007">
            <node label="32009">
                <shortcut label="10001" type="32021" icon="DefaultAddonProgram.png">ActivateWindow(Programs,Addons,return)</shortcut>
                <shortcut label="20244" type="32021" icon="DefaultAddonProgram.png" condition="System.Platform.Android">ActivateWindow(Programs,androidapp://sources/apps,return)</shortcut>
                <content>addon-program</content>
            </node>
            <node label="32010">
                <shortcut label="1037" type="32014" icon="DefaultAddonVideo.png">ActivateWindow(Videos,Addons,return)</shortcut>
                <content>addon-video</content>
            </node>
            <node label="32011">
                <shortcut label="1038" type="32019" icon="DefaultAddonMusic.png">ActivateWindow(MusicLibrary,Addons,return)</shortcut>
                <content>addon-audio</content>
            </node>
            <node label="32012">
                <shortcut label="1039" type="32020" icon="DefaultAddonPicture.png">ActivateWindow(Pictures,Addons,return)</shortcut>
                <content>addon-image</content>
            </node>
        </node>
        <node label="32006">
            <content>favourite</content>
        </node>
        <node label="10004">
            <content>settings</content>
        </node>

For shortcuts is not a problem, but no icons for node.
Ah, got you.

All nodes should use the icon 'DefaultFolder.png' - if you're happy to have just one icon for all nodes, then you can either include that image or override it. If you're wanting to set individual icons for individual nodes, it shouldn't be too difficult to add and I'll happily add it to my to-do list for v1.0.9.

(The dev docs on master are incorrectly formatted for overriding an icon, so I've linked to a fork where I've quickly corrected them - note that there are features in development on the fork, so there will be some docs that don't relate to the current git or upcoming repo version)
I misspoke... Yes node use 'DefaultFolder.png' but I mean icons for content in node like favorites, system info, eventlog etc...

Like this node :

Code:
<node label="32054">
<content>commands</content>
</node>

There is no possibitilty to apply icon for each item (reboot, shutdown, etc...) for commands
Ah. The script doesn't apply any specific icon to those so they fall back to 'DefaultShortcut.png'. That can be overridden to give a single icon for all, but I don't think that's what you're after. Two possibilities occur to me:

(1) Either default icons can be added to these - any suggestions are welcome (As are PR's with the suggested icons Wink - the code for the 'common' group, for example, is here - to add a default icon in the code, add "icon": "NameOfIcon.png" between the {}'s)

(2) Extend the icon overrides. Overriding based on action is a possibility, though that may not be easy to implement in a good way quickly (as normally with icon overrides, the original icon is kept and only overriden when actually displayed/menu built - as there is no original icon, this override would need to behave quite differently)

Though any other suggestions are welcome Smile