Delete language from list
authorHarishankar <v.harishankar@gmail.com>
Fri, 2 Dec 2011 04:55:56 +0000 (10:25 +0530)
committerHarishankar <v.harishankar@gmail.com>
Fri, 2 Dec 2011 04:55:56 +0000 (10:25 +0530)
Delete language from list is now implemented.

biacv_mainwindow.py
biacv_mainwindow.ui
biacv_mainwindow_ui.py

index 801928e..8c3b132 100644 (file)
@@ -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
index 9f6c3ad..dac093c 100644 (file)
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>deletelanguage</sender>
+   <signal>clicked()</signal>
+   <receiver>biacv_mainwindow</receiver>
+   <slot>on_delete_lang()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>687</x>
+     <y>142</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>733</x>
+     <y>52</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>on_add_education()</slot>
   <slot>on_select_skill()</slot>
   <slot>on_update_skill()</slot>
   <slot>on_add_lang()</slot>
+  <slot>on_delete_lang()</slot>
  </slots>
 </ui>
index 7c27b0d..5f71108 100644 (file)
@@ -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):