2011-05-02, 03:18
I'm trying to make a "select" that i can modify, for the moment i have this settings.xml
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)"?
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)"?