diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 233178ac0..ff6ac2621 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -92,7 +92,7 @@ public class Base { static private boolean commandLine; // A single instance of the preferences window - Preferences preferencesFrame; + PreferencesFrame preferencesFrame; // A single instance of the library manager window ContributionManagerDialog libraryManagerFrame; @@ -353,7 +353,7 @@ public class Base { // removeDir(contrib.getFolder()); // } // } - ContributionManager.cleanup(); + ContributionManager.cleanup(this); buildCoreModes(); rebuildContribModes(); @@ -749,9 +749,11 @@ public class Base { throw new IOException(newbieFile + " already exists."); } - // Create sketch properties. - saveModeSettings(new File(newbieDir, "sketch.properties"), nextMode); - + // Create sketch properties file if it's not a default mode. + if (!isDefaultMode(nextMode)) { + saveModeSettings(new File(newbieDir, "sketch.properties"), nextMode); + } + String path = newbieFile.getAbsolutePath(); /*Editor editor =*/ handleOpen(path, true); @@ -773,6 +775,20 @@ public class Base { System.err.println("While creating " + sketchProps + ": " + e.getMessage()); } } + + /** + * Is it a default mode? + * @param mode + * @return + */ + public boolean isDefaultMode(Mode mode) { + for (int i = 0; i < coreModes.length; i++) { + if (mode.equals(coreModes[i])) { + return true; + } + } + return false; + } // /** @@ -1126,7 +1142,7 @@ public class Base { // If the central menubar isn't supported on this OS X JVM, // we have to do the old behavior. Yuck! if (defaultFileMenu == null) { - Object[] options = { "OK", "Cancel" }; + Object[] options = { Language.text("prompt.ok"), Language.text("prompt.cancel") }; String prompt = " " + "