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