mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +01:00
Make Recently used boards size configurable from preferences
This commit is contained in:
parent
14e59208b3
commit
ddd876ca4e
@ -1549,9 +1549,13 @@ public class Base {
|
|||||||
recentBoardsButtonGroup = new ButtonGroup();
|
recentBoardsButtonGroup = new ButtonGroup();
|
||||||
buttonGroupsMap = new HashMap<>();
|
buttonGroupsMap = new HashMap<>();
|
||||||
|
|
||||||
JMenuItem recentLabel = new JMenuItem(tr("Recently used boards"));
|
boolean hasRecentBoardsMenu = (PreferencesData.getInteger("editor.recent_boards.size", 4) != 0);
|
||||||
recentLabel.setEnabled(false);
|
|
||||||
boardMenu.add(recentLabel);
|
if (hasRecentBoardsMenu) {
|
||||||
|
JMenuItem recentLabel = new JMenuItem(tr("Recently used boards"));
|
||||||
|
recentLabel.setEnabled(false);
|
||||||
|
boardMenu.add(recentLabel);
|
||||||
|
}
|
||||||
|
|
||||||
List<JMenu> platformMenus = new ArrayList<>();
|
List<JMenu> platformMenus = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -937,7 +937,7 @@ public class BaseNoGui {
|
|||||||
if (!recentlyUsedBoards.contains(targetBoard)) {
|
if (!recentlyUsedBoards.contains(targetBoard)) {
|
||||||
recentlyUsedBoards.add(targetBoard);
|
recentlyUsedBoards.add(targetBoard);
|
||||||
}
|
}
|
||||||
if (recentlyUsedBoards.size() > 4) {
|
if (recentlyUsedBoards.size() > PreferencesData.getInteger("editor.recent_boards.size", 4)) {
|
||||||
recentlyUsedBoards.remove();
|
recentlyUsedBoards.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user