def _open(self): """ Open an understanding questionnaire (xml file), get the questions that are inside the file and set them in the questionnaire """ if not self._questionnaire.isempty(): confirm = QtGui.QMessageBox.question( self, qctrans(u"Confirmation"), qctrans(u"An understanding questionnaire is loaded. Do you " u"really want to close it and open a new one?"), QtGui.QMessageBox.No | QtGui.QMessageBox.Yes) if confirm != QtGui.QMessageBox.Yes: return xmlfile = str(QtGui.QFileDialog.getOpenFileName( self, qctrans(u"Select the understanding questionnaire"), "", qctrans(u"xml file (*.xml)"))) if not xmlfile: return self._questionnaire.file = xmlfile questions = questcompmod.get_questions(xmlfile) self._questionnaire.set_questions(questions)
def _open(self): """ Open an understanding questionnaire (xml file), get the questions that are inside the file and set them in the questionnaire """ if not self._questionnaire.isempty(): confirm = QtGui.QMessageBox.question( self, qctrans(u"Confirmation"), qctrans(u"An understanding questionnaire is loaded. Do you " u"really want to close it and open a new one?"), QtGui.QMessageBox.No | QtGui.QMessageBox.Yes) if confirm != QtGui.QMessageBox.Yes: return xmlfile = str( QtGui.QFileDialog.getOpenFileName( self, qctrans(u"Select the understanding questionnaire"), "", qctrans(u"xml file (*.xml)"))) if not xmlfile: return self._questionnaire.file = xmlfile questions = questcompmod.get_questions(xmlfile) self._questionnaire.set_questions(questions)
def get_questions(xmlfile): return questcompmod.get_questions(xmlfile)