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

Context menu to swap modules for different variation #346

Merged
merged 6 commits into from
Aug 18, 2015

Conversation

Will-W
Copy link
Contributor

@Will-W Will-W commented Aug 16, 2015

In the true spirit of open source - if you want a feature write it yourself.

This PR adds a right-click context menu (for modules) that brings up a list of meta-variations for the selected item(s). Selecting an item changes those modules to the selected meta-variation.
If multiple items are selected, menu only shows up if the variation list would be the same.

Saves a lot of clicking to meta-up or down a module to fit within skills or power budget etc.

I had a good look at the existing code, but I'm sure there are some style or architectural things you'll want me to fix.

(edit by blitzmann) Screenshot of how it looks:

untitled

Will-W added 4 commits August 15, 2015 19:35
Functional, but not handling multiple selections well
Ensure the variations menu only shows when you've got
a matching set of items selected.
@Will-W
Copy link
Contributor Author

Will-W commented Aug 16, 2015

By the way - only tested on Windows, Can test on Linux tomorrow, have no access to a Mac.

@lunedis
Copy link
Contributor

lunedis commented Aug 17, 2015

Seems to work fine, I like it a lot. The context menu can really increase the speed you can work with pyfa.

Btw you still have a "print" in https://github.com/Will-W/Pyfa/blob/master/gui/builtinContextMenus/metaSwap.py#L59

@Will-W
Copy link
Contributor Author

Will-W commented Aug 17, 2015

Ewwwww. That was careless. Removed.

@Will-W
Copy link
Contributor Author

Will-W commented Aug 17, 2015

There is an issue on Linux (as I was expecting from looking at the ammo selection code).
Will try and get that done later today.

@blitzmann
Copy link
Collaborator

Hi,
Just tested this out, and I like it. Can you elaborate more on Linux issues? IIRC, ammo code (and any other 'sublist' selection) had issues between platforms simply due to bugs in the way wxPython handles events. I cannot remember how this manifests of how we've delt with it in the past, heh. Let me know!

Also, I can test in OS X once you submit linux fix

@Will-W
Copy link
Contributor Author

Will-W commented Aug 18, 2015

I only did a quick test to confirm, but in Linux the click event in the sub menu never gets handled. I think on Linux you have to register with the specific submenu but on msw you need to register with the root menu. That's what the ammo switcher code appeared to be doing, and on Linux clicking a module in a submenu doesn't do anything.

Can look at tonight.

@Will-W
Copy link
Contributor Author

Will-W commented Aug 18, 2015

Have submitted a Linux fix and now tested on Linux and Windows: it looks good. If you could test it on a Mac, @blitzmann, that would be great.

@blitzmann
Copy link
Collaborator

Eh, my os x python is all fucked. I'll go ahead and merge this now and test with OS X once I can get it reinstalled correctly. But since OS X and Linux share a lot in common, I'm sure it'll work

blitzmann added a commit that referenced this pull request Aug 18, 2015
Context menu to swap modules for different variation
@blitzmann blitzmann merged commit a69589d into pyfa-org:master Aug 18, 2015
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.

3 participants