1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Show BoardName.boardName field in 'Ports' menu

...instead of putting it into the 'label' field during discovery.
This commit is contained in:
Cristian Maglie 2018-11-23 12:35:59 +01:00
parent ec4787a92b
commit 9ba172b0db
2 changed files with 8 additions and 6 deletions

View File

@ -1041,18 +1041,23 @@ public class Editor extends JFrame implements RunnerListener {
private BoardPort port;
public BoardPortJCheckBoxMenuItem(BoardPort port) {
super(port.getLabel());
super();
this.port = port;
setText(toString());
addActionListener(e -> {
selectSerialPort(port.getAddress());
base.onBoardOrPortChange();
});
this.port = port;
}
@Override
public String toString() {
// This is required for serialPrompt()
return port.getLabel();
String label = port.getLabel();
if (port.getBoardName() != null && !port.getBoardName().isEmpty()) {
label += " (" + port.getBoardName() + ")";
}
return label;
}
}

View File

@ -196,9 +196,6 @@ public class SerialDiscovery implements Discovery, Runnable {
TargetBoard board = (TargetBoard) boardData.get("board");
if (board != null) {
String boardName = board.getName();
if (boardName != null) {
label += " (" + boardName + ")";
}
boardPort.setBoardName(boardName);
}
} else {