8000 Add per-session recently used boards list by facchinm · Pull Request #8607 · arduino/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Add per-session recently used boards list #8607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Make Recently used boards size configurable from preferences
  • Loading branch information
facchinm committed Mar 8, 2019
commit b21cfa00e93d127c84b73d5d9ce60f289ff074e0
10 changes: 7 additions & 3 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -1518,9 +1518,13 @@ public void actionPerformed(ActionEvent actionevent) {
recentBoardsButtonGroup = new ButtonGroup();
buttonGro 8000 upsMap = new HashMap<>();

JMenuItem recentLabel = new JMenuItem(tr("Recently used boards"));
recentLabel.setEnabled(false);
boardMenu.add(recentLabel);
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);
}

// Cycle through all packages
for (TargetPackage targetPackage : BaseNoGui.packages.values()) {
Expand Down
2 changes: 1 addition & 1 deletion arduino-core/src/processing/app/BaseNoGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ static public void selectBoard(TargetBoard targetBoard) {
if (!recentlyUsedBoards.contains(targetBoard)) {
recentlyUsedBoards.add(targetBoard);
}
if (recentlyUsedBoards.size() > 4) {
if (recentlyUsedBoards.size() > PreferencesData.getInteger("editor.recent_boards.size", 4)) {
recentlyUsedBoards.remove();
}
}
Expand Down
0