initial commit
[sface.git] / sfascreen.py
1 import sys
2
3 from PyQt4.QtGui import QWidget, QLabel, QVBoxLayout
4
5 class SfaScreen(QWidget):
6     def __init__(self, parent):
7         QWidget.__init__(self, parent)
8         self.name = self.title = self.widget = None
9
10     def init(self, widget, name, title):
11         if self.widget:
12             sys.stderr.write("Screen is already initialized\n")
13             return
14
15         self.name = name
16         self.title = title
17         self.widget = widget
18         self.label = QLabel(self.title, self)
19
20         layout = QVBoxLayout(self)
21         layout.addWidget(self.label)
22         layout.addWidget(self.widget)
23
24         self.setLayout(layout)
25
26     def getLabelText(self):
27         return "<a href='%s'>%s</a>" % (self.name, self.name)