from Components.HTMLSkin import *
from Components.GUISkin import *
+from Components.Sources.Source import Source
import sys
class Screen(dict, HTMLSkin, GUISkin):
- """ bla """
+
+ ALLOW_SUSPEND = False
def __init__(self, session):
self.skinName = self.__class__.__name__
GUISkin.__init__(self)
self.onClose = [ ]
+ self.onFirstExecBegin = [ ]
self.onExecBegin = [ ]
self.onShown = [ ]
self.execing = False
self.shown = False
+ self.renderer = [ ]
+
# in order to support screens *without* a help,
# we need the list in every screen. how ironic.
self.helpList = [ ]
def execBegin(self):
self.active_components = [ ]
- for x in self.onExecBegin:
+
+ single = self.onFirstExecBegin
+ self.onFirstExecBegin = []
+ for x in self.onExecBegin + single:
x()
if self.session.current_dialog != self:
return
# fixup circular references
del self.helpList
GUISkin.close(self)
+
+ # first disconnect all render from their sources.
+ # we might split this out into a "unskin"-call,
+ # but currently we destroy the screen afterwards
+ # anyway.
+ for val in self.renderer:
+ val.disconnectAll() # disconnected converter/sources and probably destroy them
del self.session
for (name, val) in self.items():
for x in self.onShow:
x()
for val in self.values() + self.renderer:
- if isinstance(val, GUIComponent):
+ if isinstance(val, GUIComponent) or isinstance(val, Source):
val.onShow()
def hide(self):
for x in self.onHide:
x()
for val in self.values() + self.renderer:
- if isinstance(val, GUIComponent):
+ if isinstance(val, GUIComponent) or isinstance(val, Source):
val.onHide()
+
+ def __repr__(self):
+ return str(type(self))