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

Correct mode is now selected in modeMenu, resolving Issue #2615 #2616

Merged
merged 1 commit into from Jul 26, 2014

Conversation

Projects
None yet
2 participants
@joelmoniz
Copy link
Member

joelmoniz commented Jun 27, 2014

This resolves Issue #2615, where trying to change the Mode when there are unsaved changes doesn't change the mode, but shows the mode as being changed in the modeMenu popup. What has been done is that in case there are unsaved changes in the sketch, the last mode is selected again.

@joelmoniz joelmoniz changed the title Correct mode is now selected in modeMenu Correct mode is now selected in modeMenu, resolving [Issue #2615](https://github.com/processing/processing/issues/2615) Jun 27, 2014

@joelmoniz joelmoniz changed the title Correct mode is now selected in modeMenu, resolving [Issue #2615](https://github.com/processing/processing/issues/2615) Correct mode is now selected in modeMenu, resolving Issue #2615 Jun 27, 2014

@benfry

This comment has been minimized.

Copy link
Member

benfry commented Jul 25, 2014

wouldn't it be better to not call changeMode() if the sketch is modified?

@joelmoniz

This comment has been minimized.

Copy link
Member

joelmoniz commented Jul 26, 2014

No, I'm afraid the problem would still persist, since this is related to how the JRadioButtonMenuItem group works, and to not have something clicked on selected, the selection has to be explicitly changed. Clicking on the JRadioButtonMenuItem automatically selects it.

For example, assume there are unsaved changes in a sketch. Trying to change the mode requests the user to save first, and the mode doesn't change. However, the mode the user just selected shows as being selected, like so:

modeselectionerror
Above, I've tried to change to CoffeeScript Mode from Java mode, and due to unsaved changes, been prevented from doing so. However, the mode selected in the mode popup menu is CoffeeScript.

Is this ok? Should I change something?

Thanks.

@benfry

This comment has been minimized.

Copy link
Member

benfry commented Jul 26, 2014

Ok, just feels very hacky... I'll merge this and at least change it so that it doesn't call changeMode() (which fails) when isModifed() is true, and keep the rest.

benfry added a commit that referenced this pull request Jul 26, 2014

Merge pull request #2616 from joelmoniz/wrongModeSelection
Correct mode is now selected in modeMenu,  resolving Issue #2615

@benfry benfry merged commit 658a594 into processing:master Jul 26, 2014

@joelmoniz

This comment has been minimized.

Copy link
Member

joelmoniz commented Jul 26, 2014

Oh sorry. Shall I submit a PR where I prevent changeMode() from being called if isModified() is true? But I'll have to shift the warning message into the actionListener...

@benfry

This comment has been minimized.

Copy link
Member

benfry commented Jul 26, 2014

Good catch, I've just made that change.

@joelmoniz joelmoniz deleted the joelmoniz:wrongModeSelection branch Jul 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment