File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1033,18 +1033,23 @@ class BoardPortJCheckBoxMenuItem extends JCheckBoxMenuItem {
1033
1033
private BoardPort port ;
1034
1034
1035
1035
public BoardPortJCheckBoxMenuItem (BoardPort port ) {
1036
- super (port .getLabel ());
1036
+ super ();
1037
+ this .port = port ;
1038
+ setText (toString ());
1037
1039
addActionListener (e -> {
1038
1040
selectSerialPort (port .getAddress ());
1039
1041
base .onBoardOrPortChange ();
1040
1042
});
1041
- this .port = port ;
1042
1043
}
1043
1044
1044
1045
@ Override
1045
1046
public String toString () {
1046
1047
// 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 ;
1048
1053
}
1049
1054
}
1050
1055
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