-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Restore widget shortcuts to Preferences and allow to change them on the fly (Shortcuts) #23024
base: master
Are you sure you want to change the base?
Conversation
251ca02
to
8b3fe55
Compare
8b3fe55
to
b18dc1a
Compare
@dalthviz, this is ready for review. Please check that:
|
Gave this an initial check and seems like manually changing shortcuts is working and also shortcuts like |
The current docstrings were not easy to understand.
- The previous solution, which used tuples to collect those data, was easy to break, because it required to put data in the right order; and undocumented, because it was unclear what kind of data had to be added in the tuple elements. - Those limitations made difficult to reason about shortcuts-related code.
b18dc1a
to
1f336d9
Compare
- Before we only allowed class methods decorated with on_conf_change to do that. - But that's too limited if we need to use regular functions to observe an option. And that's precisely what this new method allows us to do.
This is necessary to add observers for specific shortcuts.
- That allows those shortcuts to be updated on the fly when they are changed in Preferences or directly with set_conf. - Also, fix inheritance of classes that inherit from SpyderShortcutsMixin to accomodate this change.
That was introducing an error in test_shortcut_for_widget_is_updated when run on CI due to the incorrectly named section.
This is to have feature parity of kwargs with the other methods of SpyderShortcutsMixin.
Also, add inline typing for several attributes of ConfigurationManager and remove associated comments.
1f336d9
to
b8d84e8
Compare
Also, remove some extra valid contexts that are not necessary anymore.
Thanks for checking that @dalthviz! It should be fixed now. I also took the opportunity to change the context of the Switcher shortcut actions to be |
Description of Changes
ShortcutData
dataclass to represent shortcut data internally and work more easily with it._
, i.e. global (before their context wasswitcher
but that made little sense).Issue(s) Resolved
Fixes #23072
Fixes #22741
Fixes #22516
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: @ccordoba12