XBMC Community Forum
Settings help - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: Settings help (/showthread.php?tid=76810)



Settings help - kricker - 2010-07-07 21:43

If I have the setting:
Code:
<setting id="refresh_queue" type="enum" label="30019" values="2|5|10|15|30" default="3"/>
In the settings file you get either 0,1,2,3,4. How can these be translated back to the values 2,5,10,15,30 for use in the addon python code? Is there a way to store these values in the setting file as 2,5,10,15,30 instead of 0,1,2,3,4 for easy retrieval?


- giftie - 2010-07-08 02:20

How about using a list in python:

a = [2, 5, 10, 15, 30] <-inside your python program.

then testing from you setting value: a[setting]
to get the setting your wanted setting.


- kricker - 2010-07-08 04:56

Thanks, but I got the answer I was hoping for from Amet. Use labelenum instead of just enum. Then I can store the actual values instead of the iteration of enum.