Added "country" field to personal information tab
authorHarishankar <v.harishankar@gmail.com>
Wed, 7 Dec 2011 11:18:47 +0000 (16:48 +0530)
committerHarishankar <v.harishankar@gmail.com>
Wed, 7 Dec 2011 11:18:47 +0000 (16:48 +0530)
Added the country field to the personal information tab for
residential address

biacv
biacv_data.py
biacv_exporter.py
biacv_mainwindow.py
biacv_mainwindow.ui
biacv_mainwindow_ui.py
templates/default_xhtml/main.tpl

diff --git a/biacv b/biacv
index 4463fc2..6ce0c28 100755 (executable)
--- a/biacv
+++ b/biacv
@@ -9,7 +9,6 @@ import biacv_mainwindow
 def main ():
        app = PyQt4.QtGui.QApplication (sys.argv)
        wnd = biacv_mainwindow.Biacv_mainwindow ()
-       wnd.show ()
        sys.exit (app.exec_ ())
 
 # run the application
index 1146102..3fc5830 100644 (file)
@@ -22,7 +22,7 @@ class BiaCVData:
 
        # set personal information from gui
        def set_personal_info (self, nametitle, firstname, lastname, dateofbirth,
-                       street, area, city, areacode, countrycode_landline, landline,
+                       street, area, city, areacode, country, countrycode_landline, landline,
                        countrycode_mobile, mobile, email, maritalstatus):
                self.data["nametitle"] = nametitle
                self.data["firstname"] = firstname
@@ -32,6 +32,7 @@ class BiaCVData:
                self.data["area"] = area
                self.data["city"] = city
                self.data["areacode"] = areacode
+               self.data["country"] = country
                self.data["countrycode_landline"] = countrycode_landline
                self.data["landline"] = landline
                self.data["countrycode_mobile"] = countrycode_mobile
index 795deac..d027e71 100644 (file)
@@ -73,6 +73,7 @@ class BiaCVExporter:
                                                        area = self.data["area"],
                                                        city = self.data["city"],
                                                        areacode = self.data["areacode"],
+                                                       country = self.data["country"],
                                                        countrycode_landline = self.data["countrycode_landline"],
                                                        landline = self.data["landline"],
                                                        countrycode_mobile = self.data["countrycode_mobile"],
index 0ceebde..09bf77d 100644 (file)
@@ -12,6 +12,7 @@ import biacv_exporter as exporter
 class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
        def __init__ (self):
                PyQt4.QtGui.QMainWindow.__init__ (self)
+               self.show ()
                self.setupUi (self)
                self.currentfile = None
                self.ismodified = False
@@ -173,6 +174,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                                unicode (self.area.text ().toUtf8 (), "utf-8"),
                                unicode (self.city.text ().toUtf8 (), "utf-8"),
                                unicode (self.areacode.text ().toUtf8 (), "utf-8"),
+                               unicode (self.country.text ().toUtf8 (), "utf-8"),
                                unicode (self.countrycode_landline.text ().toUtf8 (), "utf-8"),
                                unicode (self.telephone.text ().toUtf8 (), "utf-8"),
                                unicode (self.countrycode_mobile.text ().toUtf8 (), "utf-8"),
@@ -285,6 +287,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                self.mobilenumber.setText (docdata.data["mobile"])
                self.email.setText (docdata.data["email"])
                self.areacode.setText (docdata.data["areacode"])
+               self.country.setText (docdata.data["country"])
+
                if docdata.data["maritalstatus"] is True:
                        self.married.setChecked (True)
                elif docdata.data["maritalstatus"] is False:
index 8f20bf2..6ddaa9a 100644 (file)
@@ -51,7 +51,7 @@
         <string>Personal information</string>
        </attribute>
        <layout class="QGridLayout" name="gridLayout">
-        <item row="0" column="4" colspan="3">
+        <item row="0" column="4">
          <widget class="QLabel" name="label_13">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -64,7 +64,7 @@
           </property>
          </widget>
         </item>
-        <item row="0" column="8" colspan="4">
+        <item row="0" column="8" colspan="2">
          <widget class="QLabel" name="label_14">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -77,7 +77,7 @@
           </property>
          </widget>
         </item>
-        <item row="1" column="0" colspan="2">
+        <item row="1" column="0">
          <widget class="QLabel" name="label_2">
           <property name="text">
            <string>Title</string>
           </item>
          </widget>
         </item>
-        <item row="1" column="4" colspan="3">
+        <item row="1" column="4" colspan="2">
          <widget class="QLineEdit" name="firstname">
           <property name="text">
            <string/>
           </property>
          </widget>
         </item>
-        <item row="2" column="0" colspan="3">
+        <item row="2" column="0" colspan="2">
          <widget class="QLabel" name="label_3">
           <property name="text">
            <string>Date of birth</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="3" colspan="3">
+        <item row="2" column="3" colspan="2">
          <widget class="QDateEdit" name="dateofbirth">
           <property name="date">
            <date>
           </property>
          </widget>
         </item>
-        <item row="4" column="1" colspan="5">
+        <item row="4" column="1" colspan="4">
          <widget class="QLineEdit" name="street"/>
         </item>
-        <item row="4" column="6">
+        <item row="4" column="5">
          <widget class="QLabel" name="label_5">
           <property name="text">
            <string>Landline</string>
           </property>
          </widget>
         </item>
-        <item row="5" column="1" colspan="5">
+        <item row="5" column="1" colspan="4">
          <widget class="QLineEdit" name="area"/>
         </item>
-        <item row="5" column="6" colspan="2">
+        <item row="5" column="5" colspan="3">
          <widget class="QLabel" name="label_7">
           <property name="text">
            <string>Mobile number</string>
           </property>
          </widget>
         </item>
-        <item row="6" column="1" colspan="5">
+        <item row="6" column="1" colspan="4">
          <widget class="QLineEdit" name="city"/>
         </item>
-        <item row="6" column="6">
+        <item row="6" column="5">
          <widget class="QLabel" name="label_11">
           <property name="text">
            <string>E-mail ID</string>
           </property>
          </widget>
         </item>
-        <item row="6" column="7" colspan="5">
+        <item row="6" column="6" colspan="6">
          <widget class="QLineEdit" name="email"/>
         </item>
         <item row="7" column="0">
           </property>
          </widget>
         </item>
-        <item row="7" column="1" colspan="5">
+        <item row="7" column="1" colspan="4">
          <widget class="QLineEdit" name="areacode"/>
         </item>
+        <item row="7" column="5" colspan="2">
+         <widget class="QLabel" name="label_37">
+          <property name="text">
+           <string>Country</string>
+          </property>
+         </widget>
+        </item>
+        <item row="7" column="7" colspan="5">
+         <widget class="QLineEdit" name="country"/>
+        </item>
         <item row="8" column="0" colspan="3">
          <widget class="QLabel" name="label_12">
           <property name="text">
           </property>
          </widget>
         </item>
-        <item row="8" column="5" colspan="2">
+        <item row="8" column="5">
          <widget class="QRadioButton" name="unspecified">
           <property name="text">
            <string>Unspecified</string>
    <property name="text">
     <string>&amp;Export...</string>
    </property>
+   <property name="statusTip">
+    <string>Export the current document using templates to other formats</string>
+   </property>
   </action>
  </widget>
  <resources>
    <slot>on_document_modified()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>282</x>
+     <x>243</x>
      <y>197</y>
     </hint>
     <hint type="destinationlabel">
    <slot>on_document_modified()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>461</x>
+     <x>433</x>
      <y>275</y>
     </hint>
     <hint type="destinationlabel">
    <slot>on_document_modified()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>265</x>
+     <x>243</x>
      <y>318</y>
     </hint>
     <hint type="destinationlabel">
    <slot>on_document_modified()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>461</x>
+     <x>433</x>
      <y>318</y>
     </hint>
     <hint type="destinationlabel">
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>country</sender>
+   <signal>textChanged(QString)</signal>
+   <receiver>biacv_mainwindow</receiver>
+   <slot>on_document_modified()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>527</x>
+     <y>393</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>457</x>
+     <y>-7</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>on_add_education()</slot>
index b0dbee9..d2cc9c8 100644 (file)
@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'biacv_mainwindow.ui'
 #
-# Created: Tue Dec  6 18:21:16 2011
+# Created: Wed Dec  7 16:47:43 2011
 #      by: PyQt4 UI code generator 4.8.6
 #
 # WARNING! All changes made in this file will be lost!
@@ -51,7 +51,7 @@ class Ui_biacv_mainwindow(object):
         self.label_13.setSizePolicy(sizePolicy)
         self.label_13.setText(QtGui.QApplication.translate("biacv_mainwindow", "First name", None, QtGui.QApplication.UnicodeUTF8))
         self.label_13.setObjectName(_fromUtf8("label_13"))
-        self.gridLayout.addWidget(self.label_13, 0, 4, 1, 3)
+        self.gridLayout.addWidget(self.label_13, 0, 4, 1, 1)
         self.label_14 = QtGui.QLabel(self.tab)
         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
@@ -60,11 +60,11 @@ class Ui_biacv_mainwindow(object):
         self.label_14.setSizePolicy(sizePolicy)
         self.label_14.setText(QtGui.QApplication.translate("biacv_mainwindow", "Last name", None, QtGui.QApplication.UnicodeUTF8))
         self.label_14.setObjectName(_fromUtf8("label_14"))
-        self.gridLayout.addWidget(self.label_14, 0, 8, 1, 4)
+        self.gridLayout.addWidget(self.label_14, 0, 8, 1, 2)
         self.label_2 = QtGui.QLabel(self.tab)
         self.label_2.setText(QtGui.QApplication.translate("biacv_mainwindow", "Title", None, QtGui.QApplication.UnicodeUTF8))
         self.label_2.setObjectName(_fromUtf8("label_2"))
-        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 2)
+        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
         self.nametitle = QtGui.QComboBox(self.tab)
         self.nametitle.setEditable(True)
         self.nametitle.setObjectName(_fromUtf8("nametitle"))
@@ -82,7 +82,7 @@ class Ui_biacv_mainwindow(object):
         self.firstname = QtGui.QLineEdit(self.tab)
         self.firstname.setText(_fromUtf8(""))
         self.firstname.setObjectName(_fromUtf8("firstname"))
-        self.gridLayout.addWidget(self.firstname, 1, 4, 1, 3)
+        self.gridLayout.addWidget(self.firstname, 1, 4, 1, 2)
         self.lastname = QtGui.QLineEdit(self.tab)
         self.lastname.setText(_fromUtf8(""))
         self.lastname.setObjectName(_fromUtf8("lastname"))
@@ -90,13 +90,13 @@ class Ui_biacv_mainwindow(object):
         self.label_3 = QtGui.QLabel(self.tab)
         self.label_3.setText(QtGui.QApplication.translate("biacv_mainwindow", "Date of birth", None, QtGui.QApplication.UnicodeUTF8))
         self.label_3.setObjectName(_fromUtf8("label_3"))
-        self.gridLayout.addWidget(self.label_3, 2, 0, 1, 3)
+        self.gridLayout.addWidget(self.label_3, 2, 0, 1, 2)
         self.dateofbirth = QtGui.QDateEdit(self.tab)
         self.dateofbirth.setDate(QtCore.QDate(1970, 1, 1))
         self.dateofbirth.setDisplayFormat(QtGui.QApplication.translate("biacv_mainwindow", "dd MMM, yyyy", None, QtGui.QApplication.UnicodeUTF8))
         self.dateofbirth.setCalendarPopup(True)
         self.dateofbirth.setObjectName(_fromUtf8("dateofbirth"))
-        self.gridLayout.addWidget(self.dateofbirth, 2, 3, 1, 3)
+        self.gridLayout.addWidget(self.dateofbirth, 2, 3, 1, 2)
         self.label_4 = QtGui.QLabel(self.tab)
         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
@@ -112,11 +112,11 @@ class Ui_biacv_mainwindow(object):
         self.gridLayout.addWidget(self.label_15, 4, 0, 1, 1)
         self.street = QtGui.QLineEdit(self.tab)
         self.street.setObjectName(_fromUtf8("street"))
-        self.gridLayout.addWidget(self.street, 4, 1, 1, 5)
+        self.gridLayout.addWidget(self.street, 4, 1, 1, 4)
         self.label_5 = QtGui.QLabel(self.tab)
         self.label_5.setText(QtGui.QApplication.translate("biacv_mainwindow", "Landline", None, QtGui.QApplication.UnicodeUTF8))
         self.label_5.setObjectName(_fromUtf8("label_5"))
-        self.gridLayout.addWidget(self.label_5, 4, 6, 1, 1)
+        self.gridLayout.addWidget(self.label_5, 4, 5, 1, 1)
         self.label_10 = QtGui.QLabel(self.tab)
         self.label_10.setText(QtGui.QApplication.translate("biacv_mainwindow", "+", None, QtGui.QApplication.UnicodeUTF8))
         self.label_10.setObjectName(_fromUtf8("label_10"))
@@ -144,11 +144,11 @@ class Ui_biacv_mainwindow(object):
         self.gridLayout.addWidget(self.label_16, 5, 0, 1, 1)
         self.area = QtGui.QLineEdit(self.tab)
         self.area.setObjectName(_fromUtf8("area"))
-        self.gridLayout.addWidget(self.area, 5, 1, 1, 5)
+        self.gridLayout.addWidget(self.area, 5, 1, 1, 4)
         self.label_7 = QtGui.QLabel(self.tab)
         self.label_7.setText(QtGui.QApplication.translate("biacv_mainwindow", "Mobile number", None, QtGui.QApplication.UnicodeUTF8))
         self.label_7.setObjectName(_fromUtf8("label_7"))
-        self.gridLayout.addWidget(self.label_7, 5, 6, 1, 2)
+        self.gridLayout.addWidget(self.label_7, 5, 5, 1, 3)
         self.label_8 = QtGui.QLabel(self.tab)
         self.label_8.setText(QtGui.QApplication.translate("biacv_mainwindow", "+", None, QtGui.QApplication.UnicodeUTF8))
         self.label_8.setObjectName(_fromUtf8("label_8"))
@@ -176,21 +176,28 @@ class Ui_biacv_mainwindow(object):
         self.gridLayout.addWidget(self.label_17, 6, 0, 1, 1)
         self.city = QtGui.QLineEdit(self.tab)
         self.city.setObjectName(_fromUtf8("city"))
-        self.gridLayout.addWidget(self.city, 6, 1, 1, 5)
+        self.gridLayout.addWidget(self.city, 6, 1, 1, 4)
         self.label_11 = QtGui.QLabel(self.tab)
         self.label_11.setText(QtGui.QApplication.translate("biacv_mainwindow", "E-mail ID", None, QtGui.QApplication.UnicodeUTF8))
         self.label_11.setObjectName(_fromUtf8("label_11"))
-        self.gridLayout.addWidget(self.label_11, 6, 6, 1, 1)
+        self.gridLayout.addWidget(self.label_11, 6, 5, 1, 1)
         self.email = QtGui.QLineEdit(self.tab)
         self.email.setObjectName(_fromUtf8("email"))
-        self.gridLayout.addWidget(self.email, 6, 7, 1, 5)
+        self.gridLayout.addWidget(self.email, 6, 6, 1, 6)
         self.label_18 = QtGui.QLabel(self.tab)
         self.label_18.setText(QtGui.QApplication.translate("biacv_mainwindow", "Areacode", None, QtGui.QApplication.UnicodeUTF8))
         self.label_18.setObjectName(_fromUtf8("label_18"))
         self.gridLayout.addWidget(self.label_18, 7, 0, 1, 1)
         self.areacode = QtGui.QLineEdit(self.tab)
         self.areacode.setObjectName(_fromUtf8("areacode"))
-        self.gridLayout.addWidget(self.areacode, 7, 1, 1, 5)
+        self.gridLayout.addWidget(self.areacode, 7, 1, 1, 4)
+        self.label_37 = QtGui.QLabel(self.tab)
+        self.label_37.setText(QtGui.QApplication.translate("biacv_mainwindow", "Country", None, QtGui.QApplication.UnicodeUTF8))
+        self.label_37.setObjectName(_fromUtf8("label_37"))
+        self.gridLayout.addWidget(self.label_37, 7, 5, 1, 2)
+        self.country = QtGui.QLineEdit(self.tab)
+        self.country.setObjectName(_fromUtf8("country"))
+        self.gridLayout.addWidget(self.country, 7, 7, 1, 5)
         self.label_12 = QtGui.QLabel(self.tab)
         self.label_12.setText(QtGui.QApplication.translate("biacv_mainwindow", "Marital status", None, QtGui.QApplication.UnicodeUTF8))
         self.label_12.setObjectName(_fromUtf8("label_12"))
@@ -207,7 +214,7 @@ class Ui_biacv_mainwindow(object):
         self.unspecified.setText(QtGui.QApplication.translate("biacv_mainwindow", "Unspecified", None, QtGui.QApplication.UnicodeUTF8))
         self.unspecified.setChecked(True)
         self.unspecified.setObjectName(_fromUtf8("unspecified"))
-        self.gridLayout.addWidget(self.unspecified, 8, 5, 1, 2)
+        self.gridLayout.addWidget(self.unspecified, 8, 5, 1, 1)
         self.pages.addTab(self.tab, _fromUtf8(""))
         self.tab_2 = QtGui.QWidget()
         self.tab_2.setObjectName(_fromUtf8("tab_2"))
@@ -550,6 +557,7 @@ class Ui_biacv_mainwindow(object):
         self.action_About.setObjectName(_fromUtf8("action_About"))
         self.action_Export = QtGui.QAction(biacv_mainwindow)
         self.action_Export.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Export...", None, QtGui.QApplication.UnicodeUTF8))
+        self.action_Export.setStatusTip(QtGui.QApplication.translate("biacv_mainwindow", "Export the current document using templates to other formats", None, QtGui.QApplication.UnicodeUTF8))
         self.action_Export.setObjectName(_fromUtf8("action_Export"))
         self.menu_File.addAction(self.action_New)
         self.menu_File.addAction(self.action_Open)
@@ -613,6 +621,7 @@ class Ui_biacv_mainwindow(object):
         QtCore.QObject.connect(self.actionE_xit, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_exit)
         QtCore.QObject.connect(self.action_About, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_help_about)
         QtCore.QObject.connect(self.action_Export, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_file_export)
+        QtCore.QObject.connect(self.country, QtCore.SIGNAL(_fromUtf8("textChanged(QString)")), biacv_mainwindow.on_document_modified)
         QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow)
 
     def retranslateUi(self, biacv_mainwindow):
index 035f73a..75fac62 100644 (file)
@@ -85,7 +85,7 @@
        <table class="contact">
                <tr>
                        <td><b>Residential address</b></td>
-                       <td>${street}, <br />${area},<br /><b>${city} - ${areacode}</b></td>
+                       <td>${street}, <br />${area},<br />${city} - ${areacode}<br /><b>${country}</b></td>
                </tr>
                <tr>
                        <td><b>Landline</b></td>