Skip to content
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: Fix View/Toolbars menu #3749

Merged
merged 2 commits into from
Nov 28, 2016
Merged

Conversation

dalthviz
Copy link
Member

Fixes #3746

@dalthviz
Copy link
Member Author

The problem was a missing validation to add QAction elements in the method add_actions in spyder/utils/qthelpers.py.

@ccordoba12 ccordoba12 added this to the v3.1 milestone Nov 27, 2016
if insert_before is None:
target.addAction(action)
else:
target.insertAction(insert_before, action)
elif isinstance(action, SpyderAction):
if isinstance(target, QMenu) or not isinstance(target, QToolBar):
action = action.no_icon_action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be made simpler by changing this block and removing the code you introduced above, like this:

elif isinstance(action, QAction):
    if isinstance(action, SpyderAction):
        if isinstance(target, QMenu) or not isinstance(target, QToolBar):
            action = action.no_icon_action

@ccordoba12
Copy link
Member

ccordoba12 commented Nov 27, 2016

Thanks @dalthviz for looking into this one. I added a comment to simplify our code, but other than that, this is ready :-)

@ccordoba12 ccordoba12 changed the title PR: Fixed Menu view/toolbar with empty contents PR: Fix View/Toolbars menu Nov 28, 2016
@ccordoba12
Copy link
Member

Thanks @dalthviz!

@ccordoba12 ccordoba12 merged commit d571e9b into spyder-ide:3.x Nov 28, 2016
ccordoba12 added a commit that referenced this pull request Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants