•  Previous
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7(current)
 
Thread Rating:
  • 1 Vote(s) - 5 Average
HOW-TO write GUI settings for XBMC python plugins and scripts (addons)
#91
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.Wink

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)Confused

BTW... noticed that you were wanting a true streaming backend to xbmc... well, while not mature yet... I took on the challenge. Big GrinShocked
Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
Reply
#92
yes, but what di you need to get the port (we should continue this elsewhere)
Image
Passion-XBMC Repository Download your SVN skins and addons
TvTunes Addon Download Play your theme while browsing library
TVshow Next Aired display next aired infos from tvrage.com
Logo Downloader Script download Logo/clearart/show thumbs/poster/banner
Bande-Annonce Allociné plugin watch trailers in french and vo
SportLive Script Live score match info in XBMC (not compatible dharma)
Reply
#93
ppic Wrote:yes, but what di you need to get the port (we should continue this elsewhere)

I pm'd you... let's talkBig Grin
Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
Reply
#94
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"/>
mean let default value can tranlate to other language
Reply
#95
Is there a way to run my script (with a param) when its settings are updated?
Reply
#96
Did you try it with the linuxport?



Image
Reply
#97
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?
Reply
#98
Nobody a clue? Wink

_BJ1
Reply
#99
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 Big Grin
My GitHub. My Add-ons:
Image
Reply
Thank you very much! Workaround #2 works like a charme for me.

_BJ1
Reply
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.
Reply
Just use

Code:
for i in range(int(pages)):
Reply
(2014-12-05, 10:34)_BJ1 Wrote: Just use

Code:
for i in range(int(pages)):

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.alterna...ult.py#L24
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
What about type="labelenum" in settings.xml?
Reply
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'))
for i in range(pages):
Reply
  •  Previous
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7(current)



HOW-TO write GUI settings for XBMC python plugins and scripts (addons)51