2 from PyQt4.QtCore import SIGNAL
3 from PyQt4.QtGui import QWidget, QLabel, QLineEdit, QPushButton, QVBoxLayout
5 from sfadata import SfaData
6 from sfascreen import SfaScreen
8 class ConfigWidget(QWidget):
9 def __init__(self, parent=None):
10 QWidget.__init__(self, parent)
14 label1 = QLabel("User HRN:", self)
15 self.user = QLineEdit(self.data.getUser(), self)
16 label2 = QLabel("Slice HRN:", self)
17 self.slice = QLineEdit(self.data.getSlice(), self)
18 apply = QPushButton("Apply", self)
20 layout = QVBoxLayout()
21 layout.addWidget(label1)
22 layout.addWidget(self.user)
23 layout.addWidget(label2)
24 layout.addWidget(self.slice)
25 layout.addWidget(apply)
26 self.setLayout(layout)
28 self.connect(apply, SIGNAL('clicked()'),
32 self.data.setUser("%s" % self.user.text())
33 self.data.setSlice("%s" % self.slice.text())
34 self.data.save_config()
37 class SfaConfigScreen(SfaScreen):
38 def __init__(self, parent=None):
39 SfaScreen.__init__(self, parent)
41 config = ConfigWidget(self)
42 self.init(config, "Configure", "Configure the PlanetLab Federation GUI")