Skip to content

Commit e5887ab

Browse files
committed
Show BoardName.boardName field in 'Ports' menu
...instead of putting it into the 'label' field during discovery.
1 parent 5b39c80 commit e5887ab

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

app/src/processing/app/Editor.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,18 +1033,23 @@ class BoardPortJCheckBoxMenuItem extends JCheckBoxMenuItem {
10331033
private BoardPort port;
10341034

10351035
public BoardPortJCheckBoxMenuItem(BoardPort port) {
1036-
super(port.getLabel());
1036+
super();
1037+
this.port = port;
1038+
setText(toString());
10371039
addActionListener(e -> {
10381040
selectSerialPort(port.getAddress());
10391041
base.onBoardOrPortChange();
10401042
});
1041-
this.port = port;
10421043
}
10431044

10441045
@Override
10451046
public String toString() {
10461047
// This is required for serialPrompt()
1047-
return port.getLabel();
1048+
String label = port.getLabel();
1049+
if (port.getBoardName() != null && !port.getBoardName().isEmpty()) {
1050+
label += " (" + port.getBoardName() + ")";
1051+
}
1052+
return label;
10481053
}
10491054
}
10501055

arduino-core/src/cc/arduino/packages/discoverers/serial/SerialDiscovery.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ public synchronized void forceRefresh() {
196196
TargetBoard board = (TargetBoard) boardData.get("board");
197197
if (board != null) {
198198
String boardName = board.getName();
199-
if (boardName != null) {
200-
label += " (" + boardName + ")";
201-
}
202199
boardPort.setBoardName(boardName);
203200
}
204201
} else {

0 commit comments

Comments
 (0)