def __init__(self, component_manager): ExportDialog.__init__(self, component_manager) QtGui.QDialog.__init__(self, self.main_widget()) self.setupUi(self) # File formats. i = 0 current_index = None for format in self.component_manager.all("file_format"): if not format.export_possible: continue self.file_formats.addItem(_(format.description)) if str(type(format)) == self.config()["export_format"]: current_index = i i += 1 if current_index is not None: self.file_formats.setCurrentIndex(current_index)
def activate(self): ExportDialog.activate(self) self.exec_()