+ self.setWindowTitle ("BiaCV - untitled")
+
+ # function to open a file
+ def on_file_open (self):
+ # if modified, confirm
+ if self.ismodified is True:
+ ans = PyQt4.QtGui.QMessageBox.question (self, lang.CONFIRM, lang.CONFIRM_DISCARD_SAVE,
+ PyQt4.QtGui.QMessageBox.Yes, PyQt4.QtGui.QMessageBox.No)
+ # if no, then don't open the file
+ if ans <> PyQt4.QtGui.QMessageBox.Yes:
+ return
+
+ # open file dialog
+ openfilename = PyQt4.QtGui.QFileDialog.getOpenFileName (self, lang.OPEN_TITLE)
+ # if no open file name then return
+ if openfilename == "":
+ return
+
+ # load the document data from open file name
+ docdata = data.BiaCVData ()
+ docdata.load_data (openfilename)
+
+ # set the title
+ self.title.setText (docdata.data["title"])
+
+ # set the personal information fields from document data
+ self.set_personal_info (docdata)
+
+ # set the educational qualifications
+ self.set_educational_qualifications (docdata)
+
+ # set the professional history
+ self.set_professional_history (docdata)
+
+ # set the career objectives
+ self.set_career_objectives (docdata)
+
+ # set the skills list
+ self.set_skillsets_info (docdata)
+
+ # set the additional information
+ self.set_additional_info (docdata)
+
+ # set the current document
+ self.currentfile = openfilename
+ self.ismodified = False
+
+ # set the window title
+ self.setWindowTitle ("BiaCV - " + self.currentfile)