JAL-4285 Better checkFiles processing. Better dialog.
[jalview.git] / src / jalview / bin / Jalview.java
index dbc1d88..2c07296 100755 (executable)
@@ -2060,13 +2060,13 @@ public class Jalview
     if (oldStyle)
     {
       String warning = MessageManager
-              .getString("warning.using_old_command_line_arguments")
-              + "https://www.jalview.org/help/html/features/commandline.html";
+              .getString("warning.using_old_command_line_arguments");
+      String url = "https://www.jalview.org/help/html/features/commandline.html";
       if (Desktop.instance != null)
       {
         String cont = MessageManager.getString("label.continue");
 
-        Desktop.instance.nonBlockingDialog(32, 2, title, warning, cont,
+        Desktop.instance.nonBlockingDialog(32, 2, title, warning, url, cont,
                 JvOptionPane.WARNING_MESSAGE, false, false);
       }
     }
@@ -2077,8 +2077,16 @@ public class Jalview
         String message = MessageManager
                 .getString("warning.the_following_errors");
         String ok = MessageManager.getString("action.ok");
-        Desktop.instance.nonBlockingDialog(60, 16, title,
-                message + "\n" + j.getCommands().errorsToString(), ok,
+        int shortest = 60;
+        List<String> errors = j.getCommands().getErrors();
+        for (int i = 0; i < errors.size(); i++)
+        {
+          shortest = Math.min(shortest, errors.get(i).length());
+        }
+        Desktop.instance.nonBlockingDialog(
+                Math.max(message.length(), Math.min(60, shortest)),
+                Math.min(errors.size(), 20), title, message,
+                j.getCommands().errorsToString(), ok,
                 JvOptionPane.WARNING_MESSAGE, true, true);
       }
     }