diff --git a/CHANGELOG b/CHANGELOG index 73a5e0f..e67b3bd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ - Incorrect relational operations now raise an exception instead of returning None - Forces relations to have correct names for attributes - Colored output in readline mode +- Can send email in survery 1.0 - Adds history in the GUI diff --git a/relational_gui/survey.py b/relational_gui/survey.py index 68fe3b4..85a779c 100644 --- a/relational_gui/survey.py +++ b/relational_gui/survey.py @@ -2,71 +2,89 @@ # Form implementation generated from reading ui file 'survey.ui' # -# Created: Tue Nov 11 11:46:10 2008 -# by: PyQt4 UI code generator 4.4.2 +# Created: Tue Jun 14 17:21:38 2011 +# by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s + class Ui_Form(object): def setupUi(self, Form): - Form.setObjectName("Form") - Form.resize(400,322) + Form.setObjectName(_fromUtf8("Form")) + Form.resize(422, 313) + Form.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.verticalLayout = QtGui.QVBoxLayout(Form) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.formLayout = QtGui.QGridLayout() - self.formLayout.setObjectName("formLayout") + self.formLayout.setObjectName(_fromUtf8("formLayout")) self.txtSystem = QtGui.QLineEdit(Form) - self.txtSystem.setObjectName("txtSystem") - self.formLayout.addWidget(self.txtSystem,0,1,1,1) + self.txtSystem.setObjectName(_fromUtf8("txtSystem")) + self.formLayout.addWidget(self.txtSystem, 0, 1, 1, 1) self.label = QtGui.QLabel(Form) - self.label.setObjectName("label") - self.formLayout.addWidget(self.label,1,0,1,1) + self.label.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + self.label.setObjectName(_fromUtf8("label")) + self.formLayout.addWidget(self.label, 1, 0, 1, 1) self.txtCountry = QtGui.QLineEdit(Form) - self.txtCountry.setObjectName("txtCountry") - self.formLayout.addWidget(self.txtCountry,1,1,1,1) + self.txtCountry.setObjectName(_fromUtf8("txtCountry")) + self.formLayout.addWidget(self.txtCountry, 1, 1, 1, 1) self.label_2 = QtGui.QLabel(Form) - self.label_2.setObjectName("label_2") - self.formLayout.addWidget(self.label_2,2,0,1,1) + self.label_2.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + self.label_2.setObjectName(_fromUtf8("label_2")) + self.formLayout.addWidget(self.label_2, 2, 0, 1, 1) self.txtSchool = QtGui.QLineEdit(Form) - self.txtSchool.setObjectName("txtSchool") - self.formLayout.addWidget(self.txtSchool,2,1,1,1) + self.txtSchool.setObjectName(_fromUtf8("txtSchool")) + self.formLayout.addWidget(self.txtSchool, 2, 1, 1, 1) self.label_3 = QtGui.QLabel(Form) - self.label_3.setObjectName("label_3") - self.formLayout.addWidget(self.label_3,3,0,1,1) + self.label_3.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + self.label_3.setObjectName(_fromUtf8("label_3")) + self.formLayout.addWidget(self.label_3, 3, 0, 1, 1) self.txtAge = QtGui.QLineEdit(Form) - self.txtAge.setObjectName("txtAge") - self.formLayout.addWidget(self.txtAge,3,1,1,1) + self.txtAge.setObjectName(_fromUtf8("txtAge")) + self.formLayout.addWidget(self.txtAge, 3, 1, 1, 1) self.label_4 = QtGui.QLabel(Form) - self.label_4.setObjectName("label_4") - self.formLayout.addWidget(self.label_4,4,0,1,1) + self.label_4.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + self.label_4.setObjectName(_fromUtf8("label_4")) + self.formLayout.addWidget(self.label_4, 4, 0, 1, 1) self.txtFind = QtGui.QLineEdit(Form) - self.txtFind.setObjectName("txtFind") - self.formLayout.addWidget(self.txtFind,4,1,1,1) + self.txtFind.setObjectName(_fromUtf8("txtFind")) + self.formLayout.addWidget(self.txtFind, 4, 1, 1, 1) self.label_5 = QtGui.QLabel(Form) - self.label_5.setObjectName("label_5") - self.formLayout.addWidget(self.label_5,0,0,1,1) + self.label_5.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + self.label_5.setObjectName(_fromUtf8("label_5")) + self.formLayout.addWidget(self.label_5, 0, 0, 1, 1) self.label_6 = QtGui.QLabel(Form) - self.label_6.setObjectName("label_6") - self.formLayout.addWidget(self.label_6,5,0,1,1) + self.label_6.setObjectName(_fromUtf8("label_6")) + self.formLayout.addWidget(self.label_6, 6, 0, 1, 1) self.txtComments = QtGui.QTextEdit(Form) self.txtComments.setTabChangesFocus(True) - self.txtComments.setObjectName("txtComments") - self.formLayout.addWidget(self.txtComments,5,1,1,1) + self.txtComments.setObjectName(_fromUtf8("txtComments")) + self.formLayout.addWidget(self.txtComments, 6, 1, 1, 1) + self.label_7 = QtGui.QLabel(Form) + self.label_7.setObjectName(_fromUtf8("label_7")) + self.formLayout.addWidget(self.label_7, 5, 0, 1, 1) + self.txtEmail = QtGui.QLineEdit(Form) + self.txtEmail.setObjectName(_fromUtf8("txtEmail")) + self.formLayout.addWidget(self.txtEmail, 5, 1, 1, 1) self.verticalLayout.addLayout(self.formLayout) self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.cmdCancel = QtGui.QPushButton(Form) - self.cmdCancel.setObjectName("cmdCancel") + self.cmdCancel.setObjectName(_fromUtf8("cmdCancel")) self.horizontalLayout.addWidget(self.cmdCancel) self.cmdClear = QtGui.QPushButton(Form) - self.cmdClear.setObjectName("cmdClear") + self.cmdClear.setObjectName(_fromUtf8("cmdClear")) self.horizontalLayout.addWidget(self.cmdClear) self.cmdSend = QtGui.QPushButton(Form) - self.cmdSend.setObjectName("cmdSend") + self.cmdSend.setDefault(True) + self.cmdSend.setObjectName(_fromUtf8("cmdSend")) self.horizontalLayout.addWidget(self.cmdSend) self.verticalLayout.addLayout(self.horizontalLayout) self.label.setBuddy(self.txtCountry) @@ -75,30 +93,34 @@ class Ui_Form(object): self.label_4.setBuddy(self.txtFind) self.label_5.setBuddy(self.txtSystem) self.label_6.setBuddy(self.txtComments) + self.label_7.setBuddy(self.txtEmail) self.retranslateUi(Form) - QtCore.QObject.connect(self.cmdCancel,QtCore.SIGNAL("clicked()"),Form.close) - QtCore.QObject.connect(self.cmdClear,QtCore.SIGNAL("clicked()"),self.txtComments.clear) - QtCore.QObject.connect(self.cmdClear,QtCore.SIGNAL("clicked()"),self.txtFind.clear) - QtCore.QObject.connect(self.cmdClear,QtCore.SIGNAL("clicked()"),self.txtAge.clear) - QtCore.QObject.connect(self.cmdClear,QtCore.SIGNAL("clicked()"),self.txtSchool.clear) - QtCore.QObject.connect(self.cmdClear,QtCore.SIGNAL("clicked()"),self.txtCountry.clear) - QtCore.QObject.connect(self.cmdClear,QtCore.SIGNAL("clicked()"),self.txtSystem.clear) - QtCore.QObject.connect(self.txtSystem,QtCore.SIGNAL("returnPressed()"),self.txtCountry.setFocus) - QtCore.QObject.connect(self.txtCountry,QtCore.SIGNAL("returnPressed()"),self.txtSchool.setFocus) - QtCore.QObject.connect(self.txtSchool,QtCore.SIGNAL("returnPressed()"),self.txtAge.setFocus) - QtCore.QObject.connect(self.txtAge,QtCore.SIGNAL("returnPressed()"),self.txtFind.setFocus) - QtCore.QObject.connect(self.txtFind,QtCore.SIGNAL("returnPressed()"),self.txtComments.setFocus) - QtCore.QObject.connect(self.cmdSend,QtCore.SIGNAL("clicked()"),Form.send) + QtCore.QObject.connect(self.cmdCancel, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.close) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtComments.clear) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtFind.clear) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtAge.clear) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtSchool.clear) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtCountry.clear) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtSystem.clear) + QtCore.QObject.connect(self.txtSystem, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtCountry.setFocus) + QtCore.QObject.connect(self.txtCountry, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtSchool.setFocus) + QtCore.QObject.connect(self.txtSchool, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtAge.setFocus) + QtCore.QObject.connect(self.txtAge, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtFind.setFocus) + QtCore.QObject.connect(self.cmdSend, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.send) + QtCore.QObject.connect(self.cmdClear, QtCore.SIGNAL(_fromUtf8("clicked()")), self.txtEmail.clear) + QtCore.QObject.connect(self.txtFind, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtEmail.setFocus) + QtCore.QObject.connect(self.txtEmail, QtCore.SIGNAL(_fromUtf8("returnPressed()")), self.txtComments.setFocus) QtCore.QMetaObject.connectSlotsByName(Form) - Form.setTabOrder(self.txtSystem,self.txtCountry) - Form.setTabOrder(self.txtCountry,self.txtSchool) - Form.setTabOrder(self.txtSchool,self.txtAge) - Form.setTabOrder(self.txtAge,self.txtFind) - Form.setTabOrder(self.txtFind,self.txtComments) - Form.setTabOrder(self.txtComments,self.cmdSend) - Form.setTabOrder(self.cmdSend,self.cmdClear) - Form.setTabOrder(self.cmdClear,self.cmdCancel) + Form.setTabOrder(self.txtSystem, self.txtCountry) + Form.setTabOrder(self.txtCountry, self.txtSchool) + Form.setTabOrder(self.txtSchool, self.txtAge) + Form.setTabOrder(self.txtAge, self.txtFind) + Form.setTabOrder(self.txtFind, self.txtEmail) + Form.setTabOrder(self.txtEmail, self.txtComments) + Form.setTabOrder(self.txtComments, self.cmdSend) + Form.setTabOrder(self.cmdSend, self.cmdClear) + Form.setTabOrder(self.cmdClear, self.cmdCancel) def retranslateUi(self, Form): Form.setWindowTitle(QtGui.QApplication.translate("Form", "Survey", None, QtGui.QApplication.UnicodeUTF8)) @@ -108,6 +130,7 @@ class Ui_Form(object): self.label_4.setText(QtGui.QApplication.translate("Form", "How did you find relational", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate("Form", "System", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("Form", "Comments", None, QtGui.QApplication.UnicodeUTF8)) + self.label_7.setText(QtGui.QApplication.translate("Form", "Email (only if you want a reply)", None, QtGui.QApplication.UnicodeUTF8)) self.cmdCancel.setText(QtGui.QApplication.translate("Form", "Cancel", None, QtGui.QApplication.UnicodeUTF8)) self.cmdClear.setText(QtGui.QApplication.translate("Form", "Clear", None, QtGui.QApplication.UnicodeUTF8)) self.cmdSend.setText(QtGui.QApplication.translate("Form", "Send", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/relational_gui/survey.ui b/relational_gui/survey.ui index 5911f2e..4807c3d 100644 --- a/relational_gui/survey.ui +++ b/relational_gui/survey.ui @@ -1,130 +1,144 @@ - + + Form - - + + 0 0 - 400 - 322 + 422 + 313 - + Survey - - + + - + - - - + + + - - - - + + + + - + Country - + txtCountry - - + + - - - - + + + + - + School - + txtSchool - - + + - - - - + + + + - + Age - + txtAge - - + + - - - - + + + + - + How did you find relational - + txtFind - - + + - - - - + + + + - + System - + txtSystem - - - + + + Comments - + txtComments - - - + + + true + + + + Email (only if you want a reply) + + + txtEmail + + + + + + - + - - + + Qt::Horizontal - + 40 20 @@ -133,25 +147,25 @@ - - + + Cancel - - + + Clear - - + + Send - + true @@ -166,6 +180,7 @@ txtSchool txtAge txtFind + txtEmail txtComments cmdSend cmdClear @@ -179,11 +194,11 @@ Form close() - - 228 - 294 + + 202 + 384 - + 180 319 @@ -195,11 +210,11 @@ txtComments clear() - - 288 - 298 + + 265 + 384 - + 291 248 @@ -211,13 +226,13 @@ txtFind clear() - - 270 - 294 + + 265 + 384 - - 284 - 153 + + 400 + 151 @@ -227,11 +242,11 @@ txtAge clear() - - 269 - 299 + + 265 + 384 - + 257 123 @@ -243,11 +258,11 @@ txtSchool clear() - - 310 - 299 + + 265 + 384 - + 317 87 @@ -259,13 +274,13 @@ txtCountry clear() - - 298 - 303 + + 265 + 384 - - 326 - 47 + + 400 + 70 @@ -275,13 +290,13 @@ txtSystem clear() - - 287 - 303 + + 265 + 384 - - 302 - 18 + + 400 + 39 @@ -291,11 +306,11 @@ txtCountry setFocus() - + 213 22 - + 224 52 @@ -307,11 +322,11 @@ txtSchool setFocus() - + 268 54 - + 276 89 @@ -323,11 +338,11 @@ txtAge setFocus() - + 355 85 - + 358 118 @@ -339,29 +354,13 @@ txtFind setFocus() - + 375 123 - - 375 - 156 - - - - - txtFind - returnPressed() - txtComments - setFocus() - - - 332 - 154 - - - 335 - 200 + + 400 + 151 @@ -371,16 +370,64 @@ Form send() - - 381 - 309 + + 327 + 384 - + 396 320 + + cmdClear + clicked() + txtEmail + clear() + + + 233 + 367 + + + 242 + 168 + + + + + txtFind + returnPressed() + txtEmail + setFocus() + + + 302 + 140 + + + 302 + 167 + + + + + txtEmail + returnPressed() + txtComments + setFocus() + + + 302 + 167 + + + 302 + 255 + + + send() diff --git a/relational_gui/surveyForm.py b/relational_gui/surveyForm.py index 7abc35e..119a6ea 100644 --- a/relational_gui/surveyForm.py +++ b/relational_gui/surveyForm.py @@ -61,6 +61,7 @@ class surveyForm (QtGui.QWidget): post+="school:" + str(self.ui.txtSchool.text().toUtf8())+ "\n" post+="age:" + str(self.ui.txtAge.text().toUtf8())+ "\n" post+="find:" + str(self.ui.txtFind.text().toUtf8())+ "\n" + post+="email:" + str(self.ui.txtEmail.text().toUtf8())+"\n" post+="comments:" + str(self.ui.txtComments.toPlainText().toUtf8()) #Clears the form @@ -69,6 +70,7 @@ class surveyForm (QtGui.QWidget): self.ui.txtSchool.clear() self.ui.txtAge.clear() self.ui.txtFind.clear() + self.ui.txtEmail.clear() self.ui.txtComments.clear() #sends the string