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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user