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