mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-01 21:52:12 +01:00
Boards Menu: add hint if core lives in sketchbook
This commit is contained in:
parent
ca20093472
commit
8c91692845
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user