Add skill set
authorHarishankar <v.harishankar@gmail.com>
Thu, 1 Dec 2011 04:52:00 +0000 (10:22 +0530)
committerHarishankar <v.harishankar@gmail.com>
Thu, 1 Dec 2011 04:52:00 +0000 (10:22 +0530)
Implemented adding skill set to the list of skills

biacv_mainwindow.py
biacv_mainwindow.ui
biacv_mainwindow_ui.py

index 0af93bc..dbcbc05 100644 (file)
@@ -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
index fd9d129..f8ffb74 100644 (file)
@@ -31,7 +31,7 @@
        <enum>QTabWidget::Rounded</enum>
       </property>
       <property name="currentIndex">
-       <number>0</number>
+       <number>4</number>
       </property>
       <property name="documentMode">
        <bool>true</bool>
          </widget>
         </item>
         <item row="3" column="0" colspan="4">
-         <widget class="QColumnView" name="skillslist"/>
+         <widget class="QTreeWidget" name="skillslist">
+          <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>Skill set</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>Description</string>
+           </property>
+          </column>
+         </widget>
         </item>
        </layout>
       </widget>
      <string>&amp;File</string>
     </property>
     <widget class="QMenu" name="menu_Export">
+     <property name="statusTip">
+      <string>Export as HTML document</string>
+     </property>
      <property name="title">
       <string>&amp;Export</string>
      </property>
    <property name="text">
     <string>&amp;New</string>
    </property>
+   <property name="statusTip">
+    <string>Create a new file</string>
+   </property>
   </action>
   <action name="action_Save">
    <property name="text">
     <string>&amp;Open...</string>
    </property>
+   <property name="statusTip">
+    <string>Open an existing file</string>
+   </property>
   </action>
   <action name="action_Save_2">
    <property name="text">
     <string>&amp;Save</string>
    </property>
+   <property name="statusTip">
+    <string>Save current file</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+S</string>
+   </property>
   </action>
   <action name="actionSave_As">
    <property name="text">
     <string>Save &amp;As...</string>
    </property>
+   <property name="statusTip">
+    <string>Save as a different file</string>
+   </property>
   </action>
   <action name="action_HTML">
    <property name="text">
     <string>&amp;HTML...</string>
    </property>
+   <property name="statusTip">
+    <string>Export as HTML document</string>
+   </property>
   </action>
   <action name="actionOpenDocument_ODT">
    <property name="text">
     <string>OpenDocument ODT...</string>
    </property>
+   <property name="statusTip">
+    <string>Export as an OpenOffice document</string>
+   </property>
   </action>
   <action name="actionE_xit">
    <property name="text">
    <property name="text">
     <string>&amp;About</string>
    </property>
+   <property name="statusTip">
+    <string>Show program information</string>
+   </property>
   </action>
  </widget>
  <resources/>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>addskill</sender>
+   <signal>clicked()</signal>
+   <receiver>biacv_mainwindow</receiver>
+   <slot>on_add_skill()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>307</x>
+     <y>240</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>730</x>
+     <y>127</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>on_add_education()</slot>
   <slot>on_select_profession()</slot>
   <slot>on_delete_profession()</slot>
   <slot>on_update_profession()</slot>
+  <slot>on_add_skill()</slot>
  </slots>
 </ui>
index a59164b..18d27e1 100644 (file)
@@ -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):