XBMC Community Forum
HOW-TO write GUI settings for XBMC python plugins and scripts (addons) - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: HOW-TO write GUI settings for XBMC python plugins and scripts (addons) (/showthread.php?tid=29577)

Pages: 1 2 3 4 5 6 7


- solexalex - 2010-07-29 23:44

thanks
I'll try these later and keep in touch


- TobiasTheCommie - 2010-08-28 14:38

Is it possible to add more pages to the settings window?

With a lot of settings the "general" view is quickly becoming cluttered, so it would be nice to add an "advanced" view.


- Nuka1195 - 2010-08-28 15:51

http://trac.xbmc.org/attachment/ticket/9918/addon-settings4.zip

has an example script that has categories in settings.xml


- TobiasTheCommie - 2010-08-28 15:52

Thank you


- teshephe - 2010-09-01 14:45

Big Grin Good stuff..

My question is that I have some items that the string can be quite long so how do I make it so when you edit a item that is too long, that it scrolls or the text in the edit box moves to the left as I cursor to the right to see what I am editing in the user interface?


Thanks!


- jmarshall - 2010-09-02 01:45

The Editcontrol automatically does this. I suspect, however, that you're referring to the virtualkeyboard which does not use an editcontrol.


- teshephe - 2010-09-03 01:56

jmarshall Wrote:The Editcontrol automatically does this. I suspect, however, that you're referring to the virtualkeyboard which does not use an editcontrol.

Thanks.


- teshephe - 2010-09-04 17:43

I am having a problem when I moved to the 10.0 BETA.. when I goto plugin/addon settings, not all of the settings are showing up. Again it is only in 10.0 (maybe a bug?)

The only items that show for editing or view on the addon setting dialogue are:

streaming_ip
vlc_loc
video_sout
audio_sout
pls_path
thumbs_path
search_engine


My code: (settings.xml)
Code:
settings>

    <setting id="separator" type="lsep" label="30039"/>

    <setting id="streaming_setup" type="text" label="30040" default="" enable="false"/>

    <setting id="streaming_ip" type="text" label="30041" default="224.1.1.152"/>

    <setting id="streaming_port" type="integer" label="30042" default="1152"/>

    <setting id="vlc_loc" type="text" label="30043" default="/usr/bin/vlc"/>

    <setting id="separator" type="lsep" label=""/>

    <setting id="separator" type="lsep" label="30044"/>

    <setting id="video_streaming" type="text" label="30045" default="" enable="false"/>

    <setting id="video_sout" type="text" label="30046" default="--sout=#duplicate{dst=std{access=udp,mux=ts,dst=224.1.1.152:1152}}"/>

    <setting id="video_fc" type="integer" label="30047" default="10"/>

    <setting id="separator" type="lsep" label=""/>

    <setting id="separator" type="lsep" label="30048"/>

    <setting id="audio_streaming" type="text" label="30049" default="" enable="false"/>

    <setting id="audio_sout" type="text" label="30046" default="--sout=#duplicate{dst=std{access=udp,mux=ts,dst=224.1.1.152:1152}}"/>

    <setting id="audio_fc" type="integer" label="30047" default="10"/>

    <setting id="separator" type="lsep" label=""/>

    <setting id="separator" type="lsep" label="30050"/>
    <setting id="pls_path" type="folder" source="files" label="30051" default="special://profle/addon_data/plugin.program.multiroomaudio/MultiroomAVsources/pls_files" />

    <setting id="thumbs_path" type="folder" source="files" label="30001" default="special://profile/UserData/Thumbnails" />

    <setting id="search_engine" type="fileenum" mask="/" values="resources\search_engines\" label="30002" default="Yahoo" />

</settings>



- amet - 2010-09-04 20:47

look here, settings.xml layout has changed a bit


- teshephe - 2010-09-04 21:48

Amet Wrote:look here, settings.xml layout has changed a bit

Thanks. I did not see anything about int type

Seems that's the one that are not showing up. Any ideas?Big Grin

EDIT....

I got it all working now w/ exception of the int type. Thanks for your help!


- amet - 2010-09-04 22:19

teshephe Wrote:Thanks. I did not see anything about int type

Seems that's the one that are not showing up. Any ideas?Big Grin

this should do it:
Code:
<setting id="audio_fc" type="number" label="bla" default="10"/>



- teshephe - 2010-09-04 22:51

Amet Wrote:this should do it:
Code:
<setting id="audio_fc" type="number" label="bla" default="10"/>

LOL!!! it's getting hard to keep up with the development! Thanks... that worked.Big Grin


- teshephe - 2010-09-07 05:59

Anyway to specify a different font for a specific <setting> type="text" ?


settings not working at all - chippyash - 2010-09-09 20:20

this is r33532 running on Fedora

resources/settings.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
    <setting id="gpoPath" type="text" label="100" default="/home/xbmc/gpodder-downloads" />
</settings>

resources/language/english/strings.xml
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
    <string id="100">Gpodder Download Directory</string>
</strings>

Selecting addon settings from context menu results in following from debug and no display of settings dialog
Code:
DEBUG: OnKey: 61453 pressed, action is Select
DEBUG: ------ Window Deinit (DialogContextMenu.xml) ------
DEBUG: ADDON: cpluff: 'Could not return information about unknown plug-in .'

I can retrieve the setting using
dir = xbmcplugin.getSetting(self._pluginId,'gpoPath') - no problem

Do I need to initialise something in the script?


- amet - 2010-09-09 20:28

resources/settings.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
     <category label="30100">
    <setting id="gpoPath" type="text" label="100" default="/home/xbmc/gpodder-downloads" />
     </category>
</settings>


resources/language/english/strings.xml

Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
    <string id="100">Gpodder Download Directory</string>
        <string id="30100">General</string>
</strings>