def editTemplate(self, tmpl): if self.tmpl_editor: self.tmpl_editor.reject() self.tmpl_editor.deleteLater() self.tmpl_editor = TemplateEditorDialog(tmpl) self.tmpl_editor.createdTemplate.connect(self.makeTmpl) self.tmpl_editor.editedTemplate.connect(self.editTmpl) self.tmpl_editor.show() self.tmpl_editor.raise_()