@@ -424,10 +424,9 @@ public Base(String[] args) throws Exception {
424
424
}
425
425
}
426
426
427
- boolean showEditor = parser .isGuiMode ();
428
427
if (!parser .isForceSavePrefs ())
429
- PreferencesData .setDoSave (showEditor );
430
- if (handleOpen (file , retrieveSketchLocation (".default" ), showEditor , false ) == null ) {
428
+ PreferencesData .setDoSave (true );
429
+ if (handleOpen (file , retrieveSketchLocation (".default" ), false ) == null ) {
431
430
String mess = I18n .format (tr ("Failed to open sketch: \" {0}\" " ), path );
432
431
// Open failure is fatal in upload/verify mode
433
432
if (parser .isVerifyOrUploadMode ())
@@ -502,7 +501,7 @@ protected boolean restoreSketches() throws Exception {
502
501
}
503
502
int [] location = retrieveSketchLocation ("" + i );
504
503
// If file did not exist, null will be returned for the Editor
505
- if (handleOpen (new File (path ), location , nextEditorLocation (), true , false , false ) != null ) {
504
+ if (handleOpen (new File (path ), location , nextEditorLocation (), false , false ) != null ) {
506
505
opened ++;
507
506
}
508
507
}
@@ -794,14 +793,14 @@ public Editor handleOpen(File file) throws Exception {
794
793
}
795
794
796
795
public Editor handleOpen (File file , boolean untitled ) throws Exception {
797
- return handleOpen (file , nextEditorLocation (), true , untitled );
796
+ return handleOpen (file , nextEditorLocation (), untitled );
798
797
}
799
798
800
- protected Editor handleOpen (File file , int [] location , boolean showEditor , boolean untitled ) throws Exception {
801
- return handleOpen (file , location , location , showEditor , true , untitled );
799
+ protected Editor handleOpen (File file , int [] location , boolean untitled ) throws Exception {
800
+ return handleOpen (file , location , location , true , untitled );
802
801
}
803
802
804
- protected Editor handleOpen (File file , int [] storedLocation , int [] defaultLocation , boolean showEditor , boolean storeOpenedSketches , boolean untitled ) throws Exception {
803
+ protected Editor handleOpen (File file , int [] storedLocation , int [] defaultLocation , boolean storeOpenedSketches , boolean untitled ) throws Exception {
805
804
if (!file .exists ()) return null ;
806
805
807
806
// Cycle through open windows to make sure that it's not already open.
@@ -834,9 +833,7 @@ protected Editor handleOpen(File file, int[] storedLocation, int[] defaultLocati
834
833
835
834
// now that we're ready, show the window
836
835
// (don't do earlier, cuz we might move it based on a window being closed)
837
- if (showEditor ) {
838
- SwingUtilities .invokeLater (() -> editor .setVisible (true ));
839
- }
836
+ SwingUtilities .invokeLater (() -> editor .setVisible (true ));
840
837
841
838
return editor ;
842
839
}
0 commit comments