--- a/eric7/Templates/TemplateViewer.py Sat May 22 17:01:51 2021 +0200 +++ b/eric7/Templates/TemplateViewer.py Sat May 22 18:51:46 2021 +0200 @@ -16,8 +16,8 @@ QTreeWidget, QDialog, QApplication, QMenu, QTreeWidgetItem ) -from E5Gui.E5Application import e5App -from E5Gui import E5MessageBox, E5FileDialog +from E5Gui.EricApplication import ericApp +from E5Gui import EricMessageBox, EricFileDialog import Preferences @@ -94,7 +94,7 @@ """ if name in self.entries: if not quiet: - E5MessageBox.critical( + EricMessageBox.critical( None, QCoreApplication.translate("TemplateGroup", "Add Template"), @@ -535,7 +535,7 @@ Private slot to handle the Remove context menu action. """ itm = self.currentItem() - res = E5MessageBox.yesNo( + res = EricMessageBox.yesNo( self, self.tr("Remove Template"), self.tr("""<p>Do you really want to remove <b>{0}</b>?</p>""") @@ -562,7 +562,7 @@ """ Private slot to handle the Import context menu action. """ - fn = E5FileDialog.getOpenFileName( + fn = EricFileDialog.getOpenFileName( self, self.tr("Import Templates"), "", @@ -578,14 +578,14 @@ """ Private slot to handle the Export context menu action. """ - fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( + fn, selectedFilter = EricFileDialog.getSaveFileNameAndFilter( self, self.tr("Export Templates"), "", self.tr("Templates Files (*.ecj)" "All Files (*)"), "", - E5FileDialog.DontConfirmOverwrite) + EricFileDialog.DontConfirmOverwrite) if fn: ext = QFileInfo(fn).suffix() @@ -594,7 +594,7 @@ if ex: fn += ex if os.path.exists(fn): - ok = E5MessageBox.yesNo( + ok = EricMessageBox.yesNo( self, self.tr("Export Templates"), self.tr("""<p>The templates file <b>{0}</b> exists""" @@ -610,13 +610,13 @@ Private slot to reload the templates. """ if self.__dirty: - res = E5MessageBox.yesNo( + res = EricMessageBox.yesNo( self, self.tr("Reload Templates"), self.tr( """The templates contain unsaved changes. Shall these""" """ changes be discarded?"""), - icon=E5MessageBox.Warning) + icon=EricMessageBox.Warning) if not res: return @@ -629,7 +629,7 @@ """ Private method to show some help. """ - E5MessageBox.information( + EricMessageBox.information( self, self.tr("Template Help"), self.tr( @@ -649,7 +649,7 @@ @return dictionary of predefined variables and their values """ - project = e5App().getObject("Project") + project = ericApp().getObject("Project") editor = self.viewmanager.activeWindow() now = datetime.datetime.now() sepchar = Preferences.getTemplates("SeparatorChar") @@ -884,7 +884,7 @@ """ if oldname != newname: if newname in self.groups: - E5MessageBox.warning( + EricMessageBox.warning( self, self.tr("Edit Template Group"), self.tr("""<p>A template group with the name""" @@ -1008,7 +1008,7 @@ reader.readXML() f.close() else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Read Templates"), self.tr( @@ -1020,7 +1020,7 @@ """ Private method to open the configuration dialog. """ - e5App().getObject("UserInterface").showPreferences("templatesPage") + ericApp().getObject("UserInterface").showPreferences("templatesPage") def hasTemplate(self, entryName, groupName=None): """