File tree 2 files changed +11
-12
lines changed
2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -2587,12 +2587,7 @@ private void statusEmpty() {
2587
2587
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2588
2588
2589
2589
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 ();
2596
2591
lineStatus .repaint ();
2597
2592
}
2598
2593
Original file line number Diff line number Diff line change @@ -92,12 +92,7 @@ public void set(int newStart, int newStop) {
92
92
public void paintComponent (Graphics graphics ) {
93
93
Graphics2D g = Theme .setupGraphics2D (graphics );
94
94
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 ();
101
96
}
102
97
g .setColor (background );
103
98
Dimension size = getSize ();
@@ -146,4 +141,13 @@ public Dimension getMinimumSize() {
146
141
public Dimension getMaximumSize () {
147
142
return scale (new Dimension (3000 , height ));
148
143
}
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
+ }
149
153
}
You can’t perform that action at this time.
0 commit comments