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,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) {
|
||||
|
Reference in New Issue
Block a user