Kodi Community Forum
Is it possible to dynamically set list of items in Addon settings from python? - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
--- Thread: Is it possible to dynamically set list of items in Addon settings from python? (/showthread.php?tid=291696)



Is it possible to dynamically set list of items in Addon settings from python? - M-Reimer - 2016-09-21

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?


RE: Is it possible to dynamically set list of items in Addon settings from python? - Martijn - 2016-09-21

Not possible now


RE: Is it possible to dynamically set list of items in Addon settings from python? - M-Reimer - 2016-09-21

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...


RE: Is it possible to dynamically set list of items in Addon settings from python? - M-Reimer - 2016-09-22

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?


RE: Is it possible to dynamically set list of items in Addon settings from python? - Martijn - 2016-09-22

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.


RE: Is it possible to dynamically set list of items in Addon settings from python? - black_eagle - 2016-09-22

(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.


This forum uses Lukasz Tkacz MyBB addons.