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:
parent
a4e8473e53
commit
58581e2eb1
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user