Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,10 @@ public void actionPerformed(ActionEvent actionevent) {
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);
Expand Down
6 changes: 6 additions & 0 deletions app/test/processing/app/debug/TargetPlatformStub.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,10 @@ public TargetBoard getBoard(String boardId) {
public TargetPackage getContainerPackage() {
return targetPackage;
}

@Override
public boolean isInSketchbook() {
// TODO Auto-generated method stub
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,9 @@ public String toString() {
res += " " + boardId + " = " + boards.get(boardId) + "\n";
return res + "}";
}

@Override
public boolean isInSketchbook() {
return getFolder().getAbsolutePath().startsWith(BaseNoGui.getSketchbookHardwareFolder().getAbsolutePath());
}
}
6 changes: 6 additions & 0 deletions arduino-core/src/processing/app/debug/TargetPlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}