diff -r 8a7677a63c8d -r 68ec9c3d4de5 eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py --- a/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py Sat May 22 17:01:51 2021 +0200 +++ b/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py Sat May 22 18:51:46 2021 +0200 @@ -19,8 +19,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_QRegularExpressionWizardDialog import ( Ui_QRegularExpressionWizardDialog @@ -169,7 +169,7 @@ responseStr = data.decode("utf-8") responseDict = json.loads(responseStr) if responseDict["error"]: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Communication Error"), self.tr("""<p>The PyQt5 backend reported""" @@ -286,7 +286,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.""")) @@ -402,13 +402,13 @@ """ Private slot to save the QRegularExpression 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: @@ -416,12 +416,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 @@ -430,7 +430,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""" @@ -442,7 +442,7 @@ """ Private slot to load a QRegularExpression from a file. """ - fname = E5FileDialog.getOpenFileName( + fname = EricFileDialog.getOpenFileName( self, self.tr("Load regular expression"), "", @@ -454,7 +454,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""" @@ -507,13 +507,13 @@ response = self.__receiveResponse() if response and "valid" in response: if response["valid"]: - E5MessageBox.information( + EricMessageBox.information( self, self.tr("Validation"), self.tr( """The regular expression is valid.""")) else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""Invalid regular expression: {0}""") @@ -526,19 +526,19 @@ self.regexpTextEdit.setFocus() return else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Communication Error"), self.tr("""Invalid response received from""" """ PyQt5 backend.""")) else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Communication Error"), self.tr("""Communication with PyQt5 backend""" """ failed.""")) else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""A regular expression must be given.""")) @@ -582,7 +582,7 @@ response = self.__receiveResponse() if response and ("valid" in response or "matched" in response): if "valid" in response: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""Invalid regular expression: {0}""") @@ -697,19 +697,19 @@ self.resultTable.verticalHeader().hide() self.resultTable.horizontalHeader().hide() else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Communication Error"), self.tr("""Invalid response received from""" """ PyQt5 backend.""")) else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Communication Error"), self.tr("""Communication with PyQt5""" """ backend failed.""")) else: - E5MessageBox.critical( + EricMessageBox.critical( self, self.tr("Error"), self.tr("""A regular expression and a text must""" @@ -837,7 +837,7 @@ super().reject() -class QRegularExpressionWizardWindow(E5MainWindow): +class QRegularExpressionWizardWindow(EricMainWindow): """ Main window class for the standalone dialog. """