1 from GUIComponent import GUIComponent
2 from skin import applyAllAttributes
3 from Tools.CList import CList
9 self.onLayoutFinish = [ ]
10 self.summaries = CList()
14 def createGUIScreen(self, parent, desktop, updateonly = False):
15 for val in self.renderer:
16 if isinstance(val, GUIComponent):
19 if not val.applySkin(desktop, self):
20 print "warning, skin is missing renderer", val, "in", self
24 if isinstance(val, GUIComponent):
27 depr = val.deprecationInfo
28 if val.applySkin(desktop, self):
30 print "WARNING: OBSOLETE COMPONENT '%s' USED IN SKIN. USE '%s' INSTEAD!" % (key, depr[0])
31 print "OBSOLETE COMPONENT WILL BE REMOVED %s, PLEASE UPDATE!" % (depr[1])
33 print "warning, skin is missing element", key, "in", self
35 for w in self.additionalWidgets:
37 w.instance = w.widget(parent)
38 # w.instance.thisown = 0
39 applyAllAttributes(w.instance, desktop, w.skinAttributes, self.scale)
41 for f in self.onLayoutFinish:
42 if type(f) is not type(self.close): # is this the best way to do this?
43 exec(f) in globals(), locals()
47 def deleteGUIScreen(self):
48 for (name, val) in self.items():
49 if isinstance(val, GUIComponent):
53 self.deleteGUIScreen()
55 def createSummary(self):
58 def addSummary(self, summary):
59 self.summaries.append(summary)
61 def removeSummary(self, summary):
62 self.summaries.remove(summary)
64 def setTitle(self, title):
65 self.instance.setTitle(title)
67 self.summaries.setTitle(title)
69 def setDesktop(self, desktop):
70 self.desktop = desktop
75 baseres = (720, 576) # FIXME: a skin might have set another resolution, which should be the base res
76 for (key, value) in self.skinAttributes:
77 if key == "zPosition":
81 elif key == "baseResolution":
82 baseres = tuple([int(x) for x in value.split(',')])
83 self.scale = ((baseres[0], baseres[0]), (baseres[1], baseres[1]))
86 from enigma import eWindow
87 self.instance = eWindow(self.desktop, z)
89 applyAllAttributes(self.instance, self.desktop, self.skinAttributes, self.scale)
90 self.createGUIScreen(self.instance, self.desktop)