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
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
Prepare for LRU persistency
  • Loading branch information
facchinm committed Mar 8, 2019
commit c0710e0309577d01b4e70ed6a43e25f779c4bb42
30 changes: 30 additions & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,36 @@ protected boolean restoreSketches() throws Exception {
return (opened > 0);
}

protected boolean restoreRecentlyUsedBoards() throws Exception {
// Iterate through all sketches that were open last time p5 was running.
// If !windowPositionValid, then ignore the coordinates found for each.

// Save the sketch path and window placement for each open sketch
int count = PreferencesData.getInteger("last.recent_boards.count");
int opened = 0;
for (int i = count - 1; i >= 0; i--) {
String fqbn = PreferencesData.get("last.recent_board" + i + ".fqbn");
if (fqbn == null) {
continue;
}
//selectTargetBoard(new TargetBoard());
}
return count != 0;
}

/**
* Store list of sketches that are currently open.
* Called when the application is quitting and documents are still open.
*/
protected void storeRecentlyUsedBoards() {
int i = 0;
for (TargetBoard board : BaseNoGui.getRecentlyUsedBoards()) {
PreferencesData.set("last.recent_board" + i + ".fqbn", board.getFQBN());
i++;
}
PreferencesData.setInteger("last.recent_boards.count", BaseNoGui.getRecentlyUsedBoards().size());
}

/**
* Store screen dimensions on last close
*/
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy