from pagenewuserdata import PageNewUserData
from pagenetid import PageNetID
+from pagecommit import PageCommit
class NewPersonWizard(QWizard):
def __init__(self, parent=None):
QWizard.__init__(self, parent)
self.addPage(PageNetID())
self.addPage(PageNewUserData())
+ self.addPage(PageCommit())
self.resize(400,300)
self.show()
--- /dev/null
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+class PageCommit(QWizardPage):
+ def __init__(self, parent=None):
+ QWizardPage.__init__(self,parent)
+ self.instructions = QLabel("You're done with the computer. Go have your picture taken.\n\nThe SAs/PAs will add the photo to your data.")
+ self.instructions.setWordWrap(True)
+ self.grid = QGridLayout()
+ self.grid.addWidget(self.instructions,0,0)
+ self.setLayout(self.grid)
+ self.setTitle("Move-in Wizard")
+ self.setSubTitle("Photo")
+ def initializePage(self):
+ pass # handle committing the data from the previous pages to the DB
+
+if __name__ == "__main__":
+ a = QApplication([""])
+ wiz = QWizard()
+ p = PageCommit()
+ wiz.addPage(p)
+ wiz.resize(400,300)
+ wiz.show()
+ a.exec_()
+
self.room.setMaxLength(3)
# Register fields with QWizard
- self.registerField("surname*", self.surname, "text", SIGNAL("textChanged(QString)"))
- self.registerField("firstname*", self.firstname, "text", SIGNAL("textChanged(QString)"))
- self.registerField("phone", self.phone, "text", SIGNAL("textChanged(QString)"))
- self.registerField("email*", self.email, "text", SIGNAL("textChanged(QString)"))
- self.registerField("major", self.major, "text", SIGNAL("textChanged(QString)"))
- self.registerField("dorm", self.dorm, "currentIndex", SIGNAL("currentIndexChanged(int)"))
- self.registerField("room*", self.room, "text", SIGNAL("textChanged(QString)"))
- self.registerField("year", self.year, "currentIndex", SIGNAL("currentIndexChanged(int)"))
- self.registerField("month", self.month, "currentIndex", SIGNAL("currentIndexChanged(int)"))
- self.registerField("day", self.day, "currentIndex", SIGNAL("currentIndexChanged(int)"))
+ self.registerField("surname*", self.surname)
+ self.registerField("firstname*", self.firstname)
+ self.registerField("phone", self.phone)
+ self.registerField("email*", self.email)
+ self.registerField("major", self.major)
+ self.registerField("dorm", self.dorm)
+ self.registerField("room*", self.room)
+ self.registerField("year", self.year)
+ self.registerField("month", self.month)
+ self.registerField("day", self.day)
# Set up layout