def onSelectTemplate(self): """ Slot raised to load the template selector dialog. """ current_config = self.current_config() if current_config is None: msg = QApplication.translate( 'DocumentGeneratorDialog', 'An error occured while trying to determine the data source ' 'for the current entity.\nPlease check your current profile ' 'settings.') QMessageBox.critical( self, QApplication.translate('DocumentGeneratorDialog', 'Template Selector'), msg) return # Set the template selector to only load those templates that # reference the current data source. filter_table = current_config.data_source() templateSelector = TemplateDocumentSelector( self, filter_data_source=filter_table, access_templates=self.access_templates) if templateSelector.exec_() == QDialog.Accepted: docName, docPath = templateSelector.documentMapping() self.lblTemplateName.setText(docName) self._docTemplatePath = docPath if filter_table != self.last_data_source: # Load template data source fields self._load_template_datasource_fields()
def on_action_triggered(self, state): """ Load template document selector dialog then process selection. """ docSelector = TemplateDocumentSelector(self.composerView()) if docSelector.exec_() == QDialog.Accepted: docName, file_path = docSelector.documentMapping() self.composerWrapper().create_new_document_designer(file_path)
def on_action_triggered(self, state): """ Show dialog for managing document templates. """ docManager = TemplateDocumentSelector(self.composerView(),False) docManager.exec_()
def on_action_triggered(self, state): """ Show dialog for managing document templates. """ docManager = TemplateDocumentSelector(self.composerView(), False) docManager.exec_()