1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-26 20:54:22 +01:00

Added .getParentFile() to saveas for mac. This prevents saving into the sketch itself

This commit is contained in:
Ivo van de Grift 2015-02-27 17:35:14 +01:00
parent a4e8473e53
commit 58581e2eb1

View File

@ -641,9 +641,16 @@ public class Sketch {
fd.setSelectedFile(new File(Base.getSketchbookFolder().getAbsolutePath(), data.getFolder().getName()));
} else {
// default to the parent folder of where this was
// on macs a .getParentFile() method is required
if (OSUtils.isMacOS()) {
fd.setSelectedFile(data.getFolder().getParentFile());
} else {
fd.setSelectedFile(data.getFolder());
}
}
int returnVal = fd.showSaveDialog(editor);
if (returnVal != JFileChooser.APPROVE_OPTION) {