|
|
@ -284,13 +284,20 @@ public class PreferencesFragment extends PreferenceFragment implements SharedPre |
|
|
|
Boolean httpProxyEnabled = sharedPreferences.getBoolean("httpProxyEnabled", false); |
|
|
|
Boolean httpProxyEnabled = sharedPreferences.getBoolean("httpProxyEnabled", false); |
|
|
|
|
|
|
|
|
|
|
|
String httpServer = sharedPreferences.getString("httpProxyServer", ""); |
|
|
|
String httpServer = sharedPreferences.getString("httpProxyServer", ""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
int httpPort = Integer.parseInt(sharedPreferences.getString("httpProxyPort", "-1")); |
|
|
|
int httpPort = Integer.parseInt(sharedPreferences.getString("httpProxyPort", "-1")); |
|
|
|
|
|
|
|
|
|
|
|
if (httpProxyEnabled && !httpServer.isEmpty() && (httpPort > 0 && httpPort < 65535)) { |
|
|
|
if (httpProxyEnabled && !httpServer.isEmpty() && (httpPort > 0 && httpPort < 65535)) { |
|
|
|
httpProxyPref.setSummary(httpServer + ":" + httpPort); |
|
|
|
httpProxyPref.setSummary(httpServer + ":" + httpPort); |
|
|
|
} else { |
|
|
|
return; |
|
|
|
httpProxyPref.setSummary(""); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
|
|
|
// user has entered wrong port, fall back to empty summary
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
httpProxyPref.setSummary(""); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|