mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 09:39:19 +01:00
move location of prefs and sketchbook, fixed nasty bugs
This commit is contained in:
@@ -56,7 +56,7 @@ public class PdePreferences extends JComponent {
|
||||
|
||||
// what to call the feller
|
||||
|
||||
static final String PREFS_FILE = "Processing Preferences.txt";
|
||||
static final String PREFS_FILE = "preferences.txt";
|
||||
|
||||
// prompt text stuff
|
||||
|
||||
@@ -143,8 +143,10 @@ public class PdePreferences extends JComponent {
|
||||
|
||||
// next load user preferences file
|
||||
|
||||
File home = new File(System.getProperty("user.home"));
|
||||
preferencesFile = new File(home, PREFS_FILE);
|
||||
//File home = new File(System.getProperty("user.home"));
|
||||
//File processingHome = new File(home, "Processing");
|
||||
//preferencesFile = new File(home, PREFS_FILE);
|
||||
preferencesFile = new File(getProcessingHome(), PREFS_FILE);
|
||||
|
||||
if (!preferencesFile.exists()) {
|
||||
// create a new preferences file if none exists
|
||||
@@ -512,6 +514,26 @@ public class PdePreferences extends JComponent {
|
||||
// .................................................................
|
||||
|
||||
|
||||
static public File getProcessingHome() {
|
||||
File home = new File(System.getProperty("user.home"));
|
||||
|
||||
if (PdeBase.platform == PdeBase.MACOSX) {
|
||||
// on macosx put the sketchbook in the "Documents" folder
|
||||
return new File(home, "Documents" + File.separator + "Processing");
|
||||
|
||||
} else if (PdeBase.platform == PdeBase.WINDOWS) {
|
||||
// on windows put the sketchbook in the "My Documents" folder
|
||||
return new File(home, "My Documents" + File.separator + "Processing");
|
||||
}
|
||||
|
||||
// all others, just say home directory
|
||||
return new File(home, "processing");
|
||||
}
|
||||
|
||||
|
||||
// .................................................................
|
||||
|
||||
|
||||
// all the information from preferences.txt
|
||||
|
||||
//static public String get(String attribute) {
|
||||
|
||||
Reference in New Issue
Block a user