Tue, 10 Dec 2024 15:49:01 +0100
Updated copyright for 2025.
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
426
7592a1c052e8
Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
423
diff
changeset
|
3 | # Copyright (c) 2015 - 2025 Detlev Offenbach <detlev@die-offenbachs.de> |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the Rope Mouse Click Handler configuration page. |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
365
f740b50380df
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
347
diff
changeset
|
10 | from PyQt6.QtCore import pyqtSlot |
f740b50380df
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
347
diff
changeset
|
11 | from PyQt6.QtWidgets import QDialog |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
396
933b8fcd854f
Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
389
diff
changeset
|
13 | from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import ( |
933b8fcd854f
Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
389
diff
changeset
|
14 | ConfigurationPageBase, |
933b8fcd854f
Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
389
diff
changeset
|
15 | ) |
933b8fcd854f
Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
389
diff
changeset
|
16 | from eric7.Preferences.MouseClickDialog import MouseClickDialog |
933b8fcd854f
Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
389
diff
changeset
|
17 | from eric7.Utilities import MouseUtilities |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
396
933b8fcd854f
Adapted the import statements to the new structure.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
389
diff
changeset
|
19 | from .Ui_MouseClickHandlerRopePage import Ui_MouseClickHandlerRopePage |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
22 | class MouseClickHandlerRopePage(ConfigurationPageBase, Ui_MouseClickHandlerRopePage): |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | Class implementing the Rope Mouse Click Handler configuration page. |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | """ |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
26 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | def __init__(self, plugin): |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | Constructor |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
30 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | @param plugin reference to the plugin object |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | @type RefactoringRopePlugin |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | ConfigurationPageBase.__init__(self) |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | self.setupUi(self) |
132
5384651b27c7
Fixed an issue in the mouse click configuration page causing a wrong object name being set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
129
diff
changeset
|
36 | self.setObjectName("MouseClickHandlerRopePage") |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
37 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | self.__plugin = plugin |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
39 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | # set initial values |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | self.__modifiers = { |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | "goto": ( |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | self.__plugin.getPreferences("MouseClickGotoModifiers"), |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
44 | self.__plugin.getPreferences("MouseClickGotoButton"), |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | ) |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | } |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
47 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | self.ropeClickHandlerCheckBox.setChecked( |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
49 | self.__plugin.getPreferences("MouseClickEnabled") |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
50 | ) |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
51 | self.gotoClickEdit.setText( |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
52 | MouseUtilities.MouseButtonModifier2String(*self.__modifiers["goto"]) |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
53 | ) |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
54 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | def save(self): |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | Public slot to save the Rope Mouse Click Handler configuration. |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | """ |
133
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
59 | self.__plugin.setPreferences( |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
60 | "MouseClickEnabled", self.ropeClickHandlerCheckBox.isChecked() |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
61 | ) |
133
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
62 | self.__plugin.setPreferences( |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
63 | "MouseClickGotoModifiers", self.__modifiers["goto"][0] |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
64 | ) |
133
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
65 | self.__plugin.setPreferences( |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
66 | "MouseClickGotoButton", self.__modifiers["goto"][1] |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
67 | ) |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
68 | |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | @pyqtSlot() |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | def on_changeGotoButton_clicked(self): |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | """ |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | Private slot to change the 'goto' mouse click sequence. |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | """ |
423
9dfc89a5aadf
Recompiled the forms and made some modal dialog usages clearer with respect to parent relationship.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
412
diff
changeset
|
74 | dlg = MouseClickDialog(*self.__modifiers["goto"], parent=self) |
365
f740b50380df
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
347
diff
changeset
|
75 | if dlg.exec() == QDialog.DialogCode.Accepted: |
129
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | self.__modifiers["goto"] = dlg.getClick() |
23ee57a96ea3
Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | self.gotoClickEdit.setText( |
389
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
78 | MouseUtilities.MouseButtonModifier2String(*self.__modifiers["goto"]) |
4f53795beff0
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
374
diff
changeset
|
79 | ) |