HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) (/showthread.php?tid=29577) |
- teshephe - 2010-09-22 ppic Wrote:why do you need it ? Ahhh, i knew you would ask me that. Well, just so happens that I am working on the little plugin called "MultiroomAudio" and part of what I am doing is utilizing the built-in bcast functionality to signal "What playing" as it happens realtime so I have a function that turns on the bcast and then listens and parses out the messages. The other part is mainly for the windows based xbmc's and in the addon settings I have just a text box to put in a custom "Directshow" device... I would really like this to be a drop down (less prone to user entry error) BTW... noticed that you were wanting a true streaming backend to xbmc... well, while not mature yet... I took on the challenge. - ppic - 2010-09-22 yes, but what di you need to get the port (we should continue this elsewhere) - teshephe - 2010-09-22 ppic Wrote:yes, but what di you need to get the port (we should continue this elsewhere) I pm'd you... let's talk - taxigps - 2010-10-13 any way to use settings like this: Code: <setting id="sub_folder" type="text" visible= "eq(-1,true)" enable="eq(-1,true)" label="30112" default="30113"/> - Walter Sobchak - 2011-09-14 Is there a way to run my script (with a param) when its settings are updated? - roth2006 - 2012-02-04 Did you try it with the linuxport? RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - _BJ1 - 2012-03-28 I have a problem with internationalization/localization. I need following: i.e. english: Scan EPG-Data at xx:xx o'clock german: Scanne EPG-Daten um xx:xx Uhr I know, how to script in settings.xml the first label item and the options (value=xx:xx) but don't know how to implement "o'clock/Uhr" afterwards? RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - _BJ1 - 2012-03-29 Nobody a clue? _BJ1 RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - sphere - 2012-03-29 This is not possible. But you have two workarounds available: 1. setting: <setting id="hour" type="enum" label="30000" default="3" values="0|1|2|3|...|23"/> string: <string id="30000">Scan EPG at X o'clock</string> 2. setting: <setting id="hour" type="enum" label="30000" default="3" lvalues="31001|31002|...|31023"/> strings: <string id="30000">Scan EPG at</string> <string id="31000">00:00 o'clock</string> <string id="31001">01:00 o'clock</string> <string id="31002">02:00 o'clock</string> ... <string id="31023">23:00 o'clock</string> I recommend workaround #1 RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - _BJ1 - 2012-03-30 Thank you very much! Workaround #2 works like a charme for me. _BJ1 RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - tonylynn03 - 2014-12-05 Hello all, I am trying to set a number of pages in an add-on, but have the following issues and need help. In settings.xml I have <setting id="page" type="enum" label="Choose number of pages" values="10|50|100" default="50" /> In defautlt.py I have pages = mysettings.getSetting('page') and use for i in range(pages): I got this error shown in log Error Type: <type 'exceptions.TypeError'> Error Contents: range() integer end argument expected, got str Another issue is when I go into add-on settings and click on Defaults tab, the number does not go to 50 and does not change at all. Thanks in advance. RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - _BJ1 - 2014-12-05 Just use Code: for i in range(int(pages)): RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - Roman_V_M - 2014-12-05 (2014-12-05, 10:34)_BJ1 Wrote: Just use Not that simple. An "enum" control holds not an actual value, but its index in the "values" array as a string, starting from "0". Then you need to convert this index into an actual value, e.g. using a dict literal. See an example here: https://github.com/romanvm/ex.ua.alternative/blob/master/plugin.video.ex.ua.alternative/default.py#L24 RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - _BJ1 - 2014-12-05 What about type="labelenum" in settings.xml? RE: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - tonylynn03 - 2014-12-05 Solved. Thank you very much _BJ1 and Roman_V_M. It works like a charm with the following settings: In settings.xml: Code: <setting id="page" type="labelenum" label="Choose number of pages" values="10|50|100" default="50" /> In default.py : Code: pages = int(mysettings.getSetting('page')) |