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

Implement Getter for MainWindow's menus #1418

Merged
merged 2 commits into from Apr 3, 2019

Conversation

Projects
None yet
3 participants
@ITAYC0HEN
Copy link
Member

ITAYC0HEN commented Apr 2, 2019

Creates an ENUM to represent the default Menus of MainWindow and a function to get a Menu by a specific type. This is also a useful binding for python plugins.

For example, to add a new action to the Edit menu, I can simply do:

# create a new action
action = QAction("some action", main)
# connect the action to a function
action.triggered.connect(do_something)

# get handle to the Edit menu of MainWindow
editMenu = main.getMenuByType(main.MenuType.Edit)

# Add the action to the Edit menu
editMenu.addAction(action)

image

@xarkes xarkes requested a review from thestr4ng3r Apr 2, 2019

@xarkes

xarkes approved these changes Apr 2, 2019

Copy link
Member

xarkes left a comment

Lgtm!

@ITAYC0HEN

This comment has been minimized.

Copy link
Member Author

ITAYC0HEN commented Apr 2, 2019

Will fix failing build tomorrow :)

@ITAYC0HEN ITAYC0HEN merged commit 8cffd7e into radareorg:master Apr 3, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ITAYC0HEN

This comment has been minimized.

Copy link
Member Author

ITAYC0HEN commented Apr 3, 2019

thank you <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.