diff --git a/app/Editor.java b/app/Editor.java index bd6c1cced..cfeeb1966 100644 --- a/app/Editor.java +++ b/app/Editor.java @@ -503,7 +503,7 @@ public class Editor extends JFrame saveMenuItem = newJMenuItem("Save", 'S'); saveMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - handleSave(); + handleSave(false); } }); menu.add(saveMenuItem); @@ -1313,7 +1313,7 @@ public class Editor extends JFrame options[0]); if (result == JOptionPane.YES_OPTION) { - handleSave(); + handleSave(true); checkModified2(); } else if (result == JOptionPane.NO_OPTION) { @@ -1568,33 +1568,51 @@ public class Editor extends JFrame // there is no handleSave1 since there's never a need to prompt - public void handleSave() { + /** + * Actually handle the save command. If 'force' is set to false, + * this will happen in another thread so that the message area + * will update and the save button will stay highlighted while the + * save is happening. If 'force' is true, then it will happen + * immediately. This is used during a quit, because invokeLater() + * won't run properly while a quit is happening. This fixes + * Bug 276. + */ + public void handleSave(boolean force) { doStop(); buttons.activate(EditorButtons.SAVE); - SwingUtilities.invokeLater(new Runnable() { - public void run() { - message("Saving..."); - try { - if (sketch.save()) { - message("Done Saving."); - } else { - message(EMPTY); - } - // rebuild sketch menu in case a save-as was forced - sketchbook.rebuildMenus(); - - } catch (Exception e) { - // show the error as a message in the window - error(e); - - // zero out the current action, - // so that checkModified2 will just do nothing - checkModifiedMode = 0; - // this is used when another operation calls a save + if (force) { + handleSave2(); + } else { + SwingUtilities.invokeLater(new Runnable() { + public void run() { } - buttons.clear(); - }}); + }); + } + } + + + public void handleSave2() { + message("Saving..."); + try { + if (sketch.save()) { + message("Done Saving."); + } else { + message(EMPTY); + } + // rebuild sketch menu in case a save-as was forced + sketchbook.rebuildMenus(); + + } catch (Exception e) { + // show the error as a message in the window + error(e); + + // zero out the current action, + // so that checkModified2 will just do nothing + checkModifiedMode = 0; + // this is used when another operation calls a save + } + buttons.clear(); } @@ -1696,7 +1714,7 @@ public class Editor extends JFrame options, options[0]); if (result == JOptionPane.OK_OPTION) { - handleSave(); + handleSave(true); } else { // why it's not CANCEL_OPTION is beyond me (at least on the mac) diff --git a/app/EditorButtons.java b/app/EditorButtons.java index 82b853d58..34a03829f 100644 --- a/app/EditorButtons.java +++ b/app/EditorButtons.java @@ -357,7 +357,7 @@ public class EditorButtons extends JComponent implements MouseInputListener { break; case SAVE: - editor.handleSave(); + editor.handleSave(false); break; case EXPORT: diff --git a/app/EditorStatus.java b/app/EditorStatus.java index bd0e05cc6..084a6052b 100644 --- a/app/EditorStatus.java +++ b/app/EditorStatus.java @@ -416,7 +416,7 @@ public class EditorStatus extends JPanel implements ActionListener { } else if (e.getSource() == yesButton) { // answer was in response to "save changes?" unprompt(); - editor.handleSave(); + editor.handleSave(true); editor.checkModified2(); } else if (e.getSource() == cancelButton) { diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 100db3e1e..04bc318fa 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -7,6 +7,34 @@ releases will be super crusty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +ABOUT REV 0104 - 27 February 2006 + +Fix for major bug where "Save Changes on Quit" was being ignored. +http://dev.processing.org/bugs/show_bug.cgi?id=276 + +Other changes include: + ++ Processing.app is now a universal binary for Mac OS X. The version + of jikes being used is also now a universal binary. However, OpenGL + and the Serial library still will not work on Intel-based Macs: + http://processing.org/faq/platforms.html#mac + ++ Fixed issues with LD_LIBRARY_PATH for applications exported for Linux. + http://dev.processing.org/bugs/show_bug.cgi?id=234 + ++ No window is opened when using the PDF renderer, this is useful in + situations where very large images are being created at it used to + freak out the OS. + ++ Fixed an obscure font metrics issue with OpenGL and createFont(). + ++ A handful of additional internal changes for recordRaw() have been + added to support writing out 2D and 3D data. + + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + ABOUT REV 0103 - 18 January 2006 Fix for a bug specific to Mac OS X (may affect Windows as well) that diff --git a/core/todo.txt b/core/todo.txt index a01e84b23..f9d170380 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -7,20 +7,24 @@ X basically if the main gfx context isn't viewable, close the window X since it may have already been opened at 100x100 X avoid opening it in the first place? X added toolkit getFontMetrics() for shape mode fonts to be able to change size +X recordRaw() to a PGraphics3 should send 3D data. +X but recordRaw() to a PGraphics(2) should send only 2D data. _ registerSize() in arcball is causing trouble _ loadImage(url) broken on windows +_ actually it's an issue with some types of jpeg files _ http://dev.processing.org/bugs/show_bug.cgi?id=279 _ updatePixels() is slow to create a BufferedImage _ therefore the incomplete rendering (mediatracker-type issue?) +_ finish dxf writer that'll work with recordRaw() + more pdf/recording stuff _ figure out what's up with type on osx _ sometimes bicubic vs quadratic beziers are mixed up in fonts _ not sure if it's limited to osx or what -_ make dxf writer that'll work with recordRaw() _ document how to switch to next page _ maybe background() should do this automatically? _ add option to sort triangles back to front so alpha works diff --git a/todo.txt b/todo.txt index ff483a4cd..81487b843 100644 --- a/todo.txt +++ b/todo.txt @@ -1,22 +1,13 @@ 0104 pde X removed "yep yep yep" when using "Create Font" - -_ p5 not saving changes on quit, even if you say 'yes' -_ http://dev.processing.org/bugs/show_bug.cgi?id=276 -_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1139519266;start=;mstate=0 - -_ recordRaw() to a PGraphics3 should send 3D data. -_ but recordRaw() to a PGraphics(2) should send only 2D data. - +X p5 not saving changes on quit, even if you say 'yes' +X http://dev.processing.org/bugs/show_bug.cgi?id=276 +_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1139519266 X update osx for intel binary (if necessary) -_ http://developer.apple.com/qa/qa2005/qa1295.html -_ find/build universal version of jogl -_ find/build universal version of rxtx X if running on 10.4, univerals jikes installed in /usr/bin/jikes X updated the jikes included with p5 to be the universal version X add notes to the faq about status X set java version to be 1.4, not 1.4+ - X fix LD_LIBRARY_PATH issues for applications on some linux distros X http://dev.processing.org/bugs/show_bug.cgi?id=234 @@ -24,6 +15,11 @@ X http://dev.processing.org/bugs/show_bug.cgi?id=234 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +_ finish updates for osx and opengl +_ http://developer.apple.com/qa/qa2005/qa1295.html +_ find/build universal version of jogl +_ find/build universal version of rxtx + _ need method for showing prefs for the tools _ add pref to handle date vs. increment on archive sketch