<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Miszka999</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Miszka999"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Miszka999"/>
	<updated>2026-06-20T02:14:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88832</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88832"/>
		<updated>2015-04-07T18:38:01Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
There are some functionality not cover by this wiki page. See C++ source:&lt;br /&gt;
  https://github.com/xbmc/xbmc/tree/master/xbmc/addons/GUIDialogAddonSettings.cpp&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| subsetting=&amp;quot;true&amp;quot; || Add dash in front of option&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_select&amp;quot; type=&amp;quot;34231&amp;quot; label=&amp;quot;Select&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_addon&amp;quot; type=&amp;quot;addon&amp;quot; label=&amp;quot;Addon&amp;quot; default=&amp;quot;&amp;quot; addontype=&amp;quot;xbmc.metadata.scraper.movies&amp;quot;  multiselect=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
* values=&amp;quot;$HOURS&amp;quot; is special case to select hour ( works only for type=&amp;quot;enum&amp;quot; )&lt;br /&gt;
* sort=&amp;quot;yes&amp;quot; - sorts labels ( works only for type=&amp;quot;labelenum&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;EnumHours&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;default_enumhours&amp;quot; values=&amp;quot;$HOURS&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88566</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88566"/>
		<updated>2015-04-03T09:21:24Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Different types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
There are some functionality not cover by this wiki page. See C++ source:&lt;br /&gt;
  https://github.com/xbmc/xbmc/tree/master/xbmc/addons/GUIDialogAddonSettings.cpp&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| subsetting=&amp;quot;true&amp;quot; || Add dash in front of option&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_select&amp;quot; type=&amp;quot;34231&amp;quot; label=&amp;quot;Select&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_addon&amp;quot; type=&amp;quot;addon&amp;quot; label=&amp;quot;Addon&amp;quot; default=&amp;quot;&amp;quot; addontype=&amp;quot;xbmc.metadata.scraper.movies&amp;quot;  multiselect=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
* values=&amp;quot;$HOURS&amp;quot; is special case to select hour ( works only for type=&amp;quot;enum&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;EnumHours&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;default_enumhours&amp;quot; values=&amp;quot;$HOURS&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88565</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88565"/>
		<updated>2015-04-03T08:39:08Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
There are some functionality not cover by this wiki page. See C++ source:&lt;br /&gt;
  https://github.com/xbmc/xbmc/tree/master/xbmc/addons/GUIDialogAddonSettings.cpp&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_select&amp;quot; type=&amp;quot;34231&amp;quot; label=&amp;quot;Select&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_addon&amp;quot; type=&amp;quot;addon&amp;quot; label=&amp;quot;Addon&amp;quot; default=&amp;quot;&amp;quot; addontype=&amp;quot;xbmc.metadata.scraper.movies&amp;quot;  multiselect=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
* values=&amp;quot;$HOURS&amp;quot; is special case to select hour ( works only for type=&amp;quot;enum&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;EnumHours&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;default_enumhours&amp;quot; values=&amp;quot;$HOURS&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88564</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88564"/>
		<updated>2015-04-03T08:13:44Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_select&amp;quot; type=&amp;quot;34231&amp;quot; label=&amp;quot;Select&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_addon&amp;quot; type=&amp;quot;addon&amp;quot; label=&amp;quot;Addon&amp;quot; default=&amp;quot;&amp;quot; addontype=&amp;quot;xbmc.metadata.scraper.movies&amp;quot;  multiselect=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
* values=&amp;quot;$HOURS&amp;quot; is special case to select hour ( works only for type=&amp;quot;enum&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;EnumHours&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;default_enumhours&amp;quot; values=&amp;quot;$HOURS&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88563</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88563"/>
		<updated>2015-04-03T08:12:24Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Rotary selector */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_select&amp;quot; type=&amp;quot;34231&amp;quot; label=&amp;quot;Select&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_addon&amp;quot; type=&amp;quot;addon&amp;quot; label=&amp;quot;Addon&amp;quot; default=&amp;quot;&amp;quot; addontype=&amp;quot;xbmc.metadata.scraper.movies&amp;quot;  multiselect=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
* values=&amp;quot;$HOURS&amp;quot; is special case to select hour ( works only for type=&amp;quot;enum&amp;quot; ??)&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88562</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88562"/>
		<updated>2015-04-03T08:10:19Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Selector */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_select&amp;quot; type=&amp;quot;34231&amp;quot; label=&amp;quot;Select&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;id_addon&amp;quot; type=&amp;quot;addon&amp;quot; label=&amp;quot;Addon&amp;quot; default=&amp;quot;&amp;quot; addontype=&amp;quot;xbmc.metadata.scraper.movies&amp;quot;  multiselect=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88561</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88561"/>
		<updated>2015-04-03T08:08:21Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Selector */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
Will open separate selection window &lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required): A list of values or language file ids from which the user can choose.&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;addontype=&amp;quot;&#039;&#039;xbmc.metadata.scraper.movies&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - type of addon.&lt;br /&gt;
* multiselect=&amp;quot;&#039;&#039;true|false&#039;&#039;&amp;quot; (optional) - allows to select several addons&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88560</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88560"/>
		<updated>2015-04-03T08:02:12Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Selectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;select&amp;quot; ====&lt;br /&gt;
==== type=&amp;quot;addon&amp;quot; ====&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88559</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88559"/>
		<updated>2015-04-03T07:59:42Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* type = &amp;quot;action&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Action execution ===&lt;br /&gt;
==== type = &amp;quot;action&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88558</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88558"/>
		<updated>2015-04-03T07:58:00Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* Execute action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== type = &amp;quot;action&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Adds line to configuration windows which allow to execute action&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88557</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88557"/>
		<updated>2015-04-03T07:53:38Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* type=&amp;quot;time&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;13:13&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_time&amp;quot; type=&amp;quot;time&amp;quot; label=&amp;quot;Time&amp;quot; default=&amp;quot;13:13&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Execute action ===&lt;br /&gt;
&lt;br /&gt;
Separator adds a label as separator between other element&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88556</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88556"/>
		<updated>2015-04-03T07:52:16Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: /* type=&amp;quot;date&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display or string&lt;br /&gt;
* default=&amp;quot;2015-03-12&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;record_date&amp;quot; type=&amp;quot;date&amp;quot; label=&amp;quot;Date&amp;quot; default=&amp;quot;2015-03-12&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Execute action ===&lt;br /&gt;
&lt;br /&gt;
Separator adds a label as separator between other element&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88555</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88555"/>
		<updated>2015-04-03T07:48:08Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: date and type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Date and time  input ===&lt;br /&gt;
==== type=&amp;quot;date&amp;quot; ====&lt;br /&gt;
==== type=&amp;quot;time&amp;quot; ====&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Execute action ===&lt;br /&gt;
&lt;br /&gt;
Separator adds a label as separator between other element&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88554</id>
		<title>Add-on settings</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_settings&amp;diff=88554"/>
		<updated>2015-04-03T07:46:23Z</updated>

		<summary type="html">&lt;p&gt;Miszka999: conditinal visibility  clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
settings.xml is a XML file that contains the current configuration for the addon and should be placed in the resources direcory. If your addon has&lt;br /&gt;
configurable items that are set by the user, put them here. This file defines what the user sees&lt;br /&gt;
when they click on Addon settings for your addon. You don&#039;t need to do any coding to utilise this functionality.&lt;br /&gt;
The format for the settings file is relatively straightforward as can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32001&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32011&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;username&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32012&amp;quot; type=&amp;quot;text&amp;quot;   id=&amp;quot;password&amp;quot; option=&amp;quot;hidden&amp;quot;  enable=&amp;quot;!eq(-1,)&amp;quot; default=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; subsetting=&amp;quot;true&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;debug&amp;quot; type=&amp;quot;bool&amp;quot; label=&amp;quot;32013&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
    &amp;lt;category label=&amp;quot;32010&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to supply at least one category element.&lt;br /&gt;
The label attribute of both categories and settings should be the id of a language string in your language files or the one of the main XBMC language file.&lt;br /&gt;
&lt;br /&gt;
== Different types ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting type and additional attributes can be one in the following table:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Description !! Value attribute (value=&amp;quot;&amp;quot;) !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| music ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| video ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| pictures ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| programs ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| local ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings can have additional attributes:&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| source=&amp;quot;&amp;quot; || &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, &amp;quot;pictures&amp;quot;, &amp;quot;programs&amp;quot;, &amp;quot;files&amp;quot;, &amp;quot;local&amp;quot; or blank.&amp;quot;&amp;lt;br /&amp;gt;if source is blank it will use the type for shares if it is a valid share if not a valid share it will use, both local and network drives.&lt;br /&gt;
|-&lt;br /&gt;
| visible=&amp;quot;&amp;quot; || &amp;quot;true&amp;quot;, &amp;quot;false&amp;quot; or conditional.&amp;lt;br /&amp;gt;Determines if the setting is displayed in the settings dialog (default = &#039;true&#039;)&amp;quot;&amp;lt;br /&amp;gt;You can also use a conditional statement:&amp;lt;br /&amp;gt;visible=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&amp;lt;br /&amp;gt;visible=&amp;quot;eq(-2,true)&amp;quot; ( same syntax like for enable=&amp;quot;&amp;quot; ) &lt;br /&gt;
|-&lt;br /&gt;
| enable=&amp;quot;&amp;quot; || Allows you to determine whether this setting should be shown based on the value of another setting. 3 comparators are available:&amp;quot;&lt;br /&gt;
* eq() Equal to&lt;br /&gt;
* gt() Greater than&lt;br /&gt;
* lt() Less than&lt;br /&gt;
&lt;br /&gt;
You can AND the comparators using the + symbol and negate it using the ! symbol (e.g. !eq() ). Each comparator takes 2 operands:&lt;br /&gt;
* Relative position of setting to compare&lt;br /&gt;
* Value to compare against&lt;br /&gt;
&lt;br /&gt;
Thus if we place settings in our file in this order:&lt;br /&gt;
: myFirst setting&lt;br /&gt;
: mySecondSetting&lt;br /&gt;
: myThirdSetting&lt;br /&gt;
&lt;br /&gt;
for the third setting we might add the option:&amp;lt;br /&amp;gt;&lt;br /&gt;
enable=&amp;quot;gt(-2,3) + lt(-2,10)&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can also use a conditional statement: enable=&amp;quot;System.HasAddon(plugin.video.youtube)&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Elements ==&lt;br /&gt;
&lt;br /&gt;
=== Line separators ===&lt;br /&gt;
Line separators add a horizontal separating line between other element. They are purely user-interface elements that do not allow user input and therefore have no meaningful value as a setting.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;sep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting type=&amp;quot;sep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;lsep&amp;quot; ====&lt;br /&gt;
Shows a horizontal line with a text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;lsep&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Text input ===&lt;br /&gt;
Text input elements allow a user to input text in various formats. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;text&amp;quot; ====&lt;br /&gt;
Allow a user to enter one line of text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* option=&amp;quot;hidden&amp;quot;|&amp;quot;urlencoded&amp;quot; (optional)&lt;br /&gt;
:if set to &amp;quot;hidden&amp;quot;, each characters entered by the user will be obfuscated with an asterisks (&amp;quot;*&amp;quot;), as is usual for entering passwords.&lt;br /&gt;
:if set to &amp;quot;urlencoded&amp;quot;, each non-alphanumeric characters entered by the user will be &amp;quot;escaped&amp;quot; using %XX encoding.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;text&amp;quot; id=&amp;quot;username&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;username&amp;quot; value=&amp;quot;john.doe&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Note|Security consideration: when using &amp;lt;nowiki&amp;gt;option=&amp;quot;hidden&amp;quot;&amp;lt;/nowiki&amp;gt;, the value entered by the user is still saved as an unencrypted string value on disk.}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;ipaddress&amp;quot; ====&lt;br /&gt;
Allow a user to enter an ip address as text.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32035&amp;quot; type=&amp;quot;ipaddress&amp;quot; id=&amp;quot;ipaddress&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;ipaddress&amp;quot; value=&amp;quot;127.0.0.1&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Numeric input ===&lt;br /&gt;
Numeric input elements allow a user to enter a number. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;number&amp;quot; ====&lt;br /&gt;
Allows the user to enter an integer using up/down buttons.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32036&amp;quot; type=&amp;quot;number&amp;quot; id=&amp;quot;code&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;code&amp;quot; value=&amp;quot;127000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return the number as a string value, which must be converted to an integer value if needed}}&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;slider&amp;quot; ====&lt;br /&gt;
Allows the user to enter a number using a horizontal sliding bar.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;5,5,100&amp;quot; option=&amp;quot;int&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32053&amp;quot; type=&amp;quot;slider&amp;quot; id=&amp;quot;limit&amp;quot; default=&amp;quot;20&amp;quot; range=&amp;quot;0,100&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting.&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;range=&amp;quot;&#039;&#039;min&#039;&#039;[,&#039;&#039;step&#039;&#039;],&#039;&#039;max&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - specify the range of valid values.&lt;br /&gt;
* &#039;&#039;&#039;option=&amp;quot;int&amp;quot;|&amp;quot;float&amp;quot;|&amp;quot;percent&amp;quot;&#039;&#039;&#039; (required) - specifies whether to allow the user to choose between integers, floating point numbers or a percentage.&lt;br /&gt;
* default=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string representation of a floating point value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;limit&amp;quot; value=&amp;quot;5.000000&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string, which must be converted to an int, float or percentage value if needed}}&lt;br /&gt;
&lt;br /&gt;
=== Boolean input ===&lt;br /&gt;
Boolean input elements allow a user to switch a setting on or off.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;bool&amp;quot; ====&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* default=&amp;quot;true&amp;quot;|&amp;quot;false&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;bool&amp;quot; id=&amp;quot;background&amp;quot; default=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are case sensitive!}}&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;background&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In Python, calling xbmcplugin.getSetting will return a string &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;, which must be converted to a boolean value if needed}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotary selector ===&lt;br /&gt;
A rotary selector allows the user to selected from a list of predefined values. &lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;enum&amp;quot; or &amp;quot;labelenum&amp;quot; ====&lt;br /&gt;
Both element types work the same except that the &amp;quot;enum&amp;quot; type will use the index of the chosen value, wheras the &amp;quot;labelenum&amp;quot; will use the actual value.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* &#039;&#039;&#039;values=&amp;quot;&#039;&#039;value1&#039;&#039;[|&#039;&#039;value2&#039;&#039;[...]]&amp;quot; - or -&lt;br /&gt;
* &#039;&#039;&#039;lvalues=&amp;quot;&#039;&#039;id1&#039;&#039;[|&#039;&#039;id2&#039;&#039;[...]]&amp;quot; (required):&lt;br /&gt;
: A list of values or language file ids from which the user can choose.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32018&amp;quot; type=&amp;quot;enum&amp;quot; id=&amp;quot;service1&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32019&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service2&amp;quot; values=&amp;quot;One|Two|Three|Four&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32020&amp;quot; type=&amp;quot;labelenum&amp;quot; id=&amp;quot;service3&amp;quot; lvalues=&amp;quot;32021|32022|32023|32024&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Selecting the value &amp;quot;One&amp;quot; will return the int value &amp;quot;0&amp;quot;, selecting the value &amp;quot;Two&amp;quot; will return the int value &amp;quot;1&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
The value entered by the user is saved as a string. For &amp;quot;enum&amp;quot;-type settings the index of the value is saved, starting at 0 for the first value. For &amp;quot;labelenum&amp;quot;-type settings the value is saved or, in case the lvalues attribute is used, the label translated in the language of the user.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service2&amp;quot; value=&amp;quot;One&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;service3&amp;quot; value=&amp;quot;SomethingTranslated&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File and folder browsing ===&lt;br /&gt;
File and folder browsing elements allow a user to select a file or folder by browsing the local disks or network. You can specify a media type to show only files of the chosen type to the user. The &amp;quot;label&amp;quot; attribute must contain an id from the language file that indicates which text to display for the input field.&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;file&amp;quot;, &amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a file. When using type=&amp;quot;audio&amp;quot;, &amp;quot;video&amp;quot;, &amp;quot;image&amp;quot; or &amp;quot;executable&amp;quot;, only files of those types are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional) - the default value.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;file&amp;quot; id=&amp;quot;file&amp;quot; value=&amp;quot;path_to_files&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the file selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;file&amp;quot; value=&amp;quot;smb://path_to_files/file.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;folder&amp;quot; ====&lt;br /&gt;
Allow the user to browse for and select a folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;id=&amp;quot;&#039;&#039;string&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - the name of the setting&lt;br /&gt;
* &#039;&#039;&#039;label=&amp;quot;&#039;&#039;id&#039;&#039;&amp;quot;&#039;&#039;&#039; (required) - an id from the language file that indicates which text to display.&lt;br /&gt;
* source=&amp;quot;auto&amp;quot;|&amp;quot;images&amp;quot;|... (optional, default=&amp;quot;auto&amp;quot;) - select a starting folder for the browse dialog.&amp;lt;!-- There was no additional information on the page when I rewrote it, so I made this assumption - is it correct? What other options are there besides &amp;quot;auto&amp;quot; and &amp;quot;images&amp;quot; --&amp;gt;&lt;br /&gt;
* value=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the default value.&lt;br /&gt;
* option=&amp;quot;writeable&amp;quot; (optional, default=&amp;quot;&amp;quot;) - the user can be allowed to create and select new folders by setting this argument.&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32033&amp;quot; type=&amp;quot;folder&amp;quot; id=&amp;quot;folder&amp;quot; source=&amp;quot;auto&amp;quot; option=&amp;quot;writeable&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full path to the folder selected by the user is saved as a string value on disk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;folder&amp;quot; value=&amp;quot;smb://path_to_files/&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== type=&amp;quot;fileenum&amp;quot; ====&lt;br /&gt;
Display files in a folder as an enum selector.&lt;br /&gt;
&lt;br /&gt;
Example: List sub-folders of the &#039;resources&#039; folder for this add-on in the settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting id=&amp;quot;myenum&amp;quot; type=&amp;quot;fileenum&amp;quot; values=&amp;quot;resources&amp;quot; mask=&amp;quot;/&amp;quot; &amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extra attributes ====&lt;br /&gt;
&lt;br /&gt;
* mask=&amp;quot;&#039;&#039;value&#039;&#039;&amp;quot; - filter selectable files. Examples: &amp;quot;/&amp;quot; - display only folders. &amp;quot;*.txt&amp;quot; - display only .txt files.&lt;br /&gt;
* option=&amp;quot;hideext&amp;quot; - hide file extensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Execute action ===&lt;br /&gt;
&lt;br /&gt;
Separator adds a label as separator between other element&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;setting label=&amp;quot;32032&amp;quot; type=&amp;quot;action&amp;quot; action=&amp;quot;RunScript(my.addon.id, downloadreport)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of actions that can be used:&lt;br /&gt;
* [[List of built-in functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Attributes:&lt;br /&gt;
* option=&amp;quot;close&amp;quot; (close the settings dialog before executing the action)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons|*]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Add-on development]]&lt;br /&gt;
[[Category:Skin development]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Miszka999</name></author>
	</entry>
</feed>