mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Open Recent: if sketch was read only and it was saved, saved version was not put into recent sketches list. Fixed
This commit is contained in:
parent
cb29f4832e
commit
35d3aeb6d6
@ -617,6 +617,12 @@ public class Base {
|
||||
PreferencesData.setCollection("recent.sketches", sketches);
|
||||
}
|
||||
|
||||
protected void removeRecentSketchPath(String path) {
|
||||
Collection<String> sketches = new LinkedList<String>(PreferencesData.getCollection("recent.sketches"));
|
||||
sketches.remove(path);
|
||||
PreferencesData.setCollection("recent.sketches", sketches);
|
||||
}
|
||||
|
||||
// Because of variations in native windowing systems, no guarantees about
|
||||
// changes to the focused and active Windows can be made. Developers must
|
||||
// never assume that this Window is the focused or active Window until this
|
||||
|
@ -2239,11 +2239,19 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
statusNotice(_("Saving..."));
|
||||
boolean saved = false;
|
||||
try {
|
||||
boolean wasReadOnly = sketch.isReadOnly();
|
||||
String previousMainFilePath = sketch.getMainFilePath();
|
||||
saved = sketch.save();
|
||||
if (saved)
|
||||
if (saved) {
|
||||
statusNotice(_("Done Saving."));
|
||||
else
|
||||
if (wasReadOnly) {
|
||||
base.removeRecentSketchPath(previousMainFilePath);
|
||||
}
|
||||
base.storeRecentSketches(sketch);
|
||||
base.rebuildRecentSketchesMenuItems();
|
||||
} else {
|
||||
statusEmpty();
|
||||
}
|
||||
// rebuild sketch menu in case a save-as was forced
|
||||
// Disabling this for 0125, instead rebuild the menu inside
|
||||
// the Save As method of the Sketch object, since that's the
|
||||
|
Loading…
x
Reference in New Issue
Block a user