RefactoringRope/ConfigurationPage/CallTipsRopePage.py

Tue, 10 Dec 2024 15:49:01 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Dec 2024 15:49:01 +0100
branch
eric7
changeset 426
7592a1c052e8
parent 412
6fa5892b9097
permissions
-rw-r--r--

Updated copyright for 2025.

100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
426
7592a1c052e8 Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 412
diff changeset
3 # Copyright (c) 2008 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Rope Calltips configuration page.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
394
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
10 from PyQt6.QtCore import pyqtSlot
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
11
409
65153bf17e8d Fixed a bug and resorted the imports with isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 396
diff changeset
12 from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import (
396
933b8fcd854f Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 394
diff changeset
13 ConfigurationPageBase,
933b8fcd854f Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 394
diff changeset
14 )
933b8fcd854f Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 394
diff changeset
15
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from .Ui_CallTipsRopePage import Ui_CallTipsRopePage
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
18
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 class CallTipsRopePage(ConfigurationPageBase, Ui_CallTipsRopePage):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 Class implementing the Rope Calltips configuration page.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
23
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 def __init__(self, plugin):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Constructor
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
27
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param plugin reference to the plugin object
205
55bba6be2cbc Corrected some source documentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 151
diff changeset
29 @type RefactoringRopePlugin
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 ConfigurationPageBase.__init__(self)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setupUi(self)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setObjectName("CallTipsRopePage")
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
34
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.__plugin = plugin
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
36
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 # set initial values
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.ropeCalltipsCheckBox.setChecked(
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
39 self.__plugin.getPreferences("CodeAssistCalltipsEnabled")
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
40 )
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.ctMaxfixesSpinBox.setValue(
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
42 self.__plugin.getPreferences("CalltipsMaxFixes")
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
43 )
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
44
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 def save(self):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 Public slot to save the Rope Calltips configuration.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.__plugin.setPreferences(
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
50 "CodeAssistCalltipsEnabled", self.ropeCalltipsCheckBox.isChecked()
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
51 )
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
52 self.__plugin.setPreferences("CalltipsMaxFixes", self.ctMaxfixesSpinBox.value())
394
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
53
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
54 def polishPage(self):
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
55 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
56 Public slot to perform some polishing actions.
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
57 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
58 names = self.__plugin.getCodeAssistServer().connectionNames()
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
59 self.createPython3Button.setEnabled("Python3" in names)
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
60 self.editPython3Button.setEnabled("Python3" in names)
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
61
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
62 @pyqtSlot()
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
63 def on_editPython3Button_clicked(self):
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
64 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
65 Private slot to edit the rope configuration for Python 3.
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
66 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
67 self.__plugin.getCodeAssistServer().editConfig("Python3")
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
68
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
69 @pyqtSlot()
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
70 def on_createPython3Button_clicked(self):
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
71 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
72 Private slot to create a new default rope configuration for Python 3.
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
73 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
74 self.__plugin.getCodeAssistServer().createConfig("Python3")

eric ide

mercurial