Implemented "add" for educational qualification
[biacv.git] / biacv_mainwindow.py
1 # class for main window
2
3 import PyQt4
4 import biacv_mainwindow_ui as bui
5
6 class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
7 def __init__ (self):
8 PyQt4.QtGui.QMainWindow.__init__ (self)
9 self.setupUi (self)
10
11 def on_add_education (self):
12 # check if the qualification title is set
13 if self.degree_name.text () == "":
14 PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "Some required fields are missing.")
15 else:
16 educationitem = PyQt4.QtGui.QTreeWidgetItem ([
17 self.degree_name.text (),
18 self.yearofpassing.date ().toString ("MMM, yyyy"),
19 self.institution.text (),
20 self.university.text (),
21 self.grade.text (),
22 str (self.percentage.value ())
23 ])
24 self.educationlist.addTopLevelItem (educationitem)