X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fscreens%2Fsfascreen.py;h=15634680bea81b7da5accd28a4af750e796605ba;hp=cb8a26636eae1154531830372d44cb00aed15cfc;hb=e05a4f6ac4c3e6d0e8a88ad31ec8516440cdd2b3;hpb=e095c7423002644d129cef273f3a63646903b788 diff --git a/sface/screens/sfascreen.py b/sface/screens/sfascreen.py index cb8a266..1563468 100644 --- a/sface/screens/sfascreen.py +++ b/sface/screens/sfascreen.py @@ -4,10 +4,17 @@ 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") @@ -16,14 +23,34 @@ class SfaScreen(QWidget): self.name = name self.title = title self.widget = widget - self.label = QLabel("%s" % self.title, self) - self.label.setScaledContents(False) layout = QVBoxLayout(self) - layout.addWidget(self.label) layout.addWidget(self.widget) - self.setLayout(layout) - def getLabelText(self): - return "Go to %s" % (self.name, self.name) + 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