From 237038b36066dc8897b489d3d85cea1116a3a7e8 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Wed, 7 Dec 2011 16:48:47 +0530 Subject: [PATCH] Added "country" field to personal information tab Added the country field to the personal information tab for residential address --- biacv | 1 - biacv_data.py | 3 +- biacv_exporter.py | 1 + biacv_mainwindow.py | 4 ++ biacv_mainwindow.ui | 67 +++++++++++++++++++++++--------- biacv_mainwindow_ui.py | 41 +++++++++++-------- templates/default_xhtml/main.tpl | 2 +- 7 files changed, 81 insertions(+), 38 deletions(-) diff --git a/biacv b/biacv index 4463fc2..6ce0c28 100755 --- 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 diff --git a/biacv_data.py b/biacv_data.py index 1146102..3fc5830 100644 --- a/biacv_data.py +++ b/biacv_data.py @@ -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 diff --git a/biacv_exporter.py b/biacv_exporter.py index 795deac..d027e71 100644 --- a/biacv_exporter.py +++ b/biacv_exporter.py @@ -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"], diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 0ceebde..09bf77d 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -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: diff --git a/biacv_mainwindow.ui b/biacv_mainwindow.ui index 8f20bf2..6ddaa9a 100644 --- a/biacv_mainwindow.ui +++ b/biacv_mainwindow.ui @@ -51,7 +51,7 @@ Personal information - + @@ -64,7 +64,7 @@ - + @@ -77,7 +77,7 @@ - + Title @@ -116,7 +116,7 @@ - + @@ -130,14 +130,14 @@ - + Date of birth - + @@ -174,10 +174,10 @@ - + - + Landline @@ -230,10 +230,10 @@ - + - + Mobile number @@ -286,17 +286,17 @@ - + - + E-mail ID - + @@ -306,9 +306,19 @@ - + + + + + Country + + + + + + @@ -330,7 +340,7 @@ - + Unspecified @@ -1013,6 +1023,9 @@ &Export... + + Export the current document using templates to other formats + @@ -1426,7 +1439,7 @@ on_document_modified() - 282 + 243 197 @@ -1458,7 +1471,7 @@ on_document_modified() - 461 + 433 275 @@ -1490,7 +1503,7 @@ on_document_modified() - 265 + 243 318 @@ -1506,7 +1519,7 @@ on_document_modified() - 461 + 433 318 @@ -1787,6 +1800,22 @@ + + country + textChanged(QString) + biacv_mainwindow + on_document_modified() + + + 527 + 393 + + + 457 + -7 + + + on_add_education() diff --git a/biacv_mainwindow_ui.py b/biacv_mainwindow_ui.py index b0dbee9..d2cc9c8 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: 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): diff --git a/templates/default_xhtml/main.tpl b/templates/default_xhtml/main.tpl index 035f73a..75fac62 100644 --- a/templates/default_xhtml/main.tpl +++ b/templates/default_xhtml/main.tpl @@ -85,7 +85,7 @@ - + -- 2.20.1
Residential address${street},
${area},
${city} - ${areacode}
${street},
${area},
${city} - ${areacode}
${country}
Landline