•  Previous
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 7
  • Next 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
HOW-TO write GUI settings for XBMC python plugins and scripts (addons)
#16
Thumbs Up 
Nuka1195 Wrote:There is now a "visible" attribute, works like the "enable" attribute.

Plugins now have localized strings also, same file as plugin settings.

Remember plugins/plugin settings id numbers are 30000-30999.

Wow! Xmas came so early.Thank you guys for the great work.
Reply
#17
Quote:
changed: added "fileenum" plugin setting type with optional "mask". this setting is filled automatically based on the mask and path you set with the "values" attribute. the path is based on your plugins current directory. Use / for your mask to return only folders
eg <setting id="scraper" type="fileenum" mask="/" values="showtimesAPI\scrapers\" label="30510" default="Google" />

Thanks JMarshall and d4rk for your help
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#18
Is there any type to use in plugin settings to input password? I mean that the text would then be displayed as stars or dots or something?

And is there any page in Wiki yet for general info on plugin development?
Reply
#19
Hello, anyone?

Also while I'm on the subject, where can I see that what attributes and their values are available for the plugin settings xml for example?

And when I'm creating xbmcgui.ListItem in my plugin and using the setInfo() to set the "attributes" of the video list item, where I can see that in what format should the size and duration and date be, for example?

I cannot seem to find any documentation about plugin development, other than this and that doesn't cover much. I can look from the source too, but I don't know where to look for example when I want to see what's possible to use in plugin settings xml or in what format should the date be when setting it to xbmcgui.ListItem.

Please, help Big Grin
Reply
#20
I was wondering if there's any place to get more detail on how the enable attribute works? I've tried enable="1" and enable="true" flat out and the option is still disabled. Leaving it out enables it again.

Basically I want a setting to be enabled only if the bool setting above it is true. I played around with some of the eq functions without much avail. Help would be much appreciated.
Reply
#21
enable="eq(control_count_from_here,value_that_control_should_be)"

eg
enable="eq(-2,2)"

means if the control two positions before this one is equal to 2, enable it

you can also use the ! for not

and gt() for greater than and lt() for less than

hopefully we can better document these in the wiki. i'm not very good at writing.
and you can group commands, i believe only + for and, | for or. i don't think you can mix + and |
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#22
Is there a way of exec a script and/or xbmc function from a setting option ?

ie. option 'View Readme' can launch a script function named viewReadme()

This would allow the of one/same settings dialog instead of having a MainMenu (of actions) which would also have a 'Settings Menu' option.

suggested format:
Quote:<setting id="readme" type="exec" source="viewReadme" label="30000" />

BBB
Retired from Add-on dev
Reply
#23
yes type="action"
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#24
Thanks.
got an example for me ?

or could you point me to the doc for this plugin settings use. Its not in the plugin.html and struggling to find it in the wiki ?
Retired from Add-on dev
Reply
#25
this log message was in the main trunk, so if someone is adding plugin settings doc to xbmcplugin.cpp, you will have to go thru that repo too. i usually added an example.

Quote:
added: new plugin/scraper setting type "action", it allows you to execute a builtin from settings.

"option" may be set to "close" to close the settings dialog when you click the setting.

e.g. <setting type="action" label="30090" option="close" default="RunPlugin(plugin://video/Apple Movie Trailers Plugin/?update=newest)" />
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#26
I just discover settings.xml in plugins (I know I am more a script guy and so still a newbie with plugins), and would like to say good job, it is very nice and useful to have this feature.
I was wondering is there (or will be) something similar for scripts?
Thanks!
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#27
Has been discussed already http://forum.xbmc.org/showthread.php?tid=45394

Currently on Nuka's TODO list when he has time.
Retired from Add-on dev
Reply
#28
BigBellyBilly Wrote:Has been discussed already http://forum.xbmc.org/showthread.php?tid=45394

Currently on Nuka's TODO list when he has time.
Thanks for the update BigBellyBilly.
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#29
Hi,

nice function. its working in the menu.. so i am able to edit and save my settings. I tried
to use it for my own script..

the only problem: i can't access the setting from my script.

my settings.xml under scripts/myscript/resources


PHP Code:
<settings>
   <
setting id="language" type="enum" label="30000" values="german|english|any" default="german"/>
   <
setting id="choose" type="bool" label="30001" default="false"/>
   <
setting id="resmax" type="enum" label="30002" values="1920|1280|640|480|320|160" default="480"/>
   <
setting id="resmin" type="enum" label="30003" values="1920|1280|640|480|320|160" default="480"/>  
</
settings

settings.xml after edit under userdata/script_data/myscript/
PHP Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<settings>
    <setting id="language" value="0" />
    <setting id="choose" value="false" />
    <setting id="resmax" value="3" />
    <setting id="resmin" value="3" />
</settings> 

my imports...
import xbmc, xbmcgui,xbmcplugin,sys


xbmcplugin.openSettings(sys.argv[0])

language = xbmcplugin.getSetting('language')
choose = xbmcplugin.getSetting('choose')
resmax = xbmcplugin.getSetting('resmax')
resmin = xbmcplugin.getSetting('resmin')

XBMC.log = No settings.xml file could be found!

Whats wrong, please help!

thanks
dd
Reply
#30
tested it with a plugin version of my script and it works.. so it doesn't work genreally for scripts??
Reply
  •  Previous
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 7
  • Next 



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