17 from eric7 import Preferences |
17 from eric7 import Preferences |
18 from eric7.EricNetwork.EricJsonServer import EricJsonServer |
18 from eric7.EricNetwork.EricJsonServer import EricJsonServer |
19 from eric7.EricWidgets import EricMessageBox |
19 from eric7.EricWidgets import EricMessageBox |
20 from eric7.EricWidgets.EricApplication import ericApp |
20 from eric7.EricWidgets.EricApplication import ericApp |
21 from eric7.QScintilla.Editor import EditorIconId, ReferenceItem |
21 from eric7.QScintilla.Editor import EditorIconId, ReferenceItem |
22 from eric7.SystemUtilities import PythonUtilities |
22 from eric7.SystemUtilities import FileSystemUtilities, PythonUtilities |
23 |
23 |
24 from .RefactoringPreviewDialog import RefactoringPreviewDialog |
24 from .RefactoringPreviewDialog import RefactoringPreviewDialog |
25 |
25 |
26 |
26 |
27 class JediServer(EricJsonServer): |
27 class JediServer(EricJsonServer): |
677 @type dict |
677 @type dict |
678 """ |
678 """ |
679 if "Error" not in result: |
679 if "Error" not in result: |
680 euuid = result["Uuid"] |
680 euuid = result["Uuid"] |
681 diff = result["Diff"] |
681 diff = result["Diff"] |
682 dlg = RefactoringPreviewDialog(self.tr("Rename Variable"), diff) |
682 dlg = RefactoringPreviewDialog( |
|
683 self.tr("Rename Variable"), diff, parent=self.__ui |
|
684 ) |
683 if dlg.exec() == QDialog.DialogCode.Accepted: |
685 if dlg.exec() == QDialog.DialogCode.Accepted: |
684 self.__applyRefactoring(euuid) |
686 self.__applyRefactoring(euuid) |
685 else: |
687 else: |
686 self.__cancelRefactoring(euuid) |
688 self.__cancelRefactoring(euuid) |
687 else: |
689 else: |
977 @pyqtSlot() |
979 @pyqtSlot() |
978 def __projectOpened(self): |
980 def __projectOpened(self): |
979 """ |
981 """ |
980 Private slot to handle the projectOpened signal. |
982 Private slot to handle the projectOpened signal. |
981 """ |
983 """ |
982 self.__ensureActive(JediServer.IdProject) |
984 if not FileSystemUtilities.isRemoteFileName( |
983 self.sendJson( |
985 self.__ericProject.getProjectFile() |
984 "openProject", |
986 ): |
985 { |
987 self.__ensureActive(JediServer.IdProject) |
986 "ProjectPath": self.__ericProject.getProjectPath(), |
988 self.sendJson( |
987 }, |
989 "openProject", |
988 idString=JediServer.IdProject, |
990 { |
989 ) |
991 "ProjectPath": self.__ericProject.getProjectPath(), |
|
992 }, |
|
993 idString=JediServer.IdProject, |
|
994 ) |
990 |
995 |
991 @pyqtSlot() |
996 @pyqtSlot() |
992 def __projectClosed(self): |
997 def __projectClosed(self): |
993 """ |
998 """ |
994 Private slot to handle the projectClosed signal. |
999 Private slot to handle the projectClosed signal. |