mirror of
https://github.com/arduino/Arduino.git
synced 2025-04-06 21:57:57 +02:00
Small cosmetics
This commit is contained in:
parent
19a9e4d5e0
commit
2c089044c8
@ -563,21 +563,22 @@ public class Base {
|
|||||||
String untitledPath = untitledFolder.getAbsolutePath();
|
String untitledPath = untitledFolder.getAbsolutePath();
|
||||||
|
|
||||||
// Save the sketch path and window placement for each open sketch
|
// Save the sketch path and window placement for each open sketch
|
||||||
LinkedList<Editor> reverseEditors = new LinkedList<Editor>(editors);
|
String untitledPath = untitledFolder.getAbsolutePath();
|
||||||
Collections.reverse(reverseEditors);
|
List<Editor> reversedEditors = new LinkedList<>(editors);
|
||||||
|
Collections.reverse(reversedEditors);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (Editor editor : reverseEditors) {
|
for (Editor editor : reversedEditors) {
|
||||||
String path = editor.getSketch().getMainFilePath();
|
Sketch sketch = editor.getSketch();
|
||||||
// In case of a crash, save untitled sketches if they contain changes.
|
String path = sketch.getMainFilePath();
|
||||||
// (Added this for release 0158, may not be a good idea.)
|
// Skip untitled sketches if they do not contains changes.
|
||||||
if (path.startsWith(untitledPath) && !editor.getSketch().isModified()) {
|
if (path.startsWith(untitledPath) && !sketch.isModified()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
PreferencesData.set("last.sketch" + index + ".path", path);
|
PreferencesData.set("last.sketch" + index + ".path", path);
|
||||||
|
|
||||||
int[] location = editor.getPlacement();
|
int[] placement = editor.getPlacement();
|
||||||
String locationStr = PApplet.join(PApplet.str(location), ",");
|
String location = PApplet.join(PApplet.str(placement), ",");
|
||||||
PreferencesData.set("last.sketch" + index + ".location", locationStr);
|
PreferencesData.set("last.sketch" + index + ".location", location);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
PreferencesData.setInteger("last.sketch.count", index);
|
PreferencesData.setInteger("last.sketch.count", index);
|
||||||
@ -896,12 +897,7 @@ public class Base {
|
|||||||
// now that we're ready, show the window
|
// now that we're ready, show the window
|
||||||
// (don't do earlier, cuz we might move it based on a window being closed)
|
// (don't do earlier, cuz we might move it based on a window being closed)
|
||||||
if (showEditor) {
|
if (showEditor) {
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(() -> editor.setVisible(true));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
editor.setVisible(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return editor;
|
return editor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user