From fac1e8688bbf17fc6138c2a0c21ef12f90ee4c5a Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 30 Jul 2020 13:53:23 +0100 Subject: [PATCH] JAL-3633 last minute refinement so password box doesn't get focus all the time --- src/jalview/bin/Cache.java | 3 ++- src/jalview/jbgui/GPreferences.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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 -- 1.7.10.2