Pre-fill known proxy info into ProxyPanel.

We no longer use the system properties, so we can't rely on the info having
been stuffed in there by some previous machinations.
This commit is contained in:
Michael Bayne
2019-01-15 12:37:36 -08:00
parent d05c024585
commit 68341fedc2
2 changed files with 7 additions and 4 deletions
@@ -148,7 +148,11 @@ public abstract class Getdown extends Thread
// create a panel they can use to configure the proxy settings // create a panel they can use to configure the proxy settings
_container = createContainer(); _container = createContainer();
configureContainer(); configureContainer();
_container.add(new ProxyPanel(this, _msgs), BorderLayout.CENTER); ProxyPanel panel = new ProxyPanel(this, _msgs);
// set up any existing configured proxy
String[] hostPort = ProxyUtil.loadProxy(_app);
panel.setProxy(hostPort[0], hostPort[1]);
_container.add(panel, BorderLayout.CENTER);
showContainer(); showContainer();
// allow them to close the window to abort the proxy configuration // allow them to close the window to abort the proxy configuration
_dead = true; _dead = true;
@@ -96,13 +96,12 @@ public final class ProxyPanel extends JPanel implements ActionListener
button.setActionCommand("cancel"); button.setActionCommand("cancel");
button.addActionListener(this); button.addActionListener(this);
add(row); add(row);
}
// set up any existing proxy defaults public void setProxy (String host, String port) {
String host = System.getProperty("http.proxyHost");
if (host != null) { if (host != null) {
_host.setText(host); _host.setText(host);
} }
String port = System.getProperty("http.proxyPort");
if (port != null) { if (port != null) {
_port.setText(port); _port.setText(port);
} }