File tree 2 files changed +8
-6
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1041,18 +1041,23 @@ class BoardPortJCheckBoxMenuItem extends JCheckBoxMenuItem {
1041
1041
private BoardPort port ;
1042
1042
1043
1043
public BoardPortJCheckBoxMenuItem (BoardPort port ) {
1044
- super (port .getLabel ());
1044
+ super ();
1045
+ this .port = port ;
1046
+ setText (toString ());
1045
1047
addActionListener (e -> {
1046
1048
selectSerialPort (port .getAddress ());
1047
1049
base .onBoardOrPortChange ();
1048
1050
});
1049
- this .port = port ;
1050
1051
}
1051
1052
1052
1053
@ Override
1053
1054
public String toString () {
1054
1055
// This is required for serialPrompt()
1055
- return port .getLabel ();
1056
+ String label = port .getLabel ();
1057
+ if (port .getBoardName () != null && !port .getBoardName ().isEmpty ()) {
1058
+ label += " (" + port .getBoardName () + ")" ;
1059
+ }
1060
+ return label ;
1056
1061
}
1057
1062
}
1058
1063
Original file line number Diff line number Diff line change @@ -196,9 +196,6 @@ public synchronized void forceRefresh() {
196
196
TargetBoard board = (TargetBoard ) boardData .get ("board" );
197
197
if (board != null ) {
198
198
String boardName = board .getName ();
199
- if (boardName != null ) {
200
- label += " (" + boardName + ")" ;
201
- }
202
199
boardPort .setBoardName (boardName );
203
200
}
204
201
} else {
You can’t perform that action at this time.
0 commit comments