• 1
  • 2
  • 3(current)
  • 4
  • 5
  • 8
HOW-TO write GUI settings for XBMC python plugins and scripts (addons)
#31
@digitaldesaster
The first post says it pretty clearly, this is for plugins, not scripts.
Reply
#32
In Germany whe say: "Wer lesen kann ist klar im Vorteil". sorry..

cya
dd
Reply
#33
Hi, I'm trying to use the "enum" plugin setting; however, it reads the place in "enum" line, for instance:

The settings.xml:
Code:
<settings>
    <setting id="username" type="text" label="Username:" default="enter user"/>
    <setting id="password" type="text" label="Password:" default="enter pass"/>
    <setting id="archiveMonth" type="enum" label="Month:" values="01|02|03|04|05|06|07|08|09|10|11|12" default="01"/>
    <setting id="archiveDay" type="enum" label="Day:" values="01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31" default="01"/>
    <setting id="archiveYear" type="enum" label="Year:" values="2009|2010" default="2009"/>
</settings>

The python code:
Code:
archiveMonth = xbmcplugin.getSetting('archiveMonth')
archiveDay = xbmcplugin.getSetting('archiveDay')
archiveYear = xbmcplugin.getSetting('archiveYear')
archiveDate = '/' + str(archiveMonth) + '-' + str(archiveDay) + '-' + str(archiveYear) + '/'
str(archiveDate)

If 11-13-2009 is selected, the returned value *should* be /11-13-2009/; instead, it returns /10-12-0/ or very similar. **The number in line, beginning at zero. Is there a way to get the actual value from the "enum" setting, instead of its ordinal value?
Reply
#34
I believe that's what the enum does - it returns the index rather than the value. If you want the value you should know it anyway, right (after all, you supplied the values). For consecutive numbers with a min and a max you can probably do it without the enum at all, right? The enum stuff is designed for non-consecutive numbers.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#35
Well, I am trying to create a sort of calendar like select. (Should be obvious by the example. Laugh) Although, I'm not sure how I could accomplish this without the "enum" option. Is there a better way?

This is a feature request for one of my plugins. The users mentioned entering dates was a long process, this will hopefully speed it up! Cool

## Figured this one out...

Just checked the length of the "enum" index and returned a zero in front of single digits or nothing in front of double digits.
Checked the year against a string.
Reply
#36
<setting id="archiveDay" type="labelenum"
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#37
Would it be possible to create a slider option? With min, max and step size?
Reply
#38
possible, yes, available, no.
Reply
#39
i already submitted a ticket for this along time ago. among others.

spiff or anybody check out that settings cleanup ticket. a comment would have been nice.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#40
Hi, just saw the possibility for the settings.xml and it works like a charm. Only thing that I would like/need for my script, is the possibility to select a hard or cd/dvd drive.
I mainly need the letter(on Windows) of the dvd drive from which I get the state with "getDVDState". I didn't find anything about this so I thought I could use a settings entry but I found no chance to select the dvd drive with the folder or file setting types.

I hope someone can help me,
Greetings,
D0nR0sa

Edit: Sorry, problem was an error in xbmc that prevented me from accessing the dvd drive
Reply
#41
I can't use the settings type "Files". If I use it like this:

Quote: <setting id="Files01" type="files" label="30012" default="" />

It won't show up in the settings menu...what am I doing wrong?
Reply
#42
type="file"
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#43
Works, thanks alot!

Another issue: When I use fileenum, I cannot find .m3u playlist files. Txt files work well.
Reply
#44
Hello !
three questions :

1 - Any new infos where we can get help on all available settings, how they works, what are the options and their possible values... ?


2 - It looks like bool setting can't get the option 'visible' ... Why ?

3 - I used the setting type 'action' but the default value, which is the command line (RunPlugin(....) ) is showing next to the label. Any way to hide it ?

(I'm using XBMC 9.11 r26017)
Reply
#45
1. in guidialogaddonsettings.cpp (i think)
2. it should, maybe a bug
3. put the action in action="RunScript()" leave default blank. default=""
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 8

Logout Mark Read Team Forum Stats Members Help
HOW-TO write GUI settings for XBMC python plugins and scripts (addons)1