import biacv_mainwindow_ui as bui
import biacv_lang as lang
import biacv_data as data
+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
# on file export - export current document to any external format based on
# a template
def on_file_export (self):
- pass
+ # get the template directory
+ templatedir = PyQt4.QtGui.QFileDialog.getExistingDirectory (self,
+ lang.OPEN_TEMPLATE_TITLE)
+ if templatedir == "":
+ return
+
+ # get the output file path
+ outputfile = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
+ lang.EXPORT_TITLE)
+
+ if outputfile == "":
+ return
+
+ # create a new exporter object
+ exp = exporter.BiaCVExporter ()
+
+ # set the document data
+ exp.set_data (self.get_document_data ().data)
+
+ # set the template directory
+ exp.set_template_directory (unicode (templatedir.toUtf8(), "utf-8"))
+
+ # set the output file
+ exp.set_output (unicode (outputfile.toUtf8(), "utf-8"))
+
+ # carry out the export function
+ exp.export ()
# function to open a file
def on_file_open (self):
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"),
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: