Skin GUI Dialogs
🔖 v1.1.25+
SkinVariables provides access to several standard Kodi GUI dialogs such as DialogSelect, DialogConfirm, DialogTextViewer
RunScript(script.skinvariables,run_dialog=DIALOG)
Replace DIALOG
with the type of dialog.
Options should be comma separated after DIALOG in RunScript command
Name | Window | Options |
---|---|---|
ok | DialogConfirm.xml |
heading=string message=string load_file
|
yesno | DialogConfirm.xml |
heading=string message=string nolabel=string yeslabel=string autoclose=integer defaultbutton=integer load_file
|
yesnocustom | DialogConfirm.xml |
heading=string message=string nolabel=string yeslabel=string customlabel=string autoclose=integer defaultbutton=integer load_file
|
textviewer | DialogTextViewer.xml |
heading=string text=string load_file
|
notification | DialogNotification.xml |
heading=string message=string icon=string time=integer sound=true/false
|
numeric | DialogNumeric.xml |
heading=string defaultt=string type=integer bHiddenInput=true/false
|
input | DialogKeyboard.xml |
heading=string defaultt=string type=integer option=integer autoclose=integer
|
browse | FileBrowser.xml |
heading=string shares=string mask=string defaultt=string type=integer useThumbs=true/false treatAsFolder=true/false enableMultiple=true/false
|
colorpicker | DialogColorPicker.xml |
heading=string selectedcolor=string colorfile=string
|
contextmenu | DialogContextMenu.xml |
list=item00 / item01 / item02 etc. separator=' / '
|
select | DialogSelect.xml |
heading=string list=item00 / item01 / item02 etc. separator=' / ' autoclose=integer preselect=integer
|
multiselect | DialogSelect.xml |
heading=string list=item00 / item01 / item02 etc. separator=' / ' autoclose=integer preselect=integer
|
📝 Values for timers such as time or autoclose are in milliseconds
📚 The load_file
param allows loading a text file as message/text
💡 Example: Load skin LICENSE.txt in textviewer:
RunScript(script.skinvariables,run_dialog=textviewer,text=special://skin/LICENSE.txt,load_file)
Executebuiltin Using Selected Value
You may wish to run a Kodi builtin on a successful selection from a dialog. To do so, use the "executebuiltin=Builtin()"
param. The value returned by a list or confirmation dialog can be substituted by adding {v}
for the value or `{x} for the index.
💡 Example: Select a genre from ListItem.Genre using DialogSelect and write selected value to a window property
RunScript(script.skinvariables,run_dialog=select,list=$INFO[ListItem.Genre],heading=Genres,"executebuiltin=SetProperty(MyGenre,{v},Home)")
Specific Executebuiltin Actions per Choice
You may also wish to define specific actions per selection. To do so, use the executebuiltin_x=
where "x" is the number of the index of the choice
💡 Example: Select a choice from a list and either set a string to the value or clear it
RunScript(script.skinvariables,run_dialog=select,list=Always / Never / Clear,"executebuiltin_2=Skin.Reset(Choice)","executebuiltin=Skin.SetString(Choice,{v})")
📚 Executebuiltin commands can be chained with double pipe ||
RunScript(script.skinvariables,run_dialog=select,list=Always / Never / Clear,"executebuiltin_2=Skin.Reset(Choice)||Notification(Cleared,Reset Choice)","executebuiltin=Skin.SetString(Choice,{v})||Notification(Set,Choice {v})")
RunScript(script.skinvariables,run_progressdialog,background)
Opens DialogExtendedProgressBar.xml
if the background
param is specified. Otherwise opens DialogConfirm.xml
with progressbar.
Optional Params
Param | Description |
---|---|
heading=text | The text to display as the Dialog heading |
message=text | The text to display as the Dialog default message |
message_info=infolabel | The infolabel to use as the displayed message when the progress bar updates. For instance message_info=Window(home).Property(DialogProgressMessage) will allow the skin to update the displayed message using SetProperty(DialogProgressMessage,text,home)
|
progress_info=infolabel | The infolabel to retrieve the progress percentage value (0-100). If not specified, the value increments each poll cycle. |
max_value=integer | Default is 100 The value at which the dialog will close. Progress is displayed as a percentage where progress_info/max_value*100
|
timeout=integer | Default is 200 The number of polling cycles before the dialog closes if max_value has not been reached |
polling=float | Default is 0.1 How many seconds to wait between each polling cycle. |