Kodi Community Forum
v17 Dynamic drop down list on settings page - 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: v17 Dynamic drop down list on settings page (/showthread.php?tid=268917)



Dynamic drop down list on settings page - suityou01 - 2016-04-11

I want to write an add on for tethering a RPI to a smartphone using Bluetooth. The Bluetooth part is ok for me, as there is a hands free library on SourceForge which looks like it does what I need.

I want to do the pairing through the Kodi Front end, and the most sensible place for this is on the settings page for my add on. So I need a dynamic list of Bluetooth devices for the user to chose which device to pair with. Drop down list, or list I'm not too fussed, but from what I read all settings lists are defined in the settings xml file.

Is there a way to have a dynamic list on the settings page?


RE: Dynamic drop down list on settings page - DarrenHill - 2016-04-11

The OpenElec and LibreElec settings add-ons both have that kind of list in them (I would expect the OSMC one probably has too, but it's been a while since I had an OSMC build running), so maybe that's something to look at and see if you can make use of the code from them as an example?


RE: Dynamic drop down list on settings page - suityou01 - 2016-04-11

This one?

https://github.com/OpenELEC/service.openelec.settings

I had a look but I couldn't find anything? Did I get the wrong code, or addon?


RE: Dynamic drop down list on settings page - DarrenHill - 2016-04-11

That's the add-on yes (at least I think it is).

One of its tabs is for setting up and listing existing Bluetooth pairings, so I presumed either it must be in there, or in a module that is imported into it.


RE: Dynamic drop down list on settings page - suityou01 - 2016-04-12

Ooooooh that's good. Ok thanks I will get it up in my dev box and take a look.

Thanks Smile