--- a/eric7/Project/CreateDialogCodeDialog.py Sat May 22 17:01:51 2021 +0200 +++ b/eric7/Project/CreateDialogCodeDialog.py Sat May 22 18:51:46 2021 +0200 @@ -20,8 +20,8 @@ from PyQt6.QtWidgets import QDialog, QDialogButtonBox -from E5Gui.E5Application import e5App -from E5Gui import E5MessageBox +from E5Gui.EricApplication import ericApp +from E5Gui import EricMessageBox from .Ui_CreateDialogCodeDialog import Ui_CreateDialogCodeDialog from .NewDialogClassDialog import NewDialogClassDialog @@ -91,7 +91,7 @@ self.packagesPath = self.project.getProjectPath() if os.path.exists(self.srcFile): - vm = e5App().getObject("ViewManager") + vm = ericApp().getObject("ViewManager") ed = vm.getOpenEditor(self.srcFile) if ed and not vm.checkDirty(ed): self.__initError = True @@ -129,7 +129,7 @@ self.classNameCombo.count() == 0 ): self.__initError = True - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Create Dialog Code"), self.tr( @@ -158,7 +158,7 @@ @return tuple of process output and error flag @rtype tuple of (str, bool) """ - venvManager = e5App().getObject("VirtualEnvManager") + venvManager = ericApp().getObject("VirtualEnvManager") projectType = self.project.getProjectType() venvName = self.project.getDebugProperty("VIRTUALENV") @@ -210,7 +210,7 @@ ok = True uicText = outText.strip() else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("uic error"), self.tr( @@ -219,7 +219,7 @@ self.formFile, outText) ) else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("uic error"), self.tr( @@ -342,7 +342,7 @@ ): itm2.setFlags(Qt.ItemFlag.ItemIsEnabled) itm2.setCheckState(Qt.CheckState.Checked) - if e5App().usesDarkPalette(): + if ericApp().usesDarkPalette(): itm2.setForeground(QBrush(QColor("#75bfff"))) else: itm2.setForeground(QBrush(Qt.GlobalColor.blue)) @@ -387,7 +387,7 @@ Private slot to generate Python code as requested by the user. """ if self.project.getProjectLanguage() != "Python3": - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Code Generation"), self.tr( @@ -424,7 +424,7 @@ getConfig('ericCodeTemplatesDir'), "impl_pyqt6.py.tmpl") else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Code Generation"), self.tr( @@ -435,7 +435,7 @@ with open(tmplName, 'r', encoding="utf-8") as tmplFile: template = tmplFile.read() except OSError as why: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Code Generation"), self.tr( @@ -472,7 +472,7 @@ if not sourceImpl[-1].endswith("\n"): sourceImpl[-1] = "{0}{1}".format(sourceImpl[-1], "\n") except OSError as why: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Code Generation"), self.tr( @@ -564,7 +564,7 @@ with open(fn, 'w', encoding="utf-8", newline=newline) as srcFile: srcFile.write("".join(sourceImpl)) except OSError as why: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Code Generation"), self.tr("""<p>Could not write the source file "{0}".</p>"""