File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -559,6 +559,36 @@ protected boolean restoreSketches() throws Exception {
559559 return (opened > 0);
560560 }
561561
562+ protected boolean restoreRecentlyUsedBoards() throws Exception {
563+ // Iterate through all sketches that were open last time p5 was running.
564+ // If !windowPositionValid, then ignore the coordinates found for each.
565+
566+ // Save the sketch path and window placement for each open sketch
567+ int count = PreferencesData.getInteger("last.recent_boards.count");
568+ int opened = 0;
569+ for (int i = count - 1; i >= 0; i--) {
570+ String fqbn = PreferencesData.get("last.recent_board" + i + ".fqbn");
571+ if (fqbn == null) {
572+ continue;
573+ }
574+ //selectTargetBoard(new TargetBoard());
575+ }
576+ return count != 0;
577+ }
578+
579+ /**
580+ * Store list of sketches that are currently open.
581+ * Called when the application is quitting and documents are still open.
582+ */
583+ protected void storeRecentlyUsedBoards() {
584+ int i = 0;
585+ for (TargetBoard board : BaseNoGui.getRecentlyUsedBoards()) {
586+ PreferencesData.set("last.recent_board" + i + ".fqbn", board.getFQBN());
587+ i++;
588+ }
589+ PreferencesData.setInteger("last.recent_boards.count", BaseNoGui.getRecentlyUsedBoards().size());
590+ }
591+
562592 /**
563593 * Store screen dimensions on last close
564594 */
You can’t perform that action at this time.
0 commit comments