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