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.
Made pull request into BigNoid repo.
It adds support for custom shortcut properties patterns (excerpt from Advanced Usage.txt):

Code:
14. Custom shortcut properties patterns

You can define custom properties patterns in the overrides.xml, its variables are then filled with real values during include XML building. As opposed to regular custom properties, patterns can't be modified from skin so they aren't saved as custom configuration (they are only defined in the overrides.xml).

Pattern variables has format: ::<element name|property name>::
For example for include XML item:

    <item id="1">
        <label>$LOCALIZE[10002]</label>
        <icon>DefaultPicture.png</icon>
        <property name="labelID">pictures</property>
        <property name="defaultID">pictures</property>
        <onclick>ActivateWindow(Pictures)</onclick>
        ...
    </item>

following variables (case insensitive) can be used: ::LABEL:: ::ICON:: ::LABELID:: ::DEFAULTID:: ::ONCLICK::
Basically all elements and properties existing for item can be used as variables in pattern.

<propertypattern labelID="[LabelID]" group="[GroupName]" property="[PropertyName]">[PropertyPattern]</propertypattern>
    
[LabelID] - [Optional] The labelID of item you are providing a pattern for. If ommited, pattern is used for all items in group.
[GroupName] - The group you are providing a pattern for.
[PropertyName] - The string used to identify the property
[PropertyPattern] - The pattern for the property

    <?xml version="1.0" encoding="UTF-8"?>
    <overrides>
           <propertypattern group="mainmenu" property="exampleProperty">$INFO[Window(Home).Property(::DEFAULTID::)]</propertypattern>
           <propertypattern labelID="pictures" group="mainmenu" property="exampleProperty">$INFO[Window(Home).Property(DefaultID-::DEFAULTID::)]</propertypattern>
    </overrides>

As result all items in mainmenu will have property "exampleProperty" filled with first pattern, only pictures will be filled with second pattern.

    <item id="1">
        <label>$LOCALIZE[10002]</label>
        <icon>DefaultPicture.png</icon>
        <property name="labelID">pictures</property>
        <property name="defaultID">pictures</property>
        <property name="exampleProperty">$INFO[Window(Home).Property(DefaultID-pictures)]</property>
        ...
    </item>
    <item id="2">
        <label>$LOCALIZE[10005]</label>
        <icon>DefaultMusicAlbums.png</icon>
        <property name="labelID">music</property>
        <property name="defaultID">music</property>
        <property name="exampleProperty">$INFO[Window(Home).Property(music)]</property>
        ...
    </item>
    ...

Personally I use it for building properties for Python script, hopefully it will be useful for others too.
Feature request:
We already have "<backgroundBrowse default="protocol://path/to/folder">True</backgroundBrowse>" to set the default path for backgrounds.
The only thing what is missing is the same for the "Set Thumbnail" button, like:
PHP Code:
<thumbnailBrowse default="special://skin/extras/icons/">True</thumbnailBrowse
(2015-05-27, 14:49)sualfred Wrote: [ -> ]Feature request:
We already have "<backgroundBrowse default="protocol://path/to/folder">True</backgroundBrowse>" to set the default path for backgrounds.
The only thing what is missing is the same for the "Set Thumbnail" button, like:
PHP Code:
<thumbnailBrowse default="special://skin/extras/icons/">True</thumbnailBrowse
Maybe I'll have to look at it over weekend, but what behavior do you expect from 306 when

PHP Code:
<thumbnailBrowse>False</thumbnailBrowse

Behavior for 311 is clear because it's similar to backgrounds, but for 306 this "turn on/off" possibility make no sense.
Btw 311 uses backgroundBrowse default as starting point, isn't is enough?
I only need a setting to define a default thumbnail directory, which leads to skin://extras/icons for example. I do not want to refuse the user to browse other directories.
The reason is, that I provide a set of pre-collected icons for a icon main menu and there are enough Kodi users,who just don't know where to find them.
I understand that, only tried to point out that using different element name would be better. Something like

Code:
<thumbnailBrowseDefault>special://skin/extras/icons/</thumbnailBrowseDefault>

This can be used for both controls (306, 311). Previous thumbnailBrowse version was inconsistent between them.
I'll look at it over weekend.
Awesome, thanks Smile
(2015-05-29, 00:00)bambi73 Wrote: [ -> ]https://github.com/BigNoid/script.skinshortcuts/pull/12

Works great!
Thanks Smile
(2015-05-29, 00:00)bambi73 Wrote: [ -> ]https://github.com/BigNoid/script.skinshortcuts/pull/12

Image

Angry

i am a nuub
Yes, in many ways.

Some more information maybe?
Request time.

Can we get the absolute path without Activate.Window(...) added as a property for use in a list's content?

Thanks.
Hi, first thank you for this script... it looks like it greately simplifies things.

Feature request:
Can you add handler to media items for info (key "i").

Explanation:
When you have a widget with for example last added movies, then navigating those movies I am missing the possibilitie to get info of that movie when pressing the "i" button.

Thank you Smile
(2015-06-23, 08:58)Crssi Wrote: [ -> ]Hi, first thank you for this script... it looks like it greately simplifies things.

Feature request:
Can you add handler to media items for info (key "i").

Explanation:
When you have a widget with for example last added movies, then navigating those movies I am missing the possibilitie to get info of that movie when pressing the "i" button.

Thank you Smile
That's not possible as Kodi handles the info key.
(2015-06-23, 09:12)Hitcher Wrote: [ -> ]
(2015-06-23, 08:58)Crssi Wrote: [ -> ]Hi, first thank you for this script... it looks like it greately simplifies things.

Feature request:
Can you add handler to media items for info (key "i").

Explanation:
When you have a widget with for example last added movies, then navigating those movies I am missing the possibilitie to get info of that movie when pressing the "i" button.

Thank you Smile
That's not possible as Kodi handles the info key.

Thanks for fast reply.
So, this is not possible to achive with any workaround?
Since if you press OK, then it starts to play that selected media... I am not fluent here, but cannot the info key be handled simmilar way?
(2015-06-23, 09:15)Crssi Wrote: [ -> ]Thanks for fast reply.
So, this is not possible to achive with any workaround?
Since if you press OK, then it starts to play that selected media... I am not fluent here, but cannot the info key be handled simmilar way?
In the Kodi video settings you can set the default play action to "choose" or "info"...