@@ -75,9 +75,6 @@ static public void init() {
7575 // This ensures that any new/added preference will be present.
7676 defaults = new HashMap <>(table );
7777
78- // other things that have to be set explicitly for the defaults
79- setColor ("run.window.bgcolor" , SystemColor .control ); //$NON-NLS-1$
80-
8178 // next load user preferences file
8279 preferencesFile = Base .getSettingsFile (PREFS_FILE );
8380 boolean firstRun = !preferencesFile .exists ();
@@ -94,31 +91,12 @@ static public void init() {
9491 }
9592 }
9693
97- if (checkSketchbookPref () || firstRun ) {
98- // if (firstRun) {
94+ if (firstRun ) {
9995 // create a new preferences file if none exists
10096 // saves the defaults out to the file
10197 save ();
10298 }
10399
104- PApplet .useNativeSelect =
105- Preferences .getBoolean ("chooser.files.native" ); //$NON-NLS-1$
106-
107- // Adding option to disable this in case it's getting in the way
108- if (get ("proxy.system" ).equals ("true" )) {
109- // Use the system proxy settings by default
110- // https://github.com/processing/processing/issues/2643
111- System .setProperty ("java.net.useSystemProxies" , "true" );
112- }
113-
114- // Set HTTP, HTTPS, and SOCKS proxies for individuals
115- // who want/need to override the system setting
116- // http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
117- // Less readable version with the Oracle style sheet:
118- // http://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
119- handleProxy ("http" , "http.proxyHost" , "http.proxyPort" );
120- handleProxy ("https" , "https.proxyHost" , "https.proxyPort" );
121- handleProxy ("socks" , "socksProxyHost" , "socksProxyPort" );
122100 }
123101
124102
@@ -130,18 +108,6 @@ static public void skipInit() {
130108 }
131109
132110
133- static void handleProxy (String protocol , String hostProp , String portProp ) {
134- String proxyHost = get ("proxy." + protocol + ".host" );
135- String proxyPort = get ("proxy." + protocol + ".port" );
136- if (proxyHost != null && proxyHost .length () != 0 &&
137- proxyPort != null && proxyPort .length () != 0 ) {
138- System .setProperty (hostProp , proxyHost );
139- System .setProperty (portProp , proxyPort );
140- }
141-
142- }
143-
144-
145111 static public String getPreferencesPath () {
146112 return preferencesFile .getAbsolutePath ();
147113 }
@@ -339,42 +305,4 @@ static public void setColor(String attr, Color what) {
339305 set (attr , "#" + PApplet .hex (what .getRGB () & 0xffffff , 6 )); //$NON-NLS-1$
340306 }
341307
342-
343-
344- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
345-
346-
347- /**
348- * Check for a 4.0 sketchbook location, and if none exists,
349- * try to grab it from the 3.0 sketchbook location.
350- * @return true if a location was found and the pref didn't exist
351- */
352- static protected boolean checkSketchbookPref () {
353- // If a 4.0 sketchbook location has never been inited
354- if (getSketchbookPath () == null ) {
355- String threePath = get ("sketchbook.path.three" ); //$NON-NLS-1$
356- // If they've run the 3.0 version, start with that location
357- if (threePath != null ) {
358- setSketchbookPath (threePath );
359- return true ; // save the sketchbook right away
360- }
361- // Otherwise it'll be null, and reset properly by Base
362- }
363- return false ;
364- }
365-
366-
367- static public String getOldSketchbookPath () {
368- return get ("sketchbook.path.three" ); //$NON-NLS-1$
369- }
370-
371-
372- static public String getSketchbookPath () {
373- return get ("sketchbook.path.four" ); //$NON-NLS-1$
374- }
375-
376-
377- public static void setSketchbookPath (String path ) {
378- set ("sketchbook.path.four" , path ); //$NON-NLS-1$
379- }
380308}
0 commit comments