PDA

View Full Version : Python set view in plugin


Veda
2009-03-02, 21:21
Hello,

I'm creating a plugin for a site which has nice wide icon pictures which i am using in my plugin.
Now i want to make that the view is automatically set to Wide icons. Only half of the plugin is wide, the rest is normal, now the user needs to change it manually every time...
Is this possible? I have looked in the methods inside xbmcplugin, but this class don't seem to have such a function.

Many thnx.
Veda

rwparris2
2009-03-02, 21:38
not really...
you can use the builtin Container.SetViewMode(id), but each skin will have a different id for a wide-icon friendly view.

Veda
2009-03-02, 22:53
Thank you. Got that part working for 1 skin now, i was trying to get the skinname, is there a simple way to do this? Or do i need to use minidom on guisettings.xml? (tried that last one already, cant get it working).

Veda
2009-03-02, 23:44
Got that last one:
skindir = xbmc.getSkinDir()

getSkinDir=getSkinDir() -- Returns the active skin directory as a string. *Note, This is not the full path like 'q:\skins\MediaCenter', but only 'MediaCenter'. example: - skindir = xbmc.getSkinDir()

Thanks everyone :)

Veda

Edit: For those who want the same as i wanted:
Also some id's for the views.

gebruikvidmode=False;
skindir = xbmc.getSkinDir()
if (skindir=="PM3.HD"): #51=List
gebruikvidmode=True; #57=DVD thumbs
fulllistmode="56" #56=full list
widemode="54" #54=Wide icons
thumbmode="53" #53=thumbnail
elif (skindir=="Project Mayhem III"): #55=List
gebruikvidmode=True; #54=DVDIcons #52=icons
fulllistmode="55" #56=DVD
widemode="58" #58=Bigwide #57=Wide
thumbmode="52" #51=icons #53=BigIcons

if (gebruikvidmode):
xbmc.executebuiltin("Container.SetViewMode("+fulllistmode+")")