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();
|
||||
buttonGroupsMap = new HashMap<>();
|
||||
|
||||
boolean hasRecentBoardsMenu = (PreferencesData.getInteger("editor.recent_boards.size", 4) != 0);
|
||||
|
||||
if (hasRecentBoardsMenu) {
|
||||
JMenuItem recentLabel = new JMenuItem(tr("Recently used boards"));
|
||||
recentLabel.setEnabled(false);
|
||||
boardMenu.add(recentLabel);
|
||||
}
|
||||
|
||||
List<JMenu> platformMenus = new ArrayList<>();
|
||||
|
||||
|
@ -937,7 +937,7 @@ public class BaseNoGui {
|
||||
if (!recentlyUsedBoards.contains(targetBoard)) {
|
||||
recentlyUsedBoards.add(targetBoard);
|
||||
}
|
||||
if (recentlyUsedBoards.size() > 4) {
|
||||
if (recentlyUsedBoards.size() > PreferencesData.getInteger("editor.recent_boards.size", 4)) {
|
||||
recentlyUsedBoards.remove();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user