Add-on settings conversion

From Official Kodi Wiki
Revision as of 08:07, 23 October 2021 by CastagnaIT (talk | contribs)
Jump to navigation Jump to search

1 Setting types

1.1 type="text"

<setting type="text" id="test01" label="32001" default=""/>


<setting type="text" id="test02" label="32002" default="" option="hidden"/>


<setting type="text" id="test03" label="32003" default="" option="urlencoded"/>


1.2 type="ipaddress"

<setting type="ipaddress" id="test04" label="32004"/>


1.3 type="number"

<setting type="number" id="test05" label="32005"/>

1.4 type="date"

<setting type="date" id="test06" label="32006" default="2015-03-12"/>


1.5 type="time"

<setting type="time" id="test07" label="32007" default="13:13"/>


1.6 type="bool"

<setting type="bool" id="test08" label="32008" default="false"/>


1.7 type="select"

<setting type="select" id="test09" label="32009" lvalues="11|12|13|14"/>


<setting type="select" id="test10" label="32010" values="aa|bb|cc|dd"/>

1.8 type="addon"

<setting type="addon" id="test11" label="32011" default="" addontype="xbmc.metadata.scraper.movies"/>


<setting type="addon" id="test12" label="32012" default="" addontype="xbmc.metadata.scraper.movies" multiselect="true"/>


1.9 type="enum"

<setting type="enum" id="test13" label="32013" lvalues="11|12|13|14"/>


<setting type="enum" id="test14" label="32014" values="aa|bb|cc|dd"/>

1.10 type="labelenum"

in case you use lvalues in a labelenum control, the saved value will now be the string id, instead of the localized string. please adapt your python code for this.

<setting type="labelenum" id="test15" label="32015" lvalues="11|12|13|14"/>


<setting type="labelenum" id="test16" label="32016" values="bb|aa|dd|cc" sort="yes"/>

note: for labelenum settings, the label attribute for the options is optional. if you use it, it can either be a hardcoded string (label="foobar") or a localized id (label="32085").

1.11 type="slider"

<setting type="slider" id="test17" label="32017" default="20" range="5,5,100" option="int"/>


<setting type="slider" id="test18" label="32018" default="0.5" range="0.0,0.1,1.0" option="float"/>


<setting type="slider" id="test19" label="32019" default="20" range="0,1,100" option="percent"/>


1.12 type="file"

<setting type="file" id="test20" label="32020" default=""/>


1.13 type="audio"

<setting type="audio" id="test21" label="32021" default=""/>


1.14 type="video"

<setting type="video" id="test22" label="32022" default=""/>


1.15 type="image"

<setting type="image" id="test23" label="32023" default=""/>


1.16 type="executable"

<setting type="executable" id="test24" label="32024" default=""/>


1.17 type="folder"

<setting type="folder" id="test25" label="32025" default=""/>


<setting type="folder" id="test26" label="32026" default="" option="writeable"/>


<setting type="folder" id="test27" label="32027" default="" source="videos"/>


<setting type="folder" id="test28" label="32028" default="" source="music"/>


<setting type="folder" id="test29" label="32029" default="" source="pictures"/>


<setting type="folder" id="test30" label="32030" default="" source="programs"/>


<setting type="folder" id="test31" label="32031" default="" source="files"/>


<setting type="folder" id="test32" label="32032" default="" source="local"/>


1.18 type="action"

<setting type="action" id="test33" label="32033" action="RunScript(script.globalsearch)" option="close"/>


<setting type="action" id="test34" label="32034" action="RunScript(weather.yahoo,Location1)" default=""/>


You can use the variables $ID and $CWD in your actions. $ID will be replaced by your add-on ID and $CWD with your add-on path:

1.19 type="fileenum"

fileenum type settings (which was basically a spincontrol listing all items) are no longer supported. these settings can be converted into a file or folder browser.

<setting type="fileenum" id="test35" label="32035" values="resources"/>


<setting type="fileenum" id="test36" label="32036" values="resources" mask="/"/>


<setting type="fileenum" id="test37" label="32037" values="resources" mask="*.txt"/>

1.20 type="colorbutton"

colorbutton type settings allow a user to open a color picker dialog to select a color from Kodi's default color list. When the color has been selected, you can preview the colour and the hex code.

Note: Available from Kodi v20

<setting id="test36.color" type="string" label="32035" help="">
	<level>0</level>
	<default>FF000000</default> <!-- Black -->
	<control type="colorbutton" />
</setting>