From d20a9de36183cbe1dbfdeeffc048614a6434ccb1 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 26 Jul 2014 10:25:10 -0400 Subject: [PATCH] incorporate Mode fix from Joel (issue #2615) --- app/src/processing/app/Editor.java | 9 +++++++-- build/shared/revisions.txt | 4 ++++ todo.txt | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index dbbd9c7ec..4ac6b163a 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -389,8 +389,13 @@ public abstract class Editor extends JFrame implements RunnerListener { JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle()); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - base.changeMode(m); - if (sketch.isModified()) { + if (!sketch.isModified()) { + base.changeMode(m); + + } else { + // Re-select the old checkbox, because it was automatically + // updated by Java, even though the Mode could not be changed. + // https://github.com/processing/processing/issues/2615 for (Component c : modeMenu.getPopupMenu().getComponents()) { if (c instanceof JRadioButtonMenuItem) { if (((JRadioButtonMenuItem)c).getText() == mode.getTitle()) { diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index c39e9aebd..d15d52b01 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -63,6 +63,10 @@ in-progress Google Summer of Code projects and others: + Add preference to set the present color https://github.com/processing/processing/pull/2568 ++ Fix a problem where mode menu selection would change even if + the change was canceled due to the sketch being modified + https://github.com/processing/processing/issues/2615 + [ more bug fixes ] diff --git a/todo.txt b/todo.txt index ce8c46437..01e3bab05 100644 --- a/todo.txt +++ b/todo.txt @@ -20,6 +20,8 @@ X contrib properties files ignored in favor of contributions.txt from p5.org X https://github.com/processing/processing/issues/2572 X tweak mode integrated X https://github.com/processing/processing/pull/2624 +X wrong mode selected if sketch is modified (checkbox changes) +X https://github.com/processing/processing/issues/2615 pulls X Implementation of a list of open sketches in the Sketch menu