HOW-TO write GUI settings for XBMC python plugins and scripts (addons)

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #46
thanks
I'll try these later and keep in touch
find quote
TobiasTheCommie Offline
Skilled Python Coder
Posts: 617
Joined: Apr 2008
Reputation: 4
Post: #47
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.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #48
http://trac.xbmc.org/attachment/ticket/9...tings4.zip

has an example script that has categories in settings.xml

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
TobiasTheCommie Offline
Skilled Python Coder
Posts: 617
Joined: Apr 2008
Reputation: 4
Post: #49
Thank you
find quote
teshephe Offline
Senior Member
Posts: 107
Joined: Dec 2009
Reputation: 0
Post: #50
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!

Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
(This post was last modified: 2010-09-01 14:56 by teshephe.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,181
Joined: Oct 2003
Reputation: 175
Post: #51
The Editcontrol automatically does this. I suspect, however, that you're referring to the virtualkeyboard which does not use an editcontrol.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
teshephe Offline
Senior Member
Posts: 107
Joined: Dec 2009
Reputation: 0
Post: #52
jmarshall Wrote:The Editcontrol automatically does this. I suspect, however, that you're referring to the virtualkeyboard which does not use an editcontrol.

Thanks.

Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
find quote
teshephe Offline
Senior Member
Posts: 107
Joined: Dec 2009
Reputation: 0
Exclamation   
Post: #53
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>

Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
find quote
amet Offline
How do ya like them apples?
Posts: 4,083
Joined: Jul 2009
Reputation: 39
Location: Novi Sad / Dubai
Post: #54
look here, settings.xml layout has changed a bit


Always read the XBMC_Online_Manual,Frequently_Asked_Questions and search the forum before posting.
For troubleshooting and bug reporting use -> Log_file.
find quote
teshephe Offline
Senior Member
Posts: 107
Joined: Dec 2009
Reputation: 0
Post: #55
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!

Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
(This post was last modified: 2010-09-04 22:47 by teshephe.)
find quote
amet Offline
How do ya like them apples?
Posts: 4,083
Joined: Jul 2009
Reputation: 39
Location: Novi Sad / Dubai
Post: #56
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"/>


Always read the XBMC_Online_Manual,Frequently_Asked_Questions and search the forum before posting.
For troubleshooting and bug reporting use -> Log_file.
find quote
teshephe Offline
Senior Member
Posts: 107
Joined: Dec 2009
Reputation: 0
Post: #57
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

Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
find quote
teshephe Offline
Senior Member
Posts: 107
Joined: Dec 2009
Reputation: 0
Post: #58
Anyway to specify a different font for a specific <setting> type="text" ?

Enjoy OpenSource! :nod:
MY SETUP: XBMC 12 Frodo RC3, Multiple Asus EB1501's throughout the Home for XBMC based STB's
find quote
chippyash Offline
Senior Member
Posts: 130
Joined: Jan 2010
Reputation: 0
Location: Northants, UK
Post: #59
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?

System info: Asrock ION330HT-BD (Intel Atom 330 4 core i686) connected to Sony KDL-Z5800 TV using hdmi via Onkyo TX-SR507 AV Amp. [Old Config Ubuntu 12.04. (Linux 3.2.0-32-generic-pae ) XBMCBuntu (Eden 11.0 Git:unknown Compiled Mar 24 2012). OpenGL 3.3.0 NVIDIA 280.13] New Config unknown - no working XBMC at moment!
(This post was last modified: 2010-09-09 20:22 by chippyash.)
find quote
amet Offline
How do ya like them apples?
Posts: 4,083
Joined: Jul 2009
Reputation: 39
Location: Novi Sad / Dubai
Post: #60
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>


Always read the XBMC_Online_Manual,Frequently_Asked_Questions and search the forum before posting.
For troubleshooting and bug reporting use -> Log_file.
find quote
Post Reply