Implemented "add" for educational qualification
[biacv.git] / biacv_mainwindow.py
index 5b27e6d..3133477 100644 (file)
@@ -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