Delete skill set implemented
authorHarishankar <v.harishankar@gmail.com>
Thu, 1 Dec 2011 10:17:46 +0000 (15:47 +0530)
committerHarishankar <v.harishankar@gmail.com>
Thu, 1 Dec 2011 10:17:46 +0000 (15:47 +0530)
Deleting a skill set from the list of skills is
implemented.

biacv_mainwindow.py
biacv_mainwindow.ui
biacv_mainwindow_ui.py

index dbcbc05..99e6b7c 100644 (file)
@@ -9,6 +9,24 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                self.setupUi (self)
                self.currentfile = None
 
+       # delete skill set button is clicked
+       def on_delete_skill (self):
+               # get the selected items
+               selitems = self.skillslist.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)
+               # answer is yes
+               if ans == PyQt4.QtGui.QMessageBox.Yes:
+                       for item in selitems:
+                               self.skillslist.takeTopLevelItem (self.skillslist.indexOfTopLevelItem (item))
+
+                       self.reset_skillset_fields ()
+
        # add skill set button is clicked
        def on_add_skill (self):
                # if the skill title is blank
@@ -26,7 +44,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
 
        # clear the skill set fields
        def reset_skillset_fields (self):
-               self.skillsetitle.setText ("")
+               self.skillsettitle.setText ("")
                self.skilldescription.setPlainText ("")
 
        # update professional history button is clicked
index f8ffb74..156dd06 100644 (file)
@@ -31,7 +31,7 @@
        <enum>QTabWidget::Rounded</enum>
       </property>
       <property name="currentIndex">
-       <number>4</number>
+       <number>0</number>
       </property>
       <property name="documentMode">
        <bool>true</bool>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>deleteskill</sender>
+   <signal>clicked()</signal>
+   <receiver>biacv_mainwindow</receiver>
+   <slot>on_delete_skill()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>598</x>
+     <y>238</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>728</x>
+     <y>174</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>on_add_education()</slot>
   <slot>on_delete_profession()</slot>
   <slot>on_update_profession()</slot>
   <slot>on_add_skill()</slot>
+  <slot>on_delete_skill()</slot>
  </slots>
 </ui>
index 18d27e1..fa451f8 100644 (file)
@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'biacv_mainwindow.ui'
 #
-# Created: Thu Dec  1 10:10:58 2011
+# Created: Thu Dec  1 15:41:51 2011
 #      by: PyQt4 UI code generator 4.8.6
 #
 # WARNING! All changes made in this file will be lost!
@@ -418,6 +418,9 @@ class Ui_biacv_mainwindow(object):
         self.deleteskill.setObjectName(_fromUtf8("deleteskill"))
         self.gridLayout_5.addWidget(self.deleteskill, 2, 3, 1, 1)
         self.skillslist = QtGui.QTreeWidget(self.tab_4)
+        self.skillslist.setAlternatingRowColors(True)
+        self.skillslist.setRootIsDecorated(False)
+        self.skillslist.setUniformRowHeights(True)
         self.skillslist.setObjectName(_fromUtf8("skillslist"))
         self.skillslist.headerItem().setText(0, QtGui.QApplication.translate("biacv_mainwindow", "Skill set", None, QtGui.QApplication.UnicodeUTF8))
         self.skillslist.headerItem().setText(1, QtGui.QApplication.translate("biacv_mainwindow", "Description", None, QtGui.QApplication.UnicodeUTF8))
@@ -565,6 +568,7 @@ class Ui_biacv_mainwindow(object):
         QtCore.QObject.connect(self.deletehistory, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_delete_profession)
         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.QMetaObject.connectSlotsByName(biacv_mainwindow)
 
     def retranslateUi(self, biacv_mainwindow):