X-Git-Url: https://harishankar.org/repos/?p=biacv.git;a=blobdiff_plain;f=biacv_mainwindow.py;h=ac393f76079f809e90307d3575628e216938efb0;hp=3133477e46302ba76751eafbffc655ccfa5b6c91;hb=9aa733bc55ede2589ab2d55ad33fa805a77e1f82;hpb=ad773b422b8a5777bdf39df8d65d2825c89ec39e diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 3133477..ac393f7 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -7,7 +7,27 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): def __init__ (self): PyQt4.QtGui.QMainWindow.__init__ (self) self.setupUi (self) + self.currentfile = None + # delete educational qualification + def on_delete_education (self): + # get the selected items in the education list + selitems = self.educationlist.selectedItems () + # if no items are selected + if selitems == []: + PyQt4.QtGui.QMessageBox.critical (self, "Cannot delete", "No items selected.") + # delete the items after confirmation + else: + ans = PyQt4.QtGui.QMessageBox.question (self, "Confirm", + "Are you sure you wish to delete selected item?", + PyQt4.QtGui.QMessageBox.Yes, PyQt4.QtGui.QMessageBox.No) + if ans == PyQt4.QtGui.QMessageBox.Yes: + # remove the item selected + for item in selitems: + self.educationlist.takeTopLevelItem (self.educationlist.indexOfTopLevelItem (item)) + + + # add educational qualification button def on_add_education (self): # check if the qualification title is set if self.degree_name.text () == "": @@ -21,4 +41,4 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.grade.text (), str (self.percentage.value ()) ]) - self.educationlist.addTopLevelItem (educationitem) \ No newline at end of file + self.educationlist.addTopLevelItem (educationitem)