Changing skin themes in a python script?
#1
Hi guys,

I have had a python coder write me a script to unpack a zip file containing the required files for a skin theme, but we can't find anything to allow the next step. I would like to allow the user to make the just unpacked theme the current theme, but can't find anything that seems likely to work. What I suggested to my tame scripter was:

PHP Code:
while !Skin.HasTheme(theme)
       
xbmc.executebuiltin("XBMC.Skin.Theme"
First of all, yes I know that's not python, it was just to give an idea of how I thought we could try coding it. But apparently I can't use Skin.HasTheme(theme) as it is a boolean condition that can only be used from within the skin.

Does anyone have any suggestions on what we could try?

Thanks for your time
Wyrm (xTV-SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#2
If there's an option it's in Builtins.cpp
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
jmarshall Wrote:If there's an option it's in Builtins.cpp

Thanks Jonathan,

are you suggesting that this may be of use to someone that can write python (not me, but my scripter)

PHP Code:
933   
  934      CStdString strSkinTheme
;
  
935      if (iTheme==-1)
  
936        g_guiSettings.SetString("lookandfeel.skintheme","skindefault");
  
937      else
  
938        g_guiSettings.SetString("lookandfeel.skintheme",strSkinTheme);
  
939   
  940      
// also set the default color theme
  
941      g_guiSettings.SetString("lookandfeel.skincolors"CUtil::ReplaceExtension(strSkinTheme".xml"));
  
942 
So basically write the theme name to lookandfeel.skintheme and maybe call reloadskin() to apply the change?

Wyrm (xTV-SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#4
@wyrm
I think I found the answer after all...

Code:
xbmc.executehttpapi( "SetGUISetting(3;lookandfeel.skintheme;%s)"  % theme )
xbmc.executehttpapi( "SetGUISetting(3;lookandfeel.skincolors;%s)" % theme )
xbmc.executebuiltin( "XBMC.ReloadSkin()" )

http://wiki.xbmc.org/index.php?title=Lis..._Functions
http://wiki.xbmc.org/index.php?title=Web...r_HTTP_API
Reply

Logout Mark Read Team Forum Stats Members Help
Changing skin themes in a python script?0