Posts: 8
Joined: Apr 2010
Reputation:
0
Hi,
is it possible to change/query system settings from python scripts? For example, I want to change Appearance - Settings - International - Language setting - of course, when I change it I want immediate effect without need to restart XBMC. I know that by using xbmc.getInfoLabel("...") you can get some of the available settings, but I didn't found any API to change them.
Thanks.
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
you can change what you want in userdata file then reload the skin via python.
Posts: 8
Joined: Apr 2010
Reputation:
0
Thanks. I just tried and if I manually change locale setting inside userdata/guisettings.xml from the python script running inside XBMC and then call xbmc.executebuiltin("ReloadSkin()") two things happens which I don't like:
1) XBMC removes my script window from the screen and returns back to the scripts list window. Can I return back, after skin reloads, to the my script window somehow?
2) My change is completely discarded and replaced with old setting (maybe ReloadSkin saves settings from the memory back into the the file before reload happens).
Posts: 8
Joined: Apr 2010
Reputation:
0
I managed to change setting with the following call:
xbmc.executehttpapi("SetGUISetting(3;locale.language;%s)" % language)
Also, this is the general way to change any setting.
But, I still have a problem with xbmc.executebuiltin("ReloadSkin()") because it doesn't switch to the new language, so I need to restart the XBMC. BTW Is there a nice way to restart XBMC from python script?