Help Needed: Customizing Pandora
#1
I love spbogie's Pandora addon (found here).

I've all ready created a pretty good skin (see post in Pandora Thread) and would like to make more. Problem is that you can only have one default skin. I would like to give the user an option to choose which skin to use in the settings menu.

I have figured out how to edit the settings menu to choose between multiple skins. Now I've run into the hard part. I've figured out that I must edit default.py and tell it which skin to load.

Here is what I have so far...

Settings.xml contains:
Code:
    <setting id="skin" type="enum" label="Look + Feel"
        values="Gloss|Alaska" default="0"/>
Gloss will be the default skin, thus it is in a folder named Default.

File Structure:
Code:
~XBMC\addons\XBMC-pandora\resources\skins
     |_Alaska
          |_skin files w/ skin.xml
     |_Default
          |_skin files w/ skin.xml

Each skin folder has a skin.xml with a line for:
Code:
<skinname>Gloss</skinname>
and
<skinname>Alaska</skinname>


Now I just need to edit default.py. Any help would be appriciated. I know 0 python. I need to write an If Statement (I thinnk) that takes the skin settings and loads the skin from the correct folder.

Thanks.
How to use Git
| AMD Athlon II X3 Triple Core Processor 2.9 GHz |GIGABYTE GA-MA785GM-US2H Mobo 2GB DDR2 Ram | MSI N430GT |
| Logitec Harmony Smart Control Remote| 52" Sharp Aquos LED TV | Denon AVR-X1000 |
| Freenas Server with 18TB ASRock Intel Avoton C2750 |
Reply
#2
I don't know how skins are loaded but for the settings and getting the skin.xml file I would do something like this.

Code:
if __settings__.getSetting( "skin" ) == "0":
    skin_file = xbmc.translatePath( os.path.join( scriptPath, 'resources', 'skins', '_Default', 'skin.xml' ) )
if __settings__.getSetting( "skin" ) == "1":
    skin_file = xbmc.translatePath( os.path.join( scriptPath, 'resources', 'skins', '_Alaska', 'skin.xml' ) )

This would need to go below where scriptPath is defined.
Reply

Logout Mark Read Team Forum Stats Members Help
Help Needed: Customizing Pandora1