From: Harishankar Date: Fri, 2 Dec 2011 04:55:56 +0000 (+0530) Subject: Delete language from list X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=a8c742af4e390e8e9288e8332bf6a782b1b83cbe;p=biacv.git Delete language from list Delete language from list is now implemented. --- diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 801928e..8c3b132 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -9,6 +9,23 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.setupUi (self) self.currentfile = None + # delete a language from the list of languages known + def on_delete_lang (self): + # get selected language + selitems = self.languageslist.selectedItems () + if selitems == []: + PyQt4.QtGui.QMessageBox.critical (self, "Cannot delete", "No items selected.") + return + # confirm + ans = PyQt4.QtGui.QMessageBox.question (self, "Confirm", + "Are you sure you wish to delete the selected item?", + PyQt4.QtGui.QMessageBox.Yes, PyQt4.QtGui.QMessageBox.No) + if ans == PyQt4.QtGui.QMessageBox.Yes: + for item in selitems: + self.languageslist.takeTopLevelItem (self.languageslist.indexOfTopLevelItem (item)) + + self.reset_language_fields () + # add a language to the list of languages known def on_add_lang (self): # check if the language is set diff --git a/biacv_mainwindow.ui b/biacv_mainwindow.ui index 9f6c3ad..dac093c 100644 --- a/biacv_mainwindow.ui +++ b/biacv_mainwindow.ui @@ -1284,6 +1284,22 @@ + + deletelanguage + clicked() + biacv_mainwindow + on_delete_lang() + + + 687 + 142 + + + 733 + 52 + + + on_add_education() @@ -1300,5 +1316,6 @@ on_select_skill() on_update_skill() on_add_lang() + on_delete_lang() diff --git a/biacv_mainwindow_ui.py b/biacv_mainwindow_ui.py index 7c27b0d..5f71108 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: Thu Dec 1 18:55:17 2011 +# Created: Fri Dec 2 10:24:51 2011 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! @@ -580,6 +580,7 @@ class Ui_biacv_mainwindow(object): QtCore.QObject.connect(self.skillslist, QtCore.SIGNAL(_fromUtf8("itemSelectionChanged()")), biacv_mainwindow.on_select_skill) QtCore.QObject.connect(self.updateskill, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_update_skill) QtCore.QObject.connect(self.addlanguage, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_add_lang) + QtCore.QObject.connect(self.deletelanguage, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_delete_lang) QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow) def retranslateUi(self, biacv_mainwindow):