Changed dependency from Preferences to PreferencesData in processing.app.linux.Platform and processing.app.windows.Platform.

This commit is contained in:
Claudio Indellicati 2014-08-21 15:25:47 +02:00 committed by Cristian Maglie
parent c666274bf9
commit e83462b508
2 changed files with 11 additions and 11 deletions

View File

@ -24,7 +24,7 @@ package processing.app.linux;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.Executor; import org.apache.commons.exec.Executor;
import processing.app.Preferences; import processing.app.PreferencesData;
import processing.app.debug.TargetPackage; import processing.app.debug.TargetPackage;
import processing.app.tools.ExternalProcessExecutor; import processing.app.tools.ExternalProcessExecutor;
import processing.app.legacy.PConstants; import processing.app.legacy.PConstants;
@ -64,7 +64,7 @@ public class Platform extends processing.app.Platform {
public void openURL(String url) throws Exception { public void openURL(String url) throws Exception {
if (openFolderAvailable()) { if (openFolderAvailable()) {
String launcher = Preferences.get("launcher"); String launcher = PreferencesData.get("launcher");
if (launcher != null) { if (launcher != null) {
Runtime.getRuntime().exec(new String[] { launcher, url }); Runtime.getRuntime().exec(new String[] { launcher, url });
} }
@ -73,7 +73,7 @@ public class Platform extends processing.app.Platform {
public boolean openFolderAvailable() { public boolean openFolderAvailable() {
if (Preferences.get("launcher") != null) { if (PreferencesData.get("launcher") != null) {
return true; return true;
} }
@ -81,7 +81,7 @@ public class Platform extends processing.app.Platform {
try { try {
Process p = Runtime.getRuntime().exec(new String[] { "xdg-open" }); Process p = Runtime.getRuntime().exec(new String[] { "xdg-open" });
p.waitFor(); p.waitFor();
Preferences.set("launcher", "xdg-open"); PreferencesData.set("launcher", "xdg-open");
return true; return true;
} catch (Exception e) { } } catch (Exception e) { }
@ -90,7 +90,7 @@ public class Platform extends processing.app.Platform {
Process p = Runtime.getRuntime().exec(new String[] { "gnome-open" }); Process p = Runtime.getRuntime().exec(new String[] { "gnome-open" });
p.waitFor(); p.waitFor();
// Not installed will throw an IOException (JDK 1.4.2, Ubuntu 7.04) // Not installed will throw an IOException (JDK 1.4.2, Ubuntu 7.04)
Preferences.set("launcher", "gnome-open"); PreferencesData.set("launcher", "gnome-open");
return true; return true;
} catch (Exception e) { } } catch (Exception e) { }
@ -98,7 +98,7 @@ public class Platform extends processing.app.Platform {
try { try {
Process p = Runtime.getRuntime().exec(new String[] { "kde-open" }); Process p = Runtime.getRuntime().exec(new String[] { "kde-open" });
p.waitFor(); p.waitFor();
Preferences.set("launcher", "kde-open"); PreferencesData.set("launcher", "kde-open");
return true; return true;
} catch (Exception e) { } } catch (Exception e) { }
@ -108,7 +108,7 @@ public class Platform extends processing.app.Platform {
public void openFolder(File file) throws Exception { public void openFolder(File file) throws Exception {
if (openFolderAvailable()) { if (openFolderAvailable()) {
String launcher = Preferences.get("launcher"); String launcher = PreferencesData.get("launcher");
try { try {
String[] params = new String[] { launcher, file.getAbsolutePath() }; String[] params = new String[] { launcher, file.getAbsolutePath() };
//processing.core.PApplet.println(params); //processing.core.PApplet.println(params);

View File

@ -29,7 +29,7 @@ import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.Executor; import org.apache.commons.exec.Executor;
import processing.app.Base; import processing.app.Base;
import processing.app.Preferences; import processing.app.PreferencesData;
import processing.app.debug.TargetPackage; import processing.app.debug.TargetPackage;
import processing.app.legacy.PApplet; import processing.app.legacy.PApplet;
import processing.app.legacy.PConstants; import processing.app.legacy.PConstants;
@ -74,13 +74,13 @@ public class Platform extends processing.app.Platform {
Registry.getStringValue(REGISTRY_ROOT_KEY.CLASSES_ROOT, Registry.getStringValue(REGISTRY_ROOT_KEY.CLASSES_ROOT,
DOC + "\\shell\\open\\command", ""); DOC + "\\shell\\open\\command", "");
if (knownCommand == null) { if (knownCommand == null) {
if (Preferences.getBoolean("platform.auto_file_type_associations")) { if (PreferencesData.getBoolean("platform.auto_file_type_associations")) {
setAssociations(); setAssociations();
} }
} else if (!knownCommand.equals(openCommand)) { } else if (!knownCommand.equals(openCommand)) {
// If the value is set differently, just change the registry setting. // If the value is set differently, just change the registry setting.
if (Preferences.getBoolean("platform.auto_file_type_associations")) { if (PreferencesData.getBoolean("platform.auto_file_type_associations")) {
setAssociations(); setAssociations();
} }
} }
@ -116,7 +116,7 @@ public class Platform extends processing.app.Platform {
// hooray! // hooray!
} else { } else {
Preferences.setBoolean("platform.auto_file_type_associations", false); PreferencesData.setBoolean("platform.auto_file_type_associations", false);
} }
} }