Wed, 26 May 2021 19:07:42 +0200
Ported the plug-in to PyQt6 for eric7.
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 | |
346
877cac2e8d94
Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
341
diff
changeset
|
3 | # Copyright (c) 2015 - 2021 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 | |
320
91b171fdd85f
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
302
diff
changeset
|
13 | from Preferences.ConfigurationPages.ConfigurationPageBase import ( |
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
|
14 | ConfigurationPageBase |
320
91b171fdd85f
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
302
diff
changeset
|
15 | ) |
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
|
16 | from .Ui_MouseClickHandlerRopePage import Ui_MouseClickHandlerRopePage |
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
|
17 | |
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 | from Utilities import MouseUtilities |
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
|
19 | from Preferences.MouseClickDialog import MouseClickDialog |
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 | |
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
|
22 | class MouseClickHandlerRopePage(ConfigurationPageBase, |
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 | Ui_MouseClickHandlerRopePage): |
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 | """ |
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 | 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
|
26 | """ |
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 |
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
|
30 | |
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") |
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
|
37 | |
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 |
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
|
39 | |
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"), |
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
|
44 | self.__plugin.getPreferences("MouseClickGotoButton") |
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 | } |
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
|
47 | |
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( |
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
|
49 | self.__plugin.getPreferences("MouseClickEnabled")) |
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
|
50 | self.gotoClickEdit.setText(MouseUtilities.MouseButtonModifier2String( |
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
|
51 | *self.__modifiers["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
|
52 | |
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
|
53 | 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
|
54 | """ |
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 | 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
|
56 | """ |
133
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
57 | self.__plugin.setPreferences( |
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
58 | "MouseClickEnabled", |
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
|
59 | self.ropeClickHandlerCheckBox.isChecked()) |
133
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
60 | self.__plugin.setPreferences( |
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
61 | "MouseClickGotoModifiers", |
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
|
62 | int(self.__modifiers["goto"][0])) |
133
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
63 | self.__plugin.setPreferences( |
6fb6ac582a39
Adjusted to slightly extended Editor API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
132
diff
changeset
|
64 | "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
|
65 | int(self.__modifiers["goto"][1])) |
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
|
66 | |
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
|
67 | @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
|
68 | 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
|
69 | """ |
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 | 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
|
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 | dlg = MouseClickDialog(*self.__modifiers["goto"]) |
365
f740b50380df
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
347
diff
changeset
|
73 | 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
|
74 | 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
|
75 | self.gotoClickEdit.setText( |
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 | MouseUtilities.MouseButtonModifier2String( |
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.__modifiers["goto"])) |