X-Git-Url: https://harishankar.org/repos/?p=biacv.git;a=blobdiff_plain;f=biacv_mainwindow.py;h=ec74b822d540923ec1c166ea89652a835cd82cca;hp=72c6bc344455fdbbb8dadd9168cd77b381e40b82;hb=HEAD;hpb=db696bd1b54b7daf56d6d3d3049e8a35394536aa diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 72c6bc3..ec74b82 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -45,13 +45,6 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): 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 () @@ -61,6 +54,14 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): # set the template directory exp.set_template_directory (unicode (templatedir.toUtf8(), "utf-8")) + # get the output file path + outputfile = PyQt4.QtGui.QFileDialog.getSaveFileName (self, + exp.exporter_name, filter=exp.export_filter) + + if outputfile == "": + return + + # set the output file exp.set_output (unicode (outputfile.toUtf8(), "utf-8")) @@ -78,7 +79,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): return # open file dialog - openfilename = PyQt4.QtGui.QFileDialog.getOpenFileName (self, lang.OPEN_TITLE) + openfilename = PyQt4.QtGui.QFileDialog.getOpenFileName (self, lang.OPEN_TITLE, + filter = lang.BIACV_FILE_FILTER) # if no open file name then return if openfilename == "": return @@ -121,7 +123,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): # function to save a file as a new document def on_file_save_as (self): savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self, - lang.SAVE_TITLE) + lang.SAVE_TITLE, filter=lang.BIACV_FILE_FILTER) # if save file name is not none if savefilename <> "": @@ -140,7 +142,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): # if no current file get file name from file save dialog if self.currentfile is None: savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self, - lang.SAVE_TITLE) + lang.SAVE_TITLE, filter=lang.BIACV_FILE_FILTER) if savefilename <> "": mydata = self.get_document_data () @@ -187,7 +189,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): ) # set the profile highlights - profile_highlights = unicode (self.profile.toPlainText ().toUtf8 ()).splitlines () + profile_highlights = unicode (self.profile.toPlainText ().toUtf8 (), "utf-8").splitlines () docdata.set_profile (profile_highlights) # get the list of educational qualifications from the treewidget