From: Harishankar Date: Wed, 30 Nov 2011 05:30:12 +0000 (+0530) Subject: Implemented "add" for educational qualification X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=ad773b422b8a5777bdf39df8d65d2825c89ec39e;p=biacv.git Implemented "add" for educational qualification Implemented the "add" button for educational qualification. --- diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 5b27e6d..3133477 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -9,4 +9,16 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.setupUi (self) def on_add_education (self): - print "Education" \ No newline at end of file + # check if the qualification title is set + if self.degree_name.text () == "": + PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "Some required fields are missing.") + else: + educationitem = PyQt4.QtGui.QTreeWidgetItem ([ + self.degree_name.text (), + self.yearofpassing.date ().toString ("MMM, yyyy"), + self.institution.text (), + self.university.text (), + self.grade.text (), + str (self.percentage.value ()) + ]) + self.educationlist.addTopLevelItem (educationitem) \ No newline at end of file diff --git a/biacv_mainwindow.ui b/biacv_mainwindow.ui index 30f8de2..804b43b 100644 --- a/biacv_mainwindow.ui +++ b/biacv_mainwindow.ui @@ -28,7 +28,7 @@ - 1 + 0 @@ -437,13 +437,43 @@ - + 0 0 + + + Degree + + + + + Graduation date + + + + + Institution + + + + + University + + + + + Grade + + + + + Percentage + + @@ -779,12 +809,12 @@ - &New... + &New - &Open + &Open... diff --git a/biacv_mainwindow_ui.py b/biacv_mainwindow_ui.py index 65fbd07..5fa55f0 100644 --- a/biacv_mainwindow_ui.py +++ b/biacv_mainwindow_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'biacv_mainwindow.ui' # -# Created: Wed Nov 30 10:05:57 2011 +# Created: Wed Nov 30 10:52:18 2011 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! @@ -266,13 +266,19 @@ class Ui_biacv_mainwindow(object): self.deleteeducation.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8)) self.deleteeducation.setObjectName(_fromUtf8("deleteeducation")) self.gridLayout_3.addWidget(self.deleteeducation, 4, 7, 1, 1) - self.educationlist = QtGui.QColumnView(self.tab_2) + self.educationlist = QtGui.QTreeWidget(self.tab_2) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.educationlist.sizePolicy().hasHeightForWidth()) self.educationlist.setSizePolicy(sizePolicy) self.educationlist.setObjectName(_fromUtf8("educationlist")) + self.educationlist.headerItem().setText(0, QtGui.QApplication.translate("biacv_mainwindow", "Degree", None, QtGui.QApplication.UnicodeUTF8)) + self.educationlist.headerItem().setText(1, QtGui.QApplication.translate("biacv_mainwindow", "Graduation date", None, QtGui.QApplication.UnicodeUTF8)) + self.educationlist.headerItem().setText(2, QtGui.QApplication.translate("biacv_mainwindow", "Institution", None, QtGui.QApplication.UnicodeUTF8)) + self.educationlist.headerItem().setText(3, QtGui.QApplication.translate("biacv_mainwindow", "University", None, QtGui.QApplication.UnicodeUTF8)) + self.educationlist.headerItem().setText(4, QtGui.QApplication.translate("biacv_mainwindow", "Grade", None, QtGui.QApplication.UnicodeUTF8)) + self.educationlist.headerItem().setText(5, QtGui.QApplication.translate("biacv_mainwindow", "Percentage", None, QtGui.QApplication.UnicodeUTF8)) self.gridLayout_3.addWidget(self.educationlist, 5, 0, 1, 8) self.pages.addTab(self.tab_2, _fromUtf8("")) self.tab_3 = QtGui.QWidget() @@ -463,10 +469,10 @@ class Ui_biacv_mainwindow(object): self.statusbar.setObjectName(_fromUtf8("statusbar")) biacv_mainwindow.setStatusBar(self.statusbar) self.action_New = QtGui.QAction(biacv_mainwindow) - self.action_New.setText(QtGui.QApplication.translate("biacv_mainwindow", "&New...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_New.setText(QtGui.QApplication.translate("biacv_mainwindow", "&New", None, QtGui.QApplication.UnicodeUTF8)) self.action_New.setObjectName(_fromUtf8("action_New")) self.action_Save = QtGui.QAction(biacv_mainwindow) - self.action_Save.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Open", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Save.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Open...", None, QtGui.QApplication.UnicodeUTF8)) self.action_Save.setObjectName(_fromUtf8("action_Save")) self.action_Save_2 = QtGui.QAction(biacv_mainwindow) self.action_Save_2.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Save", None, QtGui.QApplication.UnicodeUTF8)) @@ -501,7 +507,7 @@ class Ui_biacv_mainwindow(object): self.menubar.addAction(self.menu_Help.menuAction()) self.retranslateUi(biacv_mainwindow) - self.pages.setCurrentIndex(1) + self.pages.setCurrentIndex(0) QtCore.QObject.connect(self.addeducation, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_add_education) QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow)