diff options
author | Martino Facchin <m.facchin@arduino.cc> | 2020-04-07 11:14:35 +0300 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2020-04-27 18:04:49 +0300 |
commit | 8c916928458a8368b847509356f8fd4de8a57569 (patch) | |
tree | 14d02c627b3a4a5cf6ce9f9b2414bfbd20b09ebc /arduino-core | |
parent | ca200934721883ff5e86067291fbbc42ca159ef8 (diff) |
Boards Menu: add hint if core lives in sketchbook
Diffstat (limited to 'arduino-core')
-rw-r--r-- | arduino-core/src/processing/app/debug/LegacyTargetPlatform.java | 5 | ||||
-rw-r--r-- | arduino-core/src/processing/app/debug/TargetPlatform.java | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java b/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java index c00378c48..ad1030b8f 100644 --- a/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java +++ b/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java @@ -245,4 +245,9 @@ public class LegacyTargetPlatform implements TargetPlatform { res += " " + boardId + " = " + boards.get(boardId) + "\n"; return res + "}"; } + + @Override + public boolean isInSketchbook() { + return getFolder().getAbsolutePath().startsWith(BaseNoGui.getDefaultSketchbookFolder().getAbsolutePath()); + } } diff --git a/arduino-core/src/processing/app/debug/TargetPlatform.java b/arduino-core/src/processing/app/debug/TargetPlatform.java index 4b13cf87a..330b260bb 100644 --- a/arduino-core/src/processing/app/debug/TargetPlatform.java +++ b/arduino-core/src/processing/app/debug/TargetPlatform.java @@ -94,4 +94,10 @@ public interface TargetPlatform { */ public TargetPackage getContainerPackage(); + /** + * Returns true if the platform is installed in a subfolder of the sketchbook + * + * @return + */ + public boolean isInSketchbook(); } |