Release script.skinshortcuts - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12) +---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300) +---- Thread: Release script.skinshortcuts (/showthread.php?tid=178294) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
RE: script.skinshortcuts - removed151214 - 2013-12-05 (2013-12-05, 00:09)BigNoid Wrote: Works a treat, thx. Been thinking about this example some more, and realised that this wouldn't work if the user switched to another skin using skinshortcuts as it uses a string specific to the current skin - the shortcut would still load, but it would be labelled whatever that skin has assigned to the string 31951 (or possibly, wouldn't have a label at all). A quick fix would be to use one of the strings supplied by XBMC (and therefore available to all skins) - if the label is meant to be 'Pictures', for example, then (and I haven't tested this) it could use xbmc.getLocalizedString(1). However, if it's providing something which only works with the current skin, I need to think of a way for skins to provide shortcuts which won't carry over to other skins. RE: script.skinshortcuts - pecinko - 2013-12-05 I was considering main menu items - videos, movies, tv shows... Of course problem is how to manage and mix built-in items with a custom ones as BigNoid said. Submenu items are story for itself as you can have DB filters (genres, years) along with built-in functions like settings or update library there. @devs It would be best if your initiative would get support from the team so that links user have made are available across all skins and probably kept in a manually editable format such as XML http://wiki.xbmc.org/index.php?title=Custom_video_nodes Anyhow I really appreciate the work you're putting in this. RE: script.skinshortcuts - removed151214 - 2013-12-06 BigNoid has just added the ability for users to change the label, icon, thumbnail and action - so users can now define completely custom shortcuts. Skinners now need to provide four additional buttons: 305 - change label 306 - change icon 307 - change thumbnail 308 - change action Actions can be pretty much any XBMC function. So to go to pictures Code: ActivateWindow(pictures) Code: UpdateLibrary(video) RE: script.skinshortcuts - BigNoid - 2013-12-06 Just to show the possibilities for a fully customizable home screen with unlimited custom items, each with individual custom submenus by making use of this script: - add a button in script-skinshortcuts.xml Code: <control type="button"> - add the variable: Code: <variable name="SetSubMenuVar"> Code: <content>$VAR[SubMenuVar]</content> Code: <variable name="SubMenuVar"> Where Container(9000) is my Home menu list id and the preset items are default submenus provided by the skin. All this can be re-ordered and such while the submenus stay with the appointed home menu item. Now, why anybody would want a Home menu with more then 10 items is beyond me, but fact is there's a demand for it and now it can be done with just a few lines of code RE: script.skinshortcuts - pecinko - 2013-12-06 Very nice guys. Thanks! RE: script.skinshortcuts - da-anda - 2013-12-06 btw - there where plans to have a unified user customizable home menu accross skins using this new feature (if skin decides to support it), but for v14 as time was running out for Gotham. If this script is now jumping in to achieve this, that's fine as well I think RE: script.skinshortcuts - Martijn - 2013-12-06 I would ask if skins could try to ALL use the same menus (as much as possible) so if users switch skins they keep the same menus RE: script.skinshortcuts - BigNoid - 2013-12-06 Thats possible. Every skin that uses this script should run the main menu with this code: Code: plugin://script.skinshortcuts?type=list&group=mainmenu For custom submenus, just set and load the group with the label of the custom menu: Code: RunScript(script.skinshortcuts,type=manage&group=$INFO[Container(211).ListItem.Label]) Code: <content>plugin://script.skinshortcuts?type=list&group=$INFO[Container(9000).ListItem.Label]</content> RE: script.skinshortcuts - removed151214 - 2013-12-06 If we're talking about using this script to generate the main menu items, as well as the shortcuts for those items then it's doable but there's a few problems will need to be overcome first. Firstly, it'd probably need another group of shortcuts for the standard main menu items (videos, movies, weather, etc) along with a new set of defaults. That's easy enough, though I'd prefer to wait until I've improved the localization support (my project for the weekend) before that gets added. More difficult (actually probably easy enough, I just don't know Python well enough yet!) the script would have to check whether, for example, the user has PVR support enabled, and only show a PVR main menu item if it is. This also has the potential to lead to some very messy code. Finally is the speed at which the list can be populated - there's already a pause before submenu shortcuts are displayed. Now I don't think that's a particular issue for shortcuts - people are likely willing to wait a second for them to appear. However, the same pause before the main menu items appear could be problematic. RE: script.skinshortcuts - Mudislander - 2013-12-06 Been playing with Home menus today and the delay doesn't seem to bad, but as you say there needs to be more support for xbmc commandes eg "settings" and other plugins like running Cinema Experience from the main menu. Also have a problem with the "Custom Action" as in some cases the input needed for the command is too long. I think the ability to reset the menu back to the skins preferred defaults when required is also needed. RE: script.skinshortcuts - removed151214 - 2013-12-06 Adding support for things like cinema experience is where things could get really messy - having to check if the plugin is installed and the user has it enabled (a skin setting which can change between skins.) Once I've sorted out the localization stuff I'll have a think to see if there's an easy way to do this. (It may be possible to allow the skin to override certain actions - so if the action is to go to the movie library, the skin can tell the script to run cinema experience instead.) Not sure what can be done about the input being too short for custom actions. It's using the standard XBMC keyboard - if that has a limit, the the input has a limit. Once the localization stuff is sorted I'm going to update how the script manages defaults when the skin doesn't provide any. After that, I'll add a reset button. RE: script.skinshortcuts - MassIV - 2013-12-06 I currently use includes to avoid loading the bulk of the 120 items in my main menu list. I load perhaps 30 of them per window, 20 of which sub-menu items (items that are in the same list, recognized by a property). The main menu also serves as the (hidden) left sideblade from confluence and is available everywhere. Even if support for properties was added, that would be way too many items to load and stringcompare. Or am i missing something? RE: script.skinshortcuts - removed151214 - 2013-12-07 (2013-12-06, 22:55)MassIV Wrote: I currently use includes to avoid loading the bulk of the 120 items in my main menu list. I load perhaps 30 of them per window, 20 of which sub-menu items (items that are in the same list, recognized by a property). The main menu also serves as the (hidden) left sideblade from confluence and is available everywhere. Even if support for properties was added, that would be way too many items to load and stringcompare. Or am i missing something? If I'm understanding you right, your skin shows main menu and submenu items in a single list - that's not something that's going to be supported by this script. Limitations of the new Gotham way of filling a list mean it will require each [groupname] to use a separate list. RE: script.skinshortcuts - removed151214 - 2013-12-07 I've pushed an update to git with improved localization support and, because there seems to be some interest in it, some updates for using the script to provide the main menu, as opposed to just the submenus (though it'll still take a skilled skinner to pull it together!) For localization, the script now stores the string id rather than the localized string. This means that if the user switches languages, any shortcuts with localized labels will switch language too. If you want to use a localized string in a skin defaults file then use the format "::LOCAL::id" - so for 'Pictures' you could use "::LOCAL::10002", for example. Now, for using the script to manage the whole menu... Firstly, there's a new action for your skinsettings.xml file - the script can fill a list within that page with links to choose main menu items([groupname] - mainmenu), and individual links to set shortcuts for each main menu item. Just use Code: <content>plugin://script.skinshortcuts?type=settings&property=$INFO[Window(10000).Property("skinshortcuts")]</content> Next, I've added a new group of shortcuts I've termed 'Common' for things users are likely to want on the main menu. Finally, because menu items are localized whenever possible, it doesn't seem wise to rely on $INFO[lisitem.label] for choosing the [groupname] of shortcuts as has been previously suggested, as it will change between languages, so I've added a new property to the listitems - labelID. For common main menu items, this will contain a non-localized string (videos, movies, tvshows, livetv, music, musicvideos, pictures, weather, programs, settings). For other localized strings, it will return the string id (e.g. for 'Profiles' the $INFO[listitem.property(labelID)] will be "13200"). For non-localized string, it will return the string minus any spaces. You can check this property to decide whether to display, for example, a list of recently added movies, and you should also use this labelID for the naming of any default files the skin provides. Finally, the labelID should be used as the [groupname] to list any shortcuts for the menu item. Edit: I've pushed another update allowing skinners to override actions by providing an overrides.xml file - it could be used to override going to Movie Titles and run Cinema Experience instead, for example. See the readme file included with the script for full details. Hope all of that's clear. Let me know how you get on! RE: script.skinshortcuts - removed151214 - 2014-01-06 Quick note to say an initial release is now available on the repository, and hopefully on Transifex soon. Simple details of how to use are in the first post, with full details (including details of using the script to provide both main menu and sub-menus) in the scripts included readme.txt. Updates upcoming include speed improvements (I got a Raspberry Pi from Santa and will make it work as well as possible on this device as I can) as well as - when providing the whole home page menu - the option to list all menu items with custom links (to provide, for example, for example, custom widgets, for main menu items.) I'd love to hear how it works for you, and any missing features that I really should add! |