mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Added .getParentFile() to saveas for mac. This prevents saving into the sketch itself
This commit is contained in:
@ -641,7 +641,14 @@ public class Sketch {
|
|||||||
fd.setSelectedFile(new File(Base.getSketchbookFolder().getAbsolutePath(), data.getFolder().getName()));
|
fd.setSelectedFile(new File(Base.getSketchbookFolder().getAbsolutePath(), data.getFolder().getName()));
|
||||||
} else {
|
} else {
|
||||||
// default to the parent folder of where this was
|
// default to the parent folder of where this was
|
||||||
fd.setSelectedFile(data.getFolder());
|
// 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);
|
int returnVal = fd.showSaveDialog(editor);
|
||||||
|
Reference in New Issue
Block a user