From: Drew Fisher Date: Fri, 3 Jul 2009 23:04:36 +0000 (-0500) Subject: Add a "completed" page with a stub to be used to commit adding the person to the... X-Git-Url: http://git.zarvox.org/%7B%7B%20url_for%28%27main.login_page%27%29%20%7D%7D?a=commitdiff_plain;h=99b693592d45a4608c1aff6c6716f4f1fdab86d1;p=wp3.git Add a "completed" page with a stub to be used to commit adding the person to the database. General wizard page cleanup. --- diff --git a/newpersonwizard.py b/newpersonwizard.py index dbbb3d9..bff7563 100644 --- a/newpersonwizard.py +++ b/newpersonwizard.py @@ -3,12 +3,14 @@ from PyQt4.QtGui import * 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() diff --git a/pagecommit.py b/pagecommit.py new file mode 100644 index 0000000..547b2e3 --- /dev/null +++ b/pagecommit.py @@ -0,0 +1,25 @@ +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_() + diff --git a/pagenetid.py b/pagenetid.py index 3f7abef..a44f08f 100644 --- a/pagenetid.py +++ b/pagenetid.py @@ -4,7 +4,6 @@ from PyQt4.QtGui import * class PageNetID(QWizardPage): def __init__(self, parent=None): QWizardPage.__init__(self,parent) - self.completed = False # Is the page done being filled out? self.instructions = QLabel("&Enter your NetID:") self.netid = QLineEdit() self.instructions.setBuddy(self.netid) diff --git a/pagenewuserdata.py b/pagenewuserdata.py index 57d8489..bb11bbe 100644 --- a/pagenewuserdata.py +++ b/pagenewuserdata.py @@ -47,16 +47,16 @@ class PageNewUserData(QWizardPage): 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