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 @@ -1041,18 +1041,23 @@ class BoardPortJCheckBoxMenuItem extends JCheckBoxMenuItem {
10411041 private BoardPort port ;
10421042
10431043 public BoardPortJCheckBoxMenuItem (BoardPort port ) {
1044- super (port .getLabel ());
1044+ super ();
1045+ this .port = port ;
1046+ setText (toString ());
10451047 addActionListener (e -> {
10461048 selectSerialPort (port .getAddress ());
10471049 base .onBoardOrPortChange ();
10481050 });
1049- this .port = port ;
10501051 }
10511052
10521053 @ Override
10531054 public String toString () {
10541055 // 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 ;
10561061 }
10571062 }
10581063
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 }
204201 } else {
You can’t perform that action at this time.
0 commit comments