Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/arduino/Arduino.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authormaged <magedrifaat@gmail.com>2021-01-24 17:26:17 +0300
committermaged <magedrifaat@gmail.com>2021-01-24 17:26:17 +0300
commit5e7519473e16ef26134f8b83d1307aaaa3c952c1 (patch)
tree5225f7901b0dfa042ee59ade216761ab20aed201 /app
parentf4e8a91f101773c47481ae5444e7b4e32ddda0a4 (diff)
Fix status bar custom board preferences disappearing
Diffstat (limited to 'app')
-rw-r--r--app/src/processing/app/Editor.java7
-rw-r--r--app/src/processing/app/EditorLineStatus.java16
2 files changed, 11 insertions, 12 deletions
diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java
index 2ec29c498..3b3ab1371 100644
--- a/app/src/processing/app/Editor.java
+++ b/app/src/processing/app/Editor.java
@@ -2587,12 +2587,7 @@ public class Editor extends JFrame implements RunnerListener {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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();
}
diff --git a/app/src/processing/app/EditorLineStatus.java b/app/src/processing/app/EditorLineStatus.java
index 7635437da..f768b597c 100644
--- a/app/src/processing/app/EditorLineStatus.java
+++ b/app/src/processing/app/EditorLineStatus.java
@@ -92,12 +92,7 @@ public class EditorLineStatus extends JComponent {
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();
@@ -146,4 +141,13 @@ public class EditorLineStatus extends JComponent {
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"));
+ }
}