Kodi Community Forum

Full Version: Is it possible to dynamically set list of items in Addon settings from python?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I would like to define a list of items for my Addon settings page for the user to choose from. This list has to be created dynamically based on some parameters on the individual system.

So far I've only found documentation for the XML-based settings page which does not have any callbacks into my Python code. Is it possible to create parts of the settings page with Python and if yes: How?
Not possible now
So the only way would be to let the user manually enter the text in text boxes... Not the nicest way to do it, but it will work...
Maybe a silly idea, but would it be possible to dynamically write the "settings.xml" file?

The one in the Addon directory itself can't always be written, but is it possible to place a copy to the user profile? Where would I have to place my copy so Kodi uses it even if the Addon itself is installed to /usr/share/kodi/addons/ ?
Is it possible to place only this one resource file to the user profile and Kodi still reads all the other resource files from the global path?

When does Kodi actually read the settings.xml file? Do I have a Python callback which is always running before Kodi first reads settings.xml?
No you can't put the settings.xml file somewhere else. Yes we would like to have a more dynamic settings as well but it's just not done yet.
(2016-09-22, 08:04)M-Reimer Wrote: [ -> ]When does Kodi actually read the settings.xml file?

When it opens the relevant add-on settings page.