diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 7af728fdd..34193e07d 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1494,6 +1494,10 @@ public class Base { if (platformLabel == null) platformLabel = targetPackage.getId() + "-" + targetPlatform.getId(); + // add an hint that this core lives in sketchbook + if (targetPlatform.isInSketchbook()) + platformLabel += " (in sketchbook)"; + JMenu platformBoardsMenu = new JMenu(platformLabel); MenuScroller.setScrollerFor(platformBoardsMenu); platformMenus.add(platformBoardsMenu); 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(); }