--- a/RefactoringRope/MoveDialog.py Wed May 26 17:53:08 2021 +0200 +++ b/RefactoringRope/MoveDialog.py Wed May 26 19:07:42 2021 +0200 @@ -9,12 +9,12 @@ import os -from PyQt5.QtCore import pyqtSlot -from PyQt5.QtWidgets import QDialogButtonBox, QAbstractButton +from PyQt6.QtCore import pyqtSlot +from PyQt6.QtWidgets import QDialogButtonBox, QAbstractButton -from E5Gui import E5FileDialog, E5MessageBox -from E5Gui.E5Application import e5App -from E5Gui.E5Completers import E5FileCompleter +from EricWidgets import EricFileDialog, EricMessageBox +from EricWidgets.EricApplication import ericApp +from EricWidgets.EricCompleters import EricFileCompleter from .Ui_MoveDialog import Ui_MoveDialog from .RefactoringDialogBase import RefactoringDialogBase @@ -46,17 +46,18 @@ self._changeGroupName = "Move" - self.__destinationCompleter = E5FileCompleter(self.destinationEdit) + self.__destinationCompleter = EricFileCompleter(self.destinationEdit) self.__filename = filename self.__offset = offset - self.__project = e5App().getObject("Project") + self.__project = ericApp().getObject("Project") - self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) + self.__okButton = self.buttonBox.button( + QDialogButtonBox.StandardButton.Ok) self.__okButton.setEnabled(False) self.__previewButton = self.buttonBox.addButton( - self.tr("Preview"), QDialogButtonBox.ActionRole) + self.tr("Preview"), QDialogButtonBox.ButtonRole.ActionRole) self.__previewButton.setDefault(True) self.moveStackWidget.setCurrentIndex(0) @@ -175,14 +176,14 @@ elif not os.path.isabs(dest): dest = os.path.join(self.__project.getProjectPath(), dest) destination = ( - E5FileDialog.getOpenFileName( + EricFileDialog.getOpenFileName( self, self.windowTitle(), dest, self.tr("Python Files (*.py *.py3);;All Files (*)")) if self.__moveType == "move_global_method" else # move_module - E5FileDialog.getExistingDirectory( + EricFileDialog.getExistingDirectory( self, self.windowTitle(), dest) @@ -198,7 +199,7 @@ # move_module errorMessage = self.tr("""The selected directory must""" """ be inside the project.""") - E5MessageBox.critical( + EricMessageBox.critical( self, self.windowTitle(), errorMessage) @@ -206,7 +207,7 @@ if self.__moveType == "move_global_method": if not os.path.exists(destination): - E5MessageBox.critical( + EricMessageBox.critical( self, self.windowTitle(), self.tr("""The selected module <b>{0}</b> does""" @@ -216,7 +217,7 @@ # move_module if not os.path.exists( os.path.join(destination, "__init__.py")): - E5MessageBox.critical( + EricMessageBox.critical( self, self.windowTitle(), self.tr("""The selected directory <b>{0}</b> is""" @@ -238,7 +239,7 @@ self.destinationEdit.text()) if self.__moveType == "move_global_method": if not os.path.exists(destination): - E5MessageBox.critical( + EricMessageBox.critical( self, self.windowTitle(), self.tr("""The selected module <b>{0}</b> does""" @@ -247,7 +248,7 @@ else: # move_module if not os.path.exists(os.path.join(destination, "__init__.py")): - E5MessageBox.critical( + EricMessageBox.critical( self, self.windowTitle(), self.tr("""The selected directory <b>{0}</b> is"""