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 {
10331033 private BoardPort port ;
10341034
10351035 public BoardPortJCheckBoxMenuItem (BoardPort port ) {
1036- super (port .getLabel ());
1036+ super ();
1037+ this .port = port ;
1038+ setText (toString ());
10371039 addActionListener (e -> {
10381040 selectSerialPort (port .getAddress ());
10391041 base .onBoardOrPortChange ();
10401042 });
1041- this .port = port ;
10421043 }
10431044
10441045 @ Override
10451046 public String toString () {
10461047 // 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 ;
10481053 }
10491054 }
10501055
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