2011-02-05, 22:49
Hello everybody
I was thinking reusing a XBMC native window for the purpose of my plugin 'my pictures database'.
The goal is to reuse the 'smartplaylisteditor' window, set the strings I need everywhere (as for example, I don't need the choice of music/videos for the type, but pictures instead)
I think the idea is to call a windowXMLdialog with SmartPlayListEditor.xml.
I'm able to show the window, to cache some actions and some controls, but can't change anything
This is my starting idea :
Does someone have an idea ?
I was thinking reusing a XBMC native window for the purpose of my plugin 'my pictures database'.
The goal is to reuse the 'smartplaylisteditor' window, set the strings I need everywhere (as for example, I don't need the choice of music/videos for the type, but pictures instead)
I think the idea is to call a windowXMLdialog with SmartPlayListEditor.xml.
I'm able to show the window, to cache some actions and some controls, but can't change anything
This is my starting idea :
Code:
class GUI(xbmcgui.WindowXMLDialog):
def __init__(self,*args, **kwargs):
xbmcgui.WindowXML.__init__( self, *args, **kwargs )
pass
def onInit(self):
print "= STARTING SMARTALBUM ="
self.getControl(22).Label("test")
def onAction(self, action=None):
#here I often got errors with a simple print command
#so I wrote a print into a try/except
try:
print "..."#action
except:
#print "exception raised by the script :"
#print print_exc()
return
print "> action=%s"%action.getId()
print "<-"
#Close the script
if action == ACTION_PREVIOUS_MENU :
print "= QUITTING SMARTALBUM ="
self.close()
def onFocus(self,param):
print "> focus=%s"%param
print dir(self.getFocus(param))
print self.getFocus(param).getSelectedItem()
print "<-"
def onClick(self, controlID):
print "> onclick=%s"%controlID
print "<-"
ui = GUI('SmartPlaylistEditor.xml', os.getcwd(), forceFallback=True)
import time
ui.doModal()
del ui
Does someone have an idea ?