Merge branch 'develop' into update_212_Dec_merge_with_21125_chamges
[jalview.git] / getdown / src / getdown / launcher / src / main / java / com / threerings / getdown / launcher / ProxyPanel.java
index 2178273..5d697df 100644 (file)
@@ -40,6 +40,12 @@ public final class ProxyPanel extends JPanel implements ActionListener
         _getdown = getdown;
         _msgs = msgs;
 
+        String[] hostPortAuthUser = ProxyUtil.jalviewProxyProperties(getdown._app);
+        String host = hostPortAuthUser[0];
+        String port = hostPortAuthUser[1];
+        boolean proxyAuth = Boolean.parseBoolean(hostPortAuthUser[2]);
+        String username = hostPortAuthUser[3];
+
         setLayout(new VGroupLayout());
         setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
         add(new SaneLabelField(get("m.configure_proxy")));
@@ -48,11 +54,13 @@ public final class ProxyPanel extends JPanel implements ActionListener
         JPanel row = new JPanel(new GridLayout());
         row.add(new SaneLabelField(get("m.proxy_host")), BorderLayout.WEST);
         row.add(_host = new SaneTextField());
+        _host.setText(host);
         add(row);
 
         row = new JPanel(new GridLayout());
         row.add(new SaneLabelField(get("m.proxy_port")), BorderLayout.WEST);
         row.add(_port = new SaneTextField());
+        _port.setText(port);
         add(row);
 
         add(new Spacer(5, 5));
@@ -60,20 +68,22 @@ public final class ProxyPanel extends JPanel implements ActionListener
         row = new JPanel(new GridLayout());
         row.add(new SaneLabelField(get("m.proxy_auth_required")), BorderLayout.WEST);
         _useAuth = new JCheckBox();
+        _useAuth.setSelected(proxyAuth);
         row.add(_useAuth);
         add(row);
 
         row = new JPanel(new GridLayout());
         row.add(new SaneLabelField(get("m.proxy_username")), BorderLayout.WEST);
         _username = new SaneTextField();
-        _username.setEnabled(false);
+        _username.setText(username);
+        _username.setEnabled(_useAuth.isSelected());
         row.add(_username);
         add(row);
 
         row = new JPanel(new GridLayout());
         row.add(new SaneLabelField(get("m.proxy_password")), BorderLayout.WEST);
         _password = new SanePasswordField();
-        _password.setEnabled(false);
+        _password.setEnabled(_useAuth.isSelected());
         row.add(_password);
         add(row);