help: improve key description, a bit.
[enigma2.git] / lib / python / Screens / Screen.py
index ef9b2bb..b1e5a51 100644 (file)
@@ -11,6 +11,12 @@ class Screen(dict, HTMLSkin, GUISkin):
                self.session = session
                GUISkin.__init__(self)
                
                self.session = session
                GUISkin.__init__(self)
                
+               self.onClose = [ ]
+               
+               # in order to support screens *without* a help,
+               # we need the list in every screen. how ironic.
+               self.helpList = [ ]
+               
        def execBegin(self):
 #              assert self.session == None, "a screen can only exec one per time"
 #              self.session = session
        def execBegin(self):
 #              assert self.session == None, "a screen can only exec one per time"
 #              self.session = session
@@ -25,13 +31,19 @@ class Screen(dict, HTMLSkin, GUISkin):
        
        # never call this directly - it will be called from the session!
        def doClose(self):
        
        # never call this directly - it will be called from the session!
        def doClose(self):
+               for x in self.onClose:
+                       x()
+               
+               # fixup circular references
+               del self.helpList
                GUISkin.close(self)
                
                del self.session
                for (name, val) in self.items():
                GUISkin.close(self)
                
                del self.session
                for (name, val) in self.items():
-                       print "%s -> %d" % (name, sys.getrefcount(val))
                        del self[name]
        
                        del self[name]
        
-       def close(self, retval=None):
-               self.session.close()
+       def close(self, *retval):
+               self.session.close(*retval)
 
 
+       def setFocus(self, o):
+               self.instance.setFocus(o.instance)