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 @@ -1065,7 +1065,9 @@ class BoardPortJCheckBoxMenuItem extends JCheckBoxMenuItem {
1065
1065
private BoardPort port ;
1066
1066
1067
1067
public BoardPortJCheckBoxMenuItem (BoardPort port ) {
1068
- super (port .getLabel ());
1068
+ super ();
1069
+ this .port = port ;
1070
+ setText (toString ());
1069
1071
addActionListener (e -> {
1070
1072
selectSerialPort (port .getAddress (), port .getBoardId ());
1071
1073
if (port .getBoardId () != null && PreferencesData .getBoolean ("editor.autoselectboard" )) {
@@ -1076,13 +1078,16 @@ public BoardPortJCheckBoxMenuItem(BoardPort port) {
1076
1078
}
1077
1079
base .onBoardOrPortChange ();
1078
1080
});
1079
- this .port = port ;
1080
1081
}
1081
1082
1082
1083
@ Override
1083
1084
public String toString () {
1084
1085
// This is required for serialPrompt()
1085
- return port .getLabel ();
1086
+ String label = port .getLabel ();
1087
+ if (port .getBoardName () != null && !port .getBoardName ().isEmpty ()) {
1088
+ label += " (" + port .getBoardName () + ")" ;
1089
+ }
1090
+ return label ;
1086
1091
}
1087
1092
}
1088
1093
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
boardPort .setBoardId (board .getId ());
204
201
}
You can’t perform that action at this time.
0 commit comments