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 {
10651065 private BoardPort port ;
10661066
10671067 public BoardPortJCheckBoxMenuItem (BoardPort port ) {
1068- super (port .getLabel ());
1068+ super ();
1069+ this .port = port ;
1070+ setText (toString ());
10691071 addActionListener (e -> {
10701072 selectSerialPort (port .getAddress (), port .getBoardId ());
10711073 if (port .getBoardId () != null && PreferencesData .getBoolean ("editor.autoselectboard" )) {
@@ -1076,13 +1078,16 @@ public BoardPortJCheckBoxMenuItem(BoardPort port) {
10761078 }
10771079 base .onBoardOrPortChange ();
10781080 });
1079- this .port = port ;
10801081 }
10811082
10821083 @ Override
10831084 public String toString () {
10841085 // 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 ;
10861091 }
10871092 }
10881093
Original file line number Diff line number Diff 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 boardPort .setBoardId (board .getId ());
204201 }
You can’t perform that action at this time.
0 commit comments