removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Nice idea, but can I suggest an alternative implementation - something along the lines of:
Code:
<onclick python="xbmcgui.Dialog().select">
<heading>This is a custom dialog</heading>
<item value="some_value">Label</item>
<item value="some_value_2">Labe_2</item>
...
</onclick>
Which would match more directly to the actual python methods, and - for me - is more readable
(though the Python interface doesn't directly provide a multiselect dialog, does it?)
(2014-10-30, 00:27)phil65 Wrote: Some idea to simplify skinning a bit:
Since Python is more powerful than the skinning xml engine in most aspects I think it would be useful to expose some Python functions to skinners.
I coded a small example into script.extendedinfo (commit link):
This code:
PHP Code:
<onclick>SetProperty(Dialog.Header,This is a custom dialog)</onclick>
<onclick>SetProperty(Dialog.NumItems,4)</onclick>
<onclick>SetProperty(Dialog.Target,Name_of_Skin_String)</onclick>
<onclick>SetProperty(Dialog.1.Label,Test)</onclick>
<onclick>SetProperty(Dialog.1.Value,some_value)</onclick>
<onclick>SetProperty(Dialog.2.Label,Test 2)</onclick>
<onclick>SetProperty(Dialog.2.Value,some_value2)</onclick>
<onclick>SetProperty(Dialog.3.Label,Test 3)</onclick>
<onclick>SetProperty(Dialog.3.Value,some_value3)</onclick>
<onclick>SetProperty(Dialog.4.Label,Test 4)</onclick>
<onclick>SetProperty(Dialog.4.Value,some_value4)</onclick>
<onclick>RunScript(script.extendedinfo,info=dialog)</onclick>
would create a dialog like this:
When the user clicks on a listitem then the string with name "Name_of_Skin_String" will be set to the value of the selected listitem.
This could also be extended to make use of thumbs, multiselect etc if needed.
This way skinners can make use of DialogSelect which can be very useful on some occasions for settings with more than 2 states. At the moment there is no good way for skinners to implement those type of buttons since also spincontrol cannot be used.
The same could be done for DialogOK and DialogYesNo for example.
I could also change it to a way that it uses script parameters instead of setting window properties, but that would get a bit messy probably when there are lot of options.
I don´t really need this myself since the skin I am workin on atm already has deep python integration so I don´t need a separate script for that, if it helps you guys to create more nice skins I´d still put some minutes in to get that stuff workin.
Opinions?
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
My bad, didn't look at your link so didn't realise you were using Python to extend the skinning engine to use Python
. I'll leave the suggestion for when (hopefully inevitably) this gets implemented in core.
Edit: Your edit is more readable to me, but only lets the skinner set the label and not the value (presumably purely because it's a quick idea, not something fully realised). Still, that's on the way to a better implementation for me
Posts: 6,684
Joined: Mar 2009
Reputation:
147
phil65
Retired Team-Kodi Member
Posts: 6,684
2014-10-30, 00:53
(This post was last modified: 2014-10-30, 00:53 by phil65.)
no, both possible, I just have to use different separators. ( | vs. || in the example, there are probably better ones)
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
I'm going to blame sleep deprivation for not noticing that :p For me, that's a great implementation - providing the Python function in a way comparable to the Python method. However I, like you (just a hell of a lot less successfully
), merge Python and skins in my own endeavours, so this is probably a good time for more 'pure' skinners to weigh in
Posts: 17,415
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,415
Count me in as very interested. I know very little to no Python and am always grateful for the scripts you guys make to help us improve our skins.
Posts: 6,684
Joined: Mar 2009
Reputation:
147
phil65
Retired Team-Kodi Member
Posts: 6,684
Any opinion which way to set the dialog up is preferred? Setting properties or using script parameters?
Posts: 995
Joined: Apr 2009
Reputation:
60
nessus
Skilled Skinner
Posts: 995
Count me in too. I think script parameters are the most easy way to go.
IMO you should separate this from the extendedinfo script to a standalone script and add more skinning stuff like this. Spin controls is another one. If the available selected items are 3 - 4, spin controls (maybe with only one direction ?) are better than to open another window just to select one of the only three values available.
Cheers
Nessus
Posts: 1,126
Joined: Mar 2012
Reputation:
37
MassIV
Skilled Skinner
Posts: 1,126
I think the SetProperty method is better. It is in line with other methods and the xml should be clean as possible.
It should stay as straight forward as possible for people who want to make some changes to their skin.
I'd love to see this extended to other dialog types. And as separate script for implementing 'higher' skinning functions.
Like a controlled way of using predefined python functions within the xml.
[RELEASE] Metroid
[RELEASE] IrcChat
Posts: 17,415
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,415
Agreed, it's a lot easier to read.