--- a/eric7/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py Sat May 22 17:01:51 2021 +0200 +++ b/eric7/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py Sat May 22 18:51:46 2021 +0200 @@ -17,8 +17,8 @@ QVBoxLayout, QTableWidgetItem ) -from E5Gui import E5MessageBox, E5FileDialog -from E5Gui.E5MainWindow import E5MainWindow +from E5Gui import EricMessageBox, EricFileDialog +from E5Gui.EricMainWindow import EricMainWindow from .Ui_PyRegExpWizardDialog import Ui_PyRegExpWizardDialog @@ -181,7 +181,7 @@ regex = self.regexpTextEdit.toPlainText()[:length] names = self.namedGroups(regex) if not names: - E5MessageBox.information( + EricMessageBox.information( self, self.tr("Named reference"), self.tr("""No named groups have been defined yet.""")) @@ -319,13 +319,13 @@ """ Private slot to save the regexp to a file. """ - fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( + fname, selectedFilter = EricFileDialog.getSaveFileNameAndFilter( self, self.tr("Save regular expression"), "", self.tr("RegExp Files (*.rx);;All Files (*)"), None, - E5FileDialog.DontConfirmOverwrite) + EricFileDialog.DontConfirmOverwrite) if fname: ext = QFileInfo(fname).suffix() if not ext: @@ -333,12 +333,12 @@ if ex: fname += ex if QFileInfo(fname).exists(): - res = E5MessageBox.yesNo( + res = EricMessageBox.yesNo( self, self.tr("Save regular expression"), self.tr("<p>The file <b>{0}</b> already exists." " Overwrite it?</p>").format(fname), - icon=E5MessageBox.Warning) + icon=EricMessageBox.Warning) if not res: return @@ -347,7 +347,7 @@ with open(fname, "w", encoding="utf-8") as f: f.write(self.regexpTextEdit.toPlainText()) except OSError as err: - E5MessageBox.information( + EricMessageBox.information( self, self.tr("Save regular expression"), self.tr("""<p>The regular expression could not""" @@ -359,7 +359,7 @@ """ Private slot to load a regexp from a file. """ - fname = E5FileDialog.getOpenFileName( + fname = EricFileDialog.getOpenFileName( self, self.tr("Load regular expression"), "", @@ -371,7 +371,7 @@ regexp = f.read() self.regexpTextEdit.setPlainText(regexp) except OSError as err: - E5MessageBox.information( + EricMessageBox.information( self, self.tr("Save regular expression"), self.tr("""<p>The regular expression could not""" @@ -413,26 +413,26 @@ if self.unicodeCheckBox.isChecked(): flags |= re.ASCII re.compile(regex, flags) - E5MessageBox.information( + EricMessageBox.information( self, self.tr("Validation"), self.tr("""The regular expression is valid.""")) except re.error as e: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""Invalid regular expression: {0}""") .format(str(e))) return except IndexError: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""Invalid regular expression: missing""" """ group name""")) return else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""A regular expression must be given.""")) @@ -564,21 +564,21 @@ self.resultTable.verticalHeader().hide() self.resultTable.horizontalHeader().hide() except re.error as e: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""Invalid regular expression: {0}""") .format(str(e))) return except IndexError: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""Invalid regular expression: missing""" """ group name""")) return else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""A regular expression and a text must be""" @@ -682,7 +682,7 @@ return self.cw.getCode(indLevel, indString) -class PyRegExpWizardWindow(E5MainWindow): +class PyRegExpWizardWindow(EricMainWindow): """ Main window class for the standalone dialog. """