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) {
617
617
PreferencesData .setCollection ("recent.sketches" , sketches );
618
618
}
619
619
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
+
620
626
// Because of variations in native windowing systems, no guarantees about
621
627
// changes to the focused and active Windows can be made. Developers must
622
628
// 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() {
2239
2239
statusNotice (_ ("Saving..." ));
2240
2240
boolean saved = false ;
2241
2241
try {
2242
+ boolean wasReadOnly = sketch .isReadOnly ();
2243
+ String previousMainFilePath = sketch .getMainFilePath ();
2242
2244
saved = sketch .save ();
2243
- if (saved )
2245
+ if (saved ) {
2244
2246
statusNotice (_ ("Done Saving." ));
2245
- else
2247
+ if (wasReadOnly ) {
2248
+ base .removeRecentSketchPath (previousMainFilePath );
2249
+ }
2250
+ base .storeRecentSketches (sketch );
2251
+ base .rebuildRecentSketchesMenuItems ();
2252
+ } else {
2246
2253
statusEmpty ();
2254
+ }
2247
2255
// rebuild sketch menu in case a save-as was forced
2248
2256
// Disabling this for 0125, instead rebuild the menu inside
2249
2257
// the Save As method of the Sketch object, since that's the
You can’t perform that action at this time.
0 commit comments