import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class SfaScreen(QWidget): instances = [] def __init__(self, parent): SfaScreen.instances.append(self) QWidget.__init__(self, parent) self.mainwin = parent self.name = self.title = self.widget = None def __del__(self): SfaScreen.instances.remove(self) def init(self, widget, name, title): if self.widget: sys.stderr.write("Screen is already initialized\n") return self.name = name self.title = title self.widget = widget layout = QVBoxLayout(self) layout.addWidget(self.widget) self.setLayout(layout) def getLinkText(self): return "%s" % (self.name, self.name) def getTitleText(self): return "%s" % self.title def setStatus(self, msg, timeout): self.mainwin.setStatus(msg, timeout) def signalAll(self, action): for i in SfaScreen.instances: method = getattr(i, action, None) if method: method() def rspecUpdated(self): pass def configurationChanged(self): pass def canClose(self): return True def mainWindowClose(self): pass