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 () == "":
self.grade.text (),
str (self.percentage.value ())
])
- self.educationlist.addTopLevelItem (educationitem)
\ No newline at end of file
+ self.educationlist.addTopLevelItem (educationitem)
</widget>
</item>
<item row="4" column="6">
- <widget class="QPushButton" name="editeducation">
+ <widget class="QPushButton" name="updateeducation">
<property name="text">
- <string>&Edit</string>
+ <string>&Update</string>
</property>
</widget>
</item>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ <property name="uniformRowHeights">
+ <bool>true</bool>
+ </property>
<column>
<property name="text">
<string>Degree</string>
</hint>
</hints>
</connection>
+ <connection>
+ <sender>deleteeducation</sender>
+ <signal>clicked()</signal>
+ <receiver>biacv_mainwindow</receiver>
+ <slot>on_delete_education()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>677</x>
+ <y>198</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>728</x>
+ <y>437</y>
+ </hint>
+ </hints>
+ </connection>
</connections>
<slots>
<slot>on_add_education()</slot>
+ <slot>on_delete_education()</slot>
</slots>
</ui>
# Form implementation generated from reading ui file 'biacv_mainwindow.ui'
#
-# Created: Wed Nov 30 10:52:18 2011
+# Created: Wed Nov 30 12:43:29 2011
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
self.addeducation.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Add", None, QtGui.QApplication.UnicodeUTF8))
self.addeducation.setObjectName(_fromUtf8("addeducation"))
self.gridLayout_3.addWidget(self.addeducation, 4, 4, 1, 2)
- self.editeducation = QtGui.QPushButton(self.tab_2)
- self.editeducation.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Edit", None, QtGui.QApplication.UnicodeUTF8))
- self.editeducation.setObjectName(_fromUtf8("editeducation"))
- self.gridLayout_3.addWidget(self.editeducation, 4, 6, 1, 1)
+ self.updateeducation = QtGui.QPushButton(self.tab_2)
+ self.updateeducation.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Update", None, QtGui.QApplication.UnicodeUTF8))
+ self.updateeducation.setObjectName(_fromUtf8("updateeducation"))
+ self.gridLayout_3.addWidget(self.updateeducation, 4, 6, 1, 1)
self.deleteeducation = QtGui.QPushButton(self.tab_2)
self.deleteeducation.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8))
self.deleteeducation.setObjectName(_fromUtf8("deleteeducation"))
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.educationlist.sizePolicy().hasHeightForWidth())
self.educationlist.setSizePolicy(sizePolicy)
+ self.educationlist.setAlternatingRowColors(True)
+ self.educationlist.setRootIsDecorated(False)
+ self.educationlist.setUniformRowHeights(True)
self.educationlist.setObjectName(_fromUtf8("educationlist"))
self.educationlist.headerItem().setText(0, QtGui.QApplication.translate("biacv_mainwindow", "Degree", None, QtGui.QApplication.UnicodeUTF8))
self.educationlist.headerItem().setText(1, QtGui.QApplication.translate("biacv_mainwindow", "Graduation date", None, QtGui.QApplication.UnicodeUTF8))
self.retranslateUi(biacv_mainwindow)
self.pages.setCurrentIndex(0)
QtCore.QObject.connect(self.addeducation, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_add_education)
+ QtCore.QObject.connect(self.deleteeducation, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_delete_education)
QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow)
def retranslateUi(self, biacv_mainwindow):