Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/arduino/Arduino.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartino Facchin <m.facchin@arduino.cc>2020-04-07 11:14:35 +0300
committerCristian Maglie <c.maglie@bug.st>2020-04-27 18:04:49 +0300
commit8c916928458a8368b847509356f8fd4de8a57569 (patch)
tree14d02c627b3a4a5cf6ce9f9b2414bfbd20b09ebc /arduino-core
parentca200934721883ff5e86067291fbbc42ca159ef8 (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.java5
-rw-r--r--arduino-core/src/processing/app/debug/TargetPlatform.java6
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();
}