From: Harishankar Date: Thu, 1 Dec 2011 04:52:00 +0000 (+0530) Subject: Add skill set X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=c7d12f6f2ddd913613d94c177c3ec5864d4cf647;p=biacv.git Add skill set Implemented adding skill set to the list of skills --- diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 0af93bc..dbcbc05 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -9,6 +9,26 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.setupUi (self) self.currentfile = None + # add skill set button is clicked + def on_add_skill (self): + # if the skill title is blank + if self.skillsettitle.text () == "": + PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "A required field is missing.") + return + skillitem = PyQt4.QtGui.QTreeWidgetItem ( + [ + self.skillsettitle.text (), + self.skilldescription.toPlainText () + ] + ) + self.skillslist.addTopLevelItem (skillitem) + self.reset_skillset_fields () + + # clear the skill set fields + def reset_skillset_fields (self): + self.skillsetitle.setText ("") + self.skilldescription.setPlainText ("") + # update professional history button is clicked def on_update_profession (self): # get the selected item diff --git a/biacv_mainwindow.ui b/biacv_mainwindow.ui index fd9d129..f8ffb74 100644 --- a/biacv_mainwindow.ui +++ b/biacv_mainwindow.ui @@ -31,7 +31,7 @@ QTabWidget::Rounded - 0 + 4 true @@ -741,7 +741,27 @@ - + + + true + + + false + + + true + + + + Skill set + + + + + Description + + + @@ -867,6 +887,9 @@ &File + + Export as HTML document + &Export @@ -896,31 +919,52 @@ &New + + Create a new file + &Open... + + Open an existing file + &Save + + Save current file + + + Ctrl+S + Save &As... + + Save as a different file + &HTML... + + Export as HTML document + OpenDocument ODT... + + Export as an OpenOffice document + @@ -931,6 +975,9 @@ &About + + Show program information + @@ -1111,6 +1158,22 @@ + + addskill + clicked() + biacv_mainwindow + on_add_skill() + + + 307 + 240 + + + 730 + 127 + + + on_add_education() @@ -1122,5 +1185,6 @@ on_select_profession() on_delete_profession() on_update_profession() + on_add_skill() diff --git a/biacv_mainwindow_ui.py b/biacv_mainwindow_ui.py index a59164b..18d27e1 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: Wed Nov 30 20:11:07 2011 +# Created: Thu Dec 1 10:10:58 2011 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! @@ -417,8 +417,10 @@ class Ui_biacv_mainwindow(object): self.deleteskill.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8)) self.deleteskill.setObjectName(_fromUtf8("deleteskill")) self.gridLayout_5.addWidget(self.deleteskill, 2, 3, 1, 1) - self.skillslist = QtGui.QColumnView(self.tab_4) + self.skillslist = QtGui.QTreeWidget(self.tab_4) 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)) self.gridLayout_5.addWidget(self.skillslist, 3, 0, 1, 4) self.pages.addTab(self.tab_4, _fromUtf8("")) self.tab_5 = QtGui.QWidget() @@ -493,6 +495,7 @@ class Ui_biacv_mainwindow(object): self.menu_File.setTitle(QtGui.QApplication.translate("biacv_mainwindow", "&File", None, QtGui.QApplication.UnicodeUTF8)) self.menu_File.setObjectName(_fromUtf8("menu_File")) self.menu_Export = QtGui.QMenu(self.menu_File) + self.menu_Export.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Export as HTML document", None, QtGui.QApplication.UnicodeUTF8)) self.menu_Export.setTitle(QtGui.QApplication.translate("biacv_mainwindow", "&Export", None, QtGui.QApplication.UnicodeUTF8)) self.menu_Export.setObjectName(_fromUtf8("menu_Export")) self.menu_Help = QtGui.QMenu(self.menubar) @@ -504,27 +507,35 @@ class Ui_biacv_mainwindow(object): biacv_mainwindow.setStatusBar(self.statusbar) self.action_New = QtGui.QAction(biacv_mainwindow) self.action_New.setText(QtGui.QApplication.translate("biacv_mainwindow", "&New", None, QtGui.QApplication.UnicodeUTF8)) + self.action_New.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Create a new file", None, QtGui.QApplication.UnicodeUTF8)) self.action_New.setObjectName(_fromUtf8("action_New")) self.action_Save = QtGui.QAction(biacv_mainwindow) self.action_Save.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Open...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Save.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Open an existing file", None, QtGui.QApplication.UnicodeUTF8)) self.action_Save.setObjectName(_fromUtf8("action_Save")) self.action_Save_2 = QtGui.QAction(biacv_mainwindow) self.action_Save_2.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Save", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Save_2.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Save current file", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Save_2.setShortcut(QtGui.QApplication.translate("biacv_mainwindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8)) self.action_Save_2.setObjectName(_fromUtf8("action_Save_2")) self.actionSave_As = QtGui.QAction(biacv_mainwindow) self.actionSave_As.setText(QtGui.QApplication.translate("biacv_mainwindow", "Save &As...", None, QtGui.QApplication.UnicodeUTF8)) + self.actionSave_As.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Save as a different file", None, QtGui.QApplication.UnicodeUTF8)) self.actionSave_As.setObjectName(_fromUtf8("actionSave_As")) self.action_HTML = QtGui.QAction(biacv_mainwindow) self.action_HTML.setText(QtGui.QApplication.translate("biacv_mainwindow", "&HTML...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_HTML.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Export as HTML document", None, QtGui.QApplication.UnicodeUTF8)) self.action_HTML.setObjectName(_fromUtf8("action_HTML")) self.actionOpenDocument_ODT = QtGui.QAction(biacv_mainwindow) self.actionOpenDocument_ODT.setText(QtGui.QApplication.translate("biacv_mainwindow", "OpenDocument ODT...", None, QtGui.QApplication.UnicodeUTF8)) + self.actionOpenDocument_ODT.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Export as an OpenOffice document", None, QtGui.QApplication.UnicodeUTF8)) self.actionOpenDocument_ODT.setObjectName(_fromUtf8("actionOpenDocument_ODT")) self.actionE_xit = QtGui.QAction(biacv_mainwindow) self.actionE_xit.setText(QtGui.QApplication.translate("biacv_mainwindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) self.actionE_xit.setObjectName(_fromUtf8("actionE_xit")) self.action_About = QtGui.QAction(biacv_mainwindow) self.action_About.setText(QtGui.QApplication.translate("biacv_mainwindow", "&About", None, QtGui.QApplication.UnicodeUTF8)) + self.action_About.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Show program information", None, QtGui.QApplication.UnicodeUTF8)) self.action_About.setObjectName(_fromUtf8("action_About")) self.menu_Export.addAction(self.action_HTML) self.menu_Export.addAction(self.actionOpenDocument_ODT) @@ -553,6 +564,7 @@ class Ui_biacv_mainwindow(object): QtCore.QObject.connect(self.professionlist, QtCore.SIGNAL(_fromUtf8("activated(QModelIndex)")), biacv_mainwindow.on_select_profession) 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.QMetaObject.connectSlotsByName(biacv_mainwindow) def retranslateUi(self, biacv_mainwindow):