Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2587,12 +2587,7 @@ private void statusEmpty() {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

protected void onBoardOrPortChange() {
TargetBoard board = BaseNoGui.getTargetBoard();
if (board != null)
lineStatus.setBoardName(board.getName());
else
lineStatus.setBoardName("-");
lineStatus.setPort(PreferencesData.get("serial.port"));
lineStatus.updateBoardAndPort();
lineStatus.repaint();
}

Expand Down
16 changes: 10 additions & 6 deletions app/src/processing/app/EditorLineStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,7 @@ public void set(int newStart, int newStop) {
public void paintComponent(Graphics graphics) {
Graphics2D g = Theme.setupGraphics2D(graphics);
if (name.isEmpty() && port.isEmpty()) {
PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences();
if (boardPreferences != null)
setBoardName(boardPreferences.get("name"));
else
setBoardName("-");
setPort(PreferencesData.get("serial.port"));
updateBoardAndPort();
}
g.setColor(background);
Dimension size = getSize();
Expand Down Expand Up @@ -146,4 +141,13 @@ public Dimension getMinimumSize() {
public Dimension getMaximumSize() {
return scale(new Dimension(3000, height));
}

public void updateBoardAndPort() {
PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences();
if (boardPreferences != null)
setBoardName(boardPreferences.get("name"));
else
setBoardName("-");
setPort(PreferencesData.get("serial.port"));
}
}