From: Ben Soares Date: Thu, 30 Jul 2020 12:53:23 +0000 (+0100) Subject: JAL-3633 last minute refinement so password box doesn't get focus all the time X-Git-Tag: Develop-2_11_2_0-d20201215~15^2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fac1e8688bbf17fc6138c2a0c21ef12f90ee4c5a;p=jalview.git JAL-3633 last minute refinement so password box doesn't get focus all the time --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 594046f..dc71f91 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1432,7 +1432,8 @@ public class Cache .getString("label.proxy_password_required"); Preferences.openPreferences(Preferences.CONNECTIONS_TAB, message); - Preferences.getInstance().proxyAuthPasswordCheckHighlight(true); + Preferences.getInstance() + .proxyAuthPasswordCheckHighlight(true, true); } else { diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 40dc4df..f1a94fc 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -1265,13 +1265,19 @@ public class GPreferences extends JPanel public void proxyAuthPasswordCheckHighlight(boolean enabled) { + proxyAuthPasswordCheckHighlight(enabled, false); + } + + public void proxyAuthPasswordCheckHighlight(boolean enabled, + boolean grabFocus) + { if (enabled && proxyType.isSelected(customProxy.getModel()) && proxyAuth.isSelected() && !proxyAuthUsernameTB.getText().isEmpty() && proxyAuthPasswordPB.getDocument().getLength() == 0) { - - proxyAuthPasswordPB.grabFocus(); + if (grabFocus) + proxyAuthPasswordPB.grabFocus(); proxyAuthPasswordPB.setBackground(Color.PINK); } else