diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index 97b2d8aea..1e433dd92 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -823,33 +823,51 @@ public class PdeEditor extends JPanel { openingName = name; if (sketchModified) { - String prompt = "Save changes to " + sketchName + "?"; + String prompt = "Save changes to " + sketchName + "? "; if (checking == DO_QUIT) { - Object[] options = { "Yes", "No", "Cancel" }; - int value = 0; - value = JOptionPane.showOptionDialog(this, - prompt, - "Quit", - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, - null, - options, - options[2]); + int result = 0; - if (value == JOptionPane.YES_OPTION) { + if (PdeBase.platform == PdeBase.MACOSX) { + // macosx java kills the app even though cancel might get hit + // so the cancel button is (temporarily) left off + // this may be treated differently in macosx java 1.4, + // but 1.4 isn't currently stable enough to use. + Object[] options = { "Yes", "No" }; + result = JOptionPane.showOptionDialog(this, + prompt, + "Quit", + JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE, + null, + options, + options[0]); // default to save + + } else { + Object[] options = { "Yes", "No", "Cancel" }; + result = JOptionPane.showOptionDialog(this, + prompt, + "Quit", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, + null, + options, + options[2]); + } + + if (result == JOptionPane.YES_OPTION) { //System.out.println("yes"); //System.out.println("saving"); doSave(); //System.out.println("done saving"); checkModified2(); - } else if (value == JOptionPane.NO_OPTION) { + } else if (result == JOptionPane.NO_OPTION) { //System.out.println("no"); checkModified2(); // though this may just quit - } else if (value == JOptionPane.CANCEL_OPTION) { + } else if (result == JOptionPane.CANCEL_OPTION) { //System.out.println("cancel"); // does nothing } diff --git a/processing/build/shared/revisions.txt b/processing/build/shared/revisions.txt index 182886549..33709bf16 100644 --- a/processing/build/shared/revisions.txt +++ b/processing/build/shared/revisions.txt @@ -196,6 +196,10 @@ glance through them should help clear things up. [ known problems, pardon our dust ] +- macosx doesn't provide an option to 'cancel' when it so politely asks + if you want to "save changes before quitting?". this is because of + weirdness in apple's java that we're trying to straighten out. + - lines with stroke weights that aren't 1 are probably broken. - single pixel lines still have some problems with drawing over things. diff --git a/processing/todo.txt b/processing/todo.txt index 322b2d475..638138920 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -255,8 +255,8 @@ dh X http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;a X notify user when size() is bad X need to use oro matcher when trying to grab the applet size (export?) _ open button getting stuck on windows -_ macosx doesn't listen if 'cancel' is selected for save changes on quit -_ but windows works fine, so it's a macosx problem +X macosx doesn't listen if 'cancel' is selected for save changes on quit +X but windows works fine, so it's a macosx problem fixes from toxi X BImage.get() was only grabbing a single line of pixels @@ -377,10 +377,12 @@ _ (currently cannot because it quits before getting response) _ tried to pop up a modal Dialog in exactly the same location _ but couldn't remove the decoration from the window (jvm bug?) _ because it just quit without finishing +_ macosx handleQuit forces termination (at least on 1.3) +_ figure out how to prevent it, and add the 'cancel' button back VOLUNTEER TASKS -_ need bezierTangent() code +_ need curveTangent() code INTERNAL