From a08089c1801da4caf5126d2d50af02a025b081b7 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Thu, 1 Dec 2011 18:31:48 +0530 Subject: [PATCH] Update skill set implemented Completed implementing the update skill set list functionality. --- biacv_mainwindow.py | 29 +++++++++++++++++++++++ biacv_mainwindow.ui | 54 ++++++++++++++++++++++++++++++++++++++++-- biacv_mainwindow_ui.py | 13 ++++++---- 3 files changed, 89 insertions(+), 7 deletions(-) diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 99e6b7c..6ec4d1a 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -9,6 +9,35 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.setupUi (self) self.currentfile = None + # update the skill set button event + def on_update_skill (self): + # get the selected item + selitems = self.skillslist.selectedItems () + if selitems == []: + PyQt4.QtGui.QMessageBox.critical (self, "Cannot update", "No item selected.") + return + if self.skillsettitle.text () == "": + PyQt4.QtGui.QMessageBox.critical (self, "Cannot update", "A required field is missing.") + return + selitem = selitems[0] + + selitem.setText (0, self.skillsettitle.text ()) + selitem.setText (1, self.skilldescription.toPlainText ()) + + # selecting a skill from the list event + def on_select_skill (self): + self.set_skill_fields () + + # set the skill fields from the selected skill from the list + def set_skill_fields (self): + # get the selected items + selitems = self.skillslist.selectedItems () + if selitems == []: + return + selitem = selitems[0] + self.skillsettitle.setText (selitem.text (0)) + self.skilldescription.setPlainText (selitem.text (1)) + # delete skill set button is clicked def on_delete_skill (self): # get the selected items diff --git a/biacv_mainwindow.ui b/biacv_mainwindow.ui index 156dd06..2132054 100644 --- a/biacv_mainwindow.ui +++ b/biacv_mainwindow.ui @@ -727,9 +727,9 @@ - + - &Edit + &Update @@ -1190,6 +1190,54 @@ + + skillslist + activated(QModelIndex) + biacv_mainwindow + on_select_skill() + + + 453 + 359 + + + 730 + 279 + + + + + skillslist + itemSelectionChanged() + biacv_mainwindow + on_select_skill() + + + 602 + 331 + + + 726 + 413 + + + + + updateskill + clicked() + biacv_mainwindow + on_update_skill() + + + 437 + 243 + + + 728 + 360 + + + on_add_education() @@ -1203,5 +1251,7 @@ on_update_profession() on_add_skill() on_delete_skill() + on_select_skill() + on_update_skill() diff --git a/biacv_mainwindow_ui.py b/biacv_mainwindow_ui.py index fa451f8..abad310 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 15:41:51 2011 +# Created: Thu Dec 1 18:29:14 2011 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! @@ -409,10 +409,10 @@ class Ui_biacv_mainwindow(object): self.addskill.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Add", None, QtGui.QApplication.UnicodeUTF8)) self.addskill.setObjectName(_fromUtf8("addskill")) self.gridLayout_5.addWidget(self.addskill, 2, 1, 1, 1) - self.editskill = QtGui.QPushButton(self.tab_4) - self.editskill.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Edit", None, QtGui.QApplication.UnicodeUTF8)) - self.editskill.setObjectName(_fromUtf8("editskill")) - self.gridLayout_5.addWidget(self.editskill, 2, 2, 1, 1) + self.updateskill = QtGui.QPushButton(self.tab_4) + self.updateskill.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Update", None, QtGui.QApplication.UnicodeUTF8)) + self.updateskill.setObjectName(_fromUtf8("updateskill")) + self.gridLayout_5.addWidget(self.updateskill, 2, 2, 1, 1) self.deleteskill = QtGui.QPushButton(self.tab_4) self.deleteskill.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8)) self.deleteskill.setObjectName(_fromUtf8("deleteskill")) @@ -569,6 +569,9 @@ class Ui_biacv_mainwindow(object): QtCore.QObject.connect(self.updatehistory, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_update_profession) QtCore.QObject.connect(self.addskill, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_add_skill) QtCore.QObject.connect(self.deleteskill, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_delete_skill) + QtCore.QObject.connect(self.skillslist, QtCore.SIGNAL(_fromUtf8("activated(QModelIndex)")), biacv_mainwindow.on_select_skill) + 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.QMetaObject.connectSlotsByName(biacv_mainwindow) def retranslateUi(self, biacv_mainwindow): -- 2.20.1