X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FPlatform.java;h=5406ea960a09c406a13374017223b33de8693b19;hb=1ec5e836949b4106fceac0c3e817c502121fb6b6;hp=dc706f552745d7e3601986db4b4ca3c1fbbfac14;hpb=0adc0a8f84391f191e793f1903bf354408bdd416;p=org.ibex.core.git diff --git a/src/org/xwt/Platform.java b/src/org/xwt/Platform.java index dc706f5..5406ea9 100644 --- a/src/org/xwt/Platform.java +++ b/src/org/xwt/Platform.java @@ -34,7 +34,7 @@ public class Platform { static boolean alreadyDetectedProxy = false; /** the result of proxy autodetection */ - static HTTP.ProxyInfo cachedProxyInfo = null; + static Proxy cachedProxyInfo = null; /** the current build */ public static String build = "unknown"; @@ -201,7 +201,7 @@ public class Platform { } /** Returns null if XWT should always use direct connection; otherwise returns a ProxyInfo object with proxy settings */ - protected synchronized HTTP.ProxyInfo _detectProxy() { return null; } + protected synchronized Proxy _detectProxy() { return null; } /** displays a platform-specific "open file" dialog and returns the chosen filename, or null if the user hit cancel */ protected String _fileDialog(String suggestedFileName, boolean write) { return null; } @@ -214,9 +214,13 @@ public class Platform { try { String os = System.getProperty("os.name").toLowerCase(); Process p; - if (os.indexOf("windows 9") > -1) { + if (os.indexOf("windows 9") != -1 || os.indexOf("windows me") != -1) { + // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not + if (platform.getClass().getName().endsWith("Java12")) return null; p = Runtime.getRuntime().exec("command.com /c set"); - } else if ( (os.indexOf("nt") > -1) || (os.indexOf("windows 2000") > -1) ) { + } else if (os.indexOf("windows") > -1) { + // hack -- jdk1.2/1.3 on Win32 pop open an ugly DOS box; 1.4 does not + if (platform.getClass().getName().endsWith("Java12")) return null; p = Runtime.getRuntime().exec("cmd.exe /c set"); } else { p = Runtime.getRuntime().exec("env"); @@ -376,24 +380,20 @@ public class Platform { } /** detects proxy settings */ - public static synchronized HTTP.ProxyInfo detectProxy() { + public static synchronized Proxy detectProxy() { if (cachedProxyInfo != null) return cachedProxyInfo; if (alreadyDetectedProxy) return null; alreadyDetectedProxy = true; if (Log.on) Log.log(Platform.class, "attempting environment-variable DNS proxy detection"); - cachedProxyInfo = HTTP.ProxyInfo.detectProxyViaManual(); + cachedProxyInfo = Proxy.detectProxyViaManual(); if (cachedProxyInfo != null) return cachedProxyInfo; if (Log.on) Log.log(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection"); cachedProxyInfo = platform._detectProxy(); if (cachedProxyInfo != null) return cachedProxyInfo; - if (Log.on) Log.log(Platform.class, "attempting WPAD proxy detection"); - cachedProxyInfo = HTTP.ProxyInfo.detectProxyViaWPAD(); - if (cachedProxyInfo != null) return cachedProxyInfo; - return cachedProxyInfo; }