File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -617,6 +617,12 @@ protected void storeRecentSketches(Sketch sketch) {
617617 PreferencesData .setCollection ("recent.sketches" , sketches );
618618 }
619619
620+ protected void removeRecentSketchPath (String path ) {
621+ Collection <String > sketches = new LinkedList <String >(PreferencesData .getCollection ("recent.sketches" ));
622+ sketches .remove (path );
623+ PreferencesData .setCollection ("recent.sketches" , sketches );
624+ }
625+
620626 // Because of variations in native windowing systems, no guarantees about
621627 // changes to the focused and active Windows can be made. Developers must
622628 // never assume that this Window is the focused or active Window until this
Original file line number Diff line number Diff line change @@ -2239,11 +2239,19 @@ private boolean handleSave2() {
22392239 statusNotice (_ ("Saving..." ));
22402240 boolean saved = false ;
22412241 try {
2242+ boolean wasReadOnly = sketch .isReadOnly ();
2243+ String previousMainFilePath = sketch .getMainFilePath ();
22422244 saved = sketch .save ();
2243- if (saved )
2245+ if (saved ) {
22442246 statusNotice (_ ("Done Saving." ));
2245- else
2247+ if (wasReadOnly ) {
2248+ base .removeRecentSketchPath (previousMainFilePath );
2249+ }
2250+ base .storeRecentSketches (sketch );
2251+ base .rebuildRecentSketchesMenuItems ();
2252+ } else {
22462253 statusEmpty ();
2254+ }
22472255 // rebuild sketch menu in case a save-as was forced
22482256 // Disabling this for 0125, instead rebuild the menu inside
22492257 // the Save As method of the Sketch object, since that's the
You can’t perform that action at this time.
0 commit comments