Looking for a way to force reload of settings.xml (and other questions)
#1
I'm trying to make a "select" that i can modify, for the moment i have this settings.xml

Code:
<settings>
  <category label="30100">
    <setting id="server_list" label="30100" type="select" values="" default=""/>
  </category>
  <category label="30101">
        <setting default="" id="server_add" label="30111" type="text" />
        <setting action="RunScript($CWD/resources/lib/edit_servers.py,add)" default="" id="add_server" label="30101" option="close" type="action" />
  </category>
</settings>

The edit_servers.py script modifies settings.xml, adds the server to then values in "server_list". That works ok but the changes to the settings.xml file arent reflected in the UI immediately. I have to exit the addon config so it updates the values. Is there a way to force a reload of the settings.xml file, or maybe make openSettings() reread them, or add a parameter to openSettings() to do it?

Another question: in visible="eq(-1,1)" the -1 is a relative value, would it be possible to add an absolute value too? something like visible="eq(abs:1,1)" meaning the first setting, i saw the cpp code and it doesnt seem that hard.

And another question: Can categories be hidden/enabled like the settings with visible="eq(-1,1)"?
Reply
#2
What is it you're trying to do?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Im trying to have a spinner/combobox where i can add/remove items programatically, not fixed. The other 2 questions arent as important. I can work around those.
Reply
#4
Right, and why exactly do you need that? Do you need to configure each of these things you're adding separately, so you're trying to offer the user a way to store previously-configured items?

I'm trying to accertain exactly what the requirement is so I can think about how it could be best implemented. Having the script writer alter settings.xml is dodgy at best Wink

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
jmarshall Wrote:Right, and why exactly do you need that? Do you need to configure each of these things you're adding separately, so you're trying to offer the user a way to store previously-configured items?

Exactly, I'm hacking at the JDownloader plugin to see if I can make it more generic, maybe adding support for other remote downloaders (Aria2C/MLDonkey/FDM/...), but I want to know if it is actually feasable so I'm just trying to make the UI first to learn my way around XBMC (never used python before).

Right now I have an "Add Server' category, which asks for a name and an action that calls a script to add it. The 'Remove Server' category has a list list of the added servers and a remove action, that removes it from the list. Also have a 'Edit Server' category which shows a list (spinner) of the servers and its properties (ip,port,user,password) that hide/show the settings as you change the spinner.

But the changes from add/remove takes some time to show, thats why i was thinking of a 'force reload' thing. Unless there's another option that I dont know (like I said, just started)

jmarshall Wrote:I'm trying to accertain exactly what the requirement is so I can think about how it could be best implemented. Having the script writer alter settings.xml is dodgy at best Wink

Yeah, I don't like it either, but is the only thing I could come up with. I wish there was a modifiable combobox-like control for settings. Smile
Reply
#6
So, no ideas on how I can do this?
Reply
#7
fawzib, did you ever find a solution to this?
Reply
#8
(2012-08-30, 13:02)laxtrappa Wrote: fawzib, did you ever find a solution to this?

Nope, anyway I've moved on to Plex + Roku. Works very well.
Reply
#9
Seems like you could add a fake setting that calls a script. That script closes the settings dialog and reopens it. Theoretically, it should open using the new xml
Reply

Logout Mark Read Team Forum Stats Members Help
Looking for a way to force reload of settings.xml (and other questions)0