Addon Settings

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
robweber Offline
Fan
Posts: 599
Joined: Sep 2009
Reputation: 15
Post: #1
In several skins there is a function Skin.setAddon() that is used to bring up an addon browser where the user can select an installed addon that can then be put on the homescreen, or into some kind of custom list.

I'd like to use that same function, only within the settings of an addon. My use case is like this: I'd like users to be able to select an installed addon which my addon will start on a timer. At first I thought of just making the addon setting a text field so it could be entered, but it would be far nicer to use some kind of browser where it can be selected to remove any input errors.

Does anyone know if this is possible? I've tried a few things and can't seem to get the results I'm looking for. The closest I could come is to use the "action" setting type to launch the skin.setAddon() function; but the result is saved to the guisettings.xml file. This makes sense for a skin but I'd like the setting in the settings.xml data file for my addon so I can use it. This may just not be possible but thought I'd check.

Thanks.
find quote
Bstrdsmkr Offline
Fan
Posts: 655
Joined: Oct 2010
Reputation: 12
Post: #2
I think that's the closest you can get. You could then read the setting from guisettings.xml and write it to the settings.xml as part of your action function?
find quote
robweber Offline
Fan
Posts: 599
Joined: Sep 2009
Reputation: 15
Post: #3
That's actually a pretty good idea. I had been calling the function directly, but as part of a script I could try to write the value someplace where my addon would have access to it. I'll try that out. Thanks.
find quote