JAL-3633 last minute refinement so password box doesn't get focus all the time
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 30 Jul 2020 12:53:23 +0000 (13:53 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 13 Nov 2020 17:18:38 +0000 (17:18 +0000)
src/jalview/bin/Cache.java
src/jalview/jbgui/GPreferences.java

index 594046f..dc71f91 100755 (executable)
@@ -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
               {
index 40dc4df..f1a94fc 100755 (executable)
@@ -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