Add professional qualification
authorHarishankar <v.harishankar@gmail.com>
Wed, 30 Nov 2011 10:21:33 +0000 (15:51 +0530)
committerHarishankar <v.harishankar@gmail.com>
Wed, 30 Nov 2011 10:21:33 +0000 (15:51 +0530)
Completed the add professional qualification functionality.

biacv_mainwindow.py
biacv_mainwindow.ui
biacv_mainwindow_ui.py

index 18dc486..f33a265 100644 (file)
@@ -9,6 +9,46 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                self.setupUi (self)
                self.currentfile = None
 
+       # add professional history button is clicked
+       def on_add_profession (self):
+               if self.designation.text () == "":
+                       PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "A required field is missing.")
+                       return
+
+               if self.currentemployment.isChecked ():
+                       leavedatestr = "current"
+               else:
+                       leavedatestr = self.leavedate.date ().toString ("dd MMM, yyyy")
+
+               professionitem = PyQt4.QtGui.QTreeWidgetItem (
+                       [
+                               self.designation.text (),
+                               self.joindate.date ().toString ("dd MMM, yyyy"),
+                               leavedatestr,
+                               self.organization.text (),
+                               self.additionalinfo.text ()
+                       ]
+                       )
+
+               self.professionlist.addTopLevelItem (professionitem)
+
+               self.reset_profession_fields ()
+
+       def reset_profession_fields (self):
+               self.designation.setText ("")
+               self.joindate.setDate (PyQt4.QtCore.QDate (2000, 1, 1))
+               self.leavedate.setDate (PyQt4.QtCore.QDate (2003, 1, 1))
+               self.currentemployment.setChecked (False)
+               self.organization.setText ("")
+               self.additionalinfo.setText ("")
+
+       # current employment check box is changed
+       def on_change_currentemployment (self, val):
+               if val == True:
+                       self.leavedate.setEnabled (False)
+               else:
+                       self.leavedate.setEnabled (True)
+
        # delete educational qualification
        def on_delete_education (self):
                # get the selected items in the education list
@@ -56,18 +96,18 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                # check if the qualification title is set
                if self.degree_name.text () == "":
                        PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "A required fields is missing.")
-               else:
-                       educationitem = PyQt4.QtGui.QTreeWidgetItem ([
-                                       self.degree_name.text (),
-                                       self.yearofpassing.date ().toString ("MMM, yyyy"),
-                                       self.institution.text (),
-                                       self.university.text (),
-                                       self.grade.text (),
-                                       str (self.percentage.value ())
+                       return
+               educationitem = PyQt4.QtGui.QTreeWidgetItem ([
+                       self.degree_name.text (),
+                       self.yearofpassing.date ().toString ("MMM, yyyy"),
+                       self.institution.text (),
+                       self.university.text (),
+                       self.grade.text (),
+                       str (self.percentage.value ())
                        ])
-                       self.educationlist.addTopLevelItem (educationitem)
-                       # clear the fields
-                       self.reset_education_fields ()
+               self.educationlist.addTopLevelItem (educationitem)
+               # clear the fields
+               self.reset_education_fields ()
 
        # set fields in the education tab from current selected item
        def set_education_fields (self):
index 4fb9cc8..812e7a8 100644 (file)
     </item>
     <item row="1" column="0" colspan="2">
      <widget class="QTabWidget" name="pages">
+      <property name="tabShape">
+       <enum>QTabWidget::Rounded</enum>
+      </property>
       <property name="currentIndex">
-       <number>1</number>
+       <number>0</number>
+      </property>
+      <property name="documentMode">
+       <bool>true</bool>
       </property>
       <widget class="QWidget" name="tab">
        <attribute name="title">
          </widget>
         </item>
         <item row="0" column="1" colspan="4">
-         <widget class="QLineEdit" name="positions"/>
+         <widget class="QLineEdit" name="designation"/>
         </item>
         <item row="1" column="0">
          <widget class="QLabel" name="label_26">
          </widget>
         </item>
         <item row="2" column="2" colspan="2">
-         <widget class="QCheckBox" name="checkBox">
+         <widget class="QCheckBox" name="currentemployment">
           <property name="text">
            <string>Current employment</string>
           </property>
          </widget>
         </item>
         <item row="6" column="0" colspan="5">
-         <widget class="QColumnView" name="historylist"/>
+         <widget class="QTreeWidget" name="professionlist">
+          <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>Job title</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>Date of joining</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>Date of leaving</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>Organization</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>Additional info</string>
+           </property>
+          </column>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tab_6">
+       <attribute name="title">
+        <string>Career objectives</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_8">
+        <item row="0" column="0">
+         <widget class="QLabel" name="label_35">
+          <property name="text">
+           <string>Short term career objectives (one per line)</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QPlainTextEdit" name="shorttermcareer">
+          <property name="verticalScrollBarPolicy">
+           <enum>Qt::ScrollBarAlwaysOn</enum>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="0">
+         <widget class="QLabel" name="label_36">
+          <property name="text">
+           <string>Long term career goals (one per line)</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="0">
+         <widget class="QPlainTextEdit" name="longtermgoals">
+          <property name="verticalScrollBarPolicy">
+           <enum>Qt::ScrollBarAlwaysOn</enum>
+          </property>
+         </widget>
         </item>
        </layout>
       </widget>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>currentemployment</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>biacv_mainwindow</receiver>
+   <slot>on_change_currentemployment()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>368</x>
+     <y>140</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>728</x>
+     <y>246</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>addhistory</sender>
+   <signal>clicked()</signal>
+   <receiver>biacv_mainwindow</receiver>
+   <slot>on_add_profession()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>391</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>729</x>
+     <y>289</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>on_add_education()</slot>
   <slot>on_delete_education()</slot>
   <slot>on_select_education()</slot>
   <slot>on_update_education()</slot>
+  <slot>on_change_currentemployment()</slot>
+  <slot>on_add_profession()</slot>
  </slots>
 </ui>
index 9d60bad..5760b36 100644 (file)
@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'biacv_mainwindow.ui'
 #
-# Created: Wed Nov 30 14:34:55 2011
+# Created: Wed Nov 30 15:47:09 2011
 #      by: PyQt4 UI code generator 4.8.6
 #
 # WARNING! All changes made in this file will be lost!
@@ -31,6 +31,8 @@ class Ui_biacv_mainwindow(object):
         self.title.setObjectName(_fromUtf8("title"))
         self.gridLayout_2.addWidget(self.title, 0, 1, 1, 1)
         self.pages = QtGui.QTabWidget(self.centralwidget)
+        self.pages.setTabShape(QtGui.QTabWidget.Rounded)
+        self.pages.setDocumentMode(True)
         self.pages.setObjectName(_fromUtf8("pages"))
         self.tab = QtGui.QWidget()
         self.tab.setObjectName(_fromUtf8("tab"))
@@ -292,9 +294,9 @@ class Ui_biacv_mainwindow(object):
         self.label_28.setText(QtGui.QApplication.translate("biacv_mainwindow", "Designation/title", None, QtGui.QApplication.UnicodeUTF8))
         self.label_28.setObjectName(_fromUtf8("label_28"))
         self.gridLayout_4.addWidget(self.label_28, 0, 0, 1, 1)
-        self.positions = QtGui.QLineEdit(self.tab_3)
-        self.positions.setObjectName(_fromUtf8("positions"))
-        self.gridLayout_4.addWidget(self.positions, 0, 1, 1, 4)
+        self.designation = QtGui.QLineEdit(self.tab_3)
+        self.designation.setObjectName(_fromUtf8("designation"))
+        self.gridLayout_4.addWidget(self.designation, 0, 1, 1, 4)
         self.label_26 = QtGui.QLabel(self.tab_3)
         self.label_26.setText(QtGui.QApplication.translate("biacv_mainwindow", "Date of joining post", None, QtGui.QApplication.UnicodeUTF8))
         self.label_26.setObjectName(_fromUtf8("label_26"))
@@ -314,10 +316,10 @@ class Ui_biacv_mainwindow(object):
         self.leavedate.setCalendarPopup(True)
         self.leavedate.setObjectName(_fromUtf8("leavedate"))
         self.gridLayout_4.addWidget(self.leavedate, 2, 1, 1, 1)
-        self.checkBox = QtGui.QCheckBox(self.tab_3)
-        self.checkBox.setText(QtGui.QApplication.translate("biacv_mainwindow", "Current employment", None, QtGui.QApplication.UnicodeUTF8))
-        self.checkBox.setObjectName(_fromUtf8("checkBox"))
-        self.gridLayout_4.addWidget(self.checkBox, 2, 2, 1, 2)
+        self.currentemployment = QtGui.QCheckBox(self.tab_3)
+        self.currentemployment.setText(QtGui.QApplication.translate("biacv_mainwindow", "Current employment", None, QtGui.QApplication.UnicodeUTF8))
+        self.currentemployment.setObjectName(_fromUtf8("currentemployment"))
+        self.gridLayout_4.addWidget(self.currentemployment, 2, 2, 1, 2)
         self.label_25 = QtGui.QLabel(self.tab_3)
         self.label_25.setText(QtGui.QApplication.translate("biacv_mainwindow", "Organization name", None, QtGui.QApplication.UnicodeUTF8))
         self.label_25.setObjectName(_fromUtf8("label_25"))
@@ -344,10 +346,39 @@ class Ui_biacv_mainwindow(object):
         self.deletehistory.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8))
         self.deletehistory.setObjectName(_fromUtf8("deletehistory"))
         self.gridLayout_4.addWidget(self.deletehistory, 5, 4, 1, 1)
-        self.historylist = QtGui.QColumnView(self.tab_3)
-        self.historylist.setObjectName(_fromUtf8("historylist"))
-        self.gridLayout_4.addWidget(self.historylist, 6, 0, 1, 5)
+        self.professionlist = QtGui.QTreeWidget(self.tab_3)
+        self.professionlist.setAlternatingRowColors(True)
+        self.professionlist.setRootIsDecorated(False)
+        self.professionlist.setUniformRowHeights(True)
+        self.professionlist.setObjectName(_fromUtf8("professionlist"))
+        self.professionlist.headerItem().setText(0, QtGui.QApplication.translate("biacv_mainwindow", "Job title", None, QtGui.QApplication.UnicodeUTF8))
+        self.professionlist.headerItem().setText(1, QtGui.QApplication.translate("biacv_mainwindow", "Date of joining", None, QtGui.QApplication.UnicodeUTF8))
+        self.professionlist.headerItem().setText(2, QtGui.QApplication.translate("biacv_mainwindow", "Date of leaving", None, QtGui.QApplication.UnicodeUTF8))
+        self.professionlist.headerItem().setText(3, QtGui.QApplication.translate("biacv_mainwindow", "Organization", None, QtGui.QApplication.UnicodeUTF8))
+        self.professionlist.headerItem().setText(4, QtGui.QApplication.translate("biacv_mainwindow", "Additional info", None, QtGui.QApplication.UnicodeUTF8))
+        self.gridLayout_4.addWidget(self.professionlist, 6, 0, 1, 5)
         self.pages.addTab(self.tab_3, _fromUtf8(""))
+        self.tab_6 = QtGui.QWidget()
+        self.tab_6.setObjectName(_fromUtf8("tab_6"))
+        self.gridLayout_8 = QtGui.QGridLayout(self.tab_6)
+        self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8"))
+        self.label_35 = QtGui.QLabel(self.tab_6)
+        self.label_35.setText(QtGui.QApplication.translate("biacv_mainwindow", "Short term career objectives (one per line)", None, QtGui.QApplication.UnicodeUTF8))
+        self.label_35.setObjectName(_fromUtf8("label_35"))
+        self.gridLayout_8.addWidget(self.label_35, 0, 0, 1, 1)
+        self.shorttermcareer = QtGui.QPlainTextEdit(self.tab_6)
+        self.shorttermcareer.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
+        self.shorttermcareer.setObjectName(_fromUtf8("shorttermcareer"))
+        self.gridLayout_8.addWidget(self.shorttermcareer, 1, 0, 1, 1)
+        self.label_36 = QtGui.QLabel(self.tab_6)
+        self.label_36.setText(QtGui.QApplication.translate("biacv_mainwindow", "Long term career goals (one per line)", None, QtGui.QApplication.UnicodeUTF8))
+        self.label_36.setObjectName(_fromUtf8("label_36"))
+        self.gridLayout_8.addWidget(self.label_36, 2, 0, 1, 1)
+        self.longtermgoals = QtGui.QPlainTextEdit(self.tab_6)
+        self.longtermgoals.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
+        self.longtermgoals.setObjectName(_fromUtf8("longtermgoals"))
+        self.gridLayout_8.addWidget(self.longtermgoals, 3, 0, 1, 1)
+        self.pages.addTab(self.tab_6, _fromUtf8(""))
         self.tab_4 = QtGui.QWidget()
         self.tab_4.setObjectName(_fromUtf8("tab_4"))
         self.gridLayout_5 = QtGui.QGridLayout(self.tab_4)
@@ -510,18 +541,21 @@ class Ui_biacv_mainwindow(object):
         self.menubar.addAction(self.menu_Help.menuAction())
 
         self.retranslateUi(biacv_mainwindow)
-        self.pages.setCurrentIndex(1)
+        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.QObject.connect(self.educationlist, QtCore.SIGNAL(_fromUtf8("itemSelectionChanged()")), biacv_mainwindow.on_select_education)
         QtCore.QObject.connect(self.updateeducation, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_update_education)
         QtCore.QObject.connect(self.educationlist, QtCore.SIGNAL(_fromUtf8("activated(QModelIndex)")), biacv_mainwindow.on_select_education)
+        QtCore.QObject.connect(self.currentemployment, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), biacv_mainwindow.on_change_currentemployment)
+        QtCore.QObject.connect(self.addhistory, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_add_profession)
         QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow)
 
     def retranslateUi(self, biacv_mainwindow):
         self.pages.setTabText(self.pages.indexOf(self.tab), QtGui.QApplication.translate("biacv_mainwindow", "Personal information", None, QtGui.QApplication.UnicodeUTF8))
         self.pages.setTabText(self.pages.indexOf(self.tab_2), QtGui.QApplication.translate("biacv_mainwindow", "Educational Qualifications", None, QtGui.QApplication.UnicodeUTF8))
         self.pages.setTabText(self.pages.indexOf(self.tab_3), QtGui.QApplication.translate("biacv_mainwindow", "Professional History", None, QtGui.QApplication.UnicodeUTF8))
+        self.pages.setTabText(self.pages.indexOf(self.tab_6), QtGui.QApplication.translate("biacv_mainwindow", "Career objectives", None, QtGui.QApplication.UnicodeUTF8))
         self.pages.setTabText(self.pages.indexOf(self.tab_4), QtGui.QApplication.translate("biacv_mainwindow", "Skill sets", None, QtGui.QApplication.UnicodeUTF8))
         self.pages.setTabText(self.pages.indexOf(self.tab_5), QtGui.QApplication.translate("biacv_mainwindow", "Additional information", None, QtGui.QApplication.UnicodeUTF8))