-
-
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: Use menu and item identifiers to add items to the main menu plugin #16205
Conversation
Hello @andfoy! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-08-17 21:46:48 UTC |
8248e15
to
78968de
Compare
09f1b45
to
6b89a8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good, thanks @andfoy! Besides the small suggestions I left for you, I also think you need to change the places where we use before
to move from actions to id's (like you did for menus).
A couple of examples are:
spyder/spyder/plugins/application/plugin.py
Lines 137 to 148 in 62dc10e
if shortcuts: | |
from spyder.plugins.shortcuts.plugin import ShortcutActions | |
shortcuts_summary_action = shortcuts.get_action( | |
ShortcutActions.ShortcutSummaryAction) | |
for documentation_action in [ | |
self.documentation_action, self.video_action]: | |
mainmenu.add_item_to_application_menu( | |
documentation_action, | |
menu_id=ApplicationMenus.Help, | |
section=HelpMenuSections.Documentation, | |
before=shortcuts_summary_action, | |
before_section=HelpMenuSections.Support) |
and
spyder/spyder/plugins/tours/plugin.py
Lines 61 to 69 in dc3260b
docs_action = self.get_action( | |
ApplicationActions.SpyderDocumentationAction, | |
plugin=Plugins.Application) | |
mainmenu.add_item_to_application_menu( | |
self.get_container().tour_action, | |
menu_id=ApplicationMenus.Help, | |
section=HelpMenuSections.Documentation, | |
before=docs_action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andfoy, I did a manual check and some entries are missing:
Debug menu: List breakpoints
is missing:
This PR:
5.1.1:
Help menu: The first section is missing
This PR:
5.1.1:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andfoy! Looks good to me now.
Description of Changes
This PR updates the Main Menu plugin methods to exclusively use string identifiers as opposed to using object references when adding items to a specific menu and/or before a given menu item. This is a breaking API change.
Issue(s) Resolved
Fixes #
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: @andfoy