Obsoleted; use sfa.util.rspecHelper directly
[sface.git] / sface / screens / sfascreen.py
index cb8a266..e3c584a 100644 (file)
@@ -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,26 @@ class SfaScreen(QWidget):
         self.name = name
         self.title = title
         self.widget = widget
-        self.label = QLabel("<b>%s</b>" % 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 "<a href='%s'>Go to %s</a>" % (self.name, self.name)
+    def getLinkText(self):
+        return "<a href='%s'>%s</a>" % (self.name, self.name)
+
+    def getTitleText(self):
+        return "<b>%s</b>" % self.title
+
+    def setStatus(self, msg, timeout):
+        self.mainwin.setStatus(msg, timeout)
+
+    def signalAll(self, action):
+        for i in SfaScreen.instances:
+            getattr(i, action)()
+
+    def rspecUpdated(self):
+        pass
+
+    def configurationChanged(self):
+        pass