File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -2587,12 +2587,7 @@ private void statusEmpty() {
25872587 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25882588
25892589 protected void onBoardOrPortChange () {
2590- TargetBoard board = BaseNoGui .getTargetBoard ();
2591- if (board != null )
2592- lineStatus .setBoardName (board .getName ());
2593- else
2594- lineStatus .setBoardName ("-" );
2595- lineStatus .setPort (PreferencesData .get ("serial.port" ));
2590+ lineStatus .updateBoardAndPort ();
25962591 lineStatus .repaint ();
25972592 }
25982593
Original file line number Diff line number Diff line change @@ -92,12 +92,7 @@ public void set(int newStart, int newStop) {
9292 public void paintComponent (Graphics graphics ) {
9393 Graphics2D g = Theme .setupGraphics2D (graphics );
9494 if (name .isEmpty () && port .isEmpty ()) {
95- PreferencesMap boardPreferences = BaseNoGui .getBoardPreferences ();
96- if (boardPreferences != null )
97- setBoardName (boardPreferences .get ("name" ));
98- else
99- setBoardName ("-" );
100- setPort (PreferencesData .get ("serial.port" ));
95+ updateBoardAndPort ();
10196 }
10297 g .setColor (background );
10398 Dimension size = getSize ();
@@ -146,4 +141,13 @@ public Dimension getMinimumSize() {
146141 public Dimension getMaximumSize () {
147142 return scale (new Dimension (3000 , height ));
148143 }
144+
145+ public void updateBoardAndPort () {
146+ PreferencesMap boardPreferences = BaseNoGui .getBoardPreferences ();
147+ if (boardPreferences != null )
148+ setBoardName (boardPreferences .get ("name" ));
149+ else
150+ setBoardName ("-" );
151+ setPort (PreferencesData .get ("serial.port" ));
152+ }
149153}
You can’t perform that action at this time.
0 commit comments