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