@@ -264,35 +264,6 @@ public Base(String[] args) throws Exception {
264
264
265
265
parser .parseArgumentsPhase2 ();
266
266
267
- for (String path : parser .getFilenames ()) {
268
- // Correctly resolve relative paths
269
- File file = absoluteFile (path );
270
-
271
- // Fix a problem with systems that use a non-ASCII languages. Paths are
272
- // being passed in with 8.3 syntax, which makes the sketch loader code
273
- // unhappy, since the sketch folder naming doesn't match up correctly.
274
- // http://dev.processing.org/bugs/show_bug.cgi?id=1089
275
- if (OSUtils .isWindows ()) {
276
- try {
277
- file = file .getCanonicalFile ();
278
- } catch (IOException e ) {
279
- e .printStackTrace ();
280
- }
281
- }
282
-
283
- boolean showEditor = parser .isGuiMode ();
284
- if (!parser .isForceSavePrefs ())
285
- PreferencesData .setDoSave (showEditor );
286
- if (handleOpen (file , retrieveSketchLocation (".default" ), showEditor , false ) == null ) {
287
- String mess = I18n .format (tr ("Failed to open sketch: \" {0}\" " ), path );
288
- // Open failure is fatal in upload/verify mode
289
- if (parser .isVerifyOrUploadMode ())
290
- showError (null , mess , 2 );
291
- else
292
- showWarning (null , mess , null );
293
- }
294
- }
295
-
296
267
// Save the preferences. For GUI mode, this happens in the quit
297
268
// handler, but for other modes we should also make sure to save
298
269
// them.
@@ -408,6 +379,35 @@ public Base(String[] args) throws Exception {
408
379
} else if (parser .isGuiMode ()) {
409
380
splash .splashText (tr ("Starting..." ));
410
381
382
+ for (String path : parser .getFilenames ()) {
383
+ // Correctly resolve relative paths
384
+ File file = absoluteFile (path );
385
+
386
+ // Fix a problem with systems that use a non-ASCII languages. Paths are
387
+ // being passed in with 8.3 syntax, which makes the sketch loader code
388
+ // unhappy, since the sketch folder naming doesn't match up correctly.
389
+ // http://dev.processing.org/bugs/show_bug.cgi?id=1089
390
+ if (OSUtils .isWindows ()) {
391
+ try {
392
+ file = file .getCanonicalFile ();
393
+ } catch (IOException e ) {
394
+ e .printStackTrace ();
395
+ }
396
+ }
397
+
398
+ boolean showEditor = parser .isGuiMode ();
399
+ if (!parser .isForceSavePrefs ())
400
+ PreferencesData .setDoSave (showEditor );
401
+ if (handleOpen (file , retrieveSketchLocation (".default" ), showEditor , false ) == null ) {
402
+ String mess = I18n .format (tr ("Failed to open sketch: \" {0}\" " ), path );
403
+ // Open failure is fatal in upload/verify mode
404
+ if (parser .isVerifyOrUploadMode ())
405
+ showError (null , mess , 2 );
406
+ else
407
+ showWarning (null , mess , null );
408
+ }
409
+ }
410
+
411
411
installKeyboardInputMap ();
412
412
413
413
// Check if there were previously opened sketches to be restored
0 commit comments