JAL-3628 Error when saving alert box has been moved in develop for JS, adding Platfor...
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 12 Nov 2020 14:27:51 +0000 (14:27 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 12 Nov 2020 14:27:51 +0000 (14:27 +0000)
src/jalview/gui/AlignFrame.java

index a5ec3d8..4354ac6 100644 (file)
@@ -1204,11 +1204,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (!lastSaveSuccessful)
     {
-      JvOptionPane.showInternalMessageDialog(this, MessageManager
-              .formatMessage("label.couldnt_save_file", new Object[]
-              { lastFilenameSaved }),
-              MessageManager.getString("label.error_saving_file"),
-              JvOptionPane.WARNING_MESSAGE);
+      if (!Platform.isHeadless())
+      {
+        JvOptionPane.showInternalMessageDialog(this, MessageManager
+                .formatMessage("label.couldnt_save_file", new Object[]
+                { lastFilenameSaved }),
+                MessageManager.getString("label.error_saving_file"),
+                JvOptionPane.WARNING_MESSAGE);
+      }
+      else
+      {
+        Cache.log.error(MessageManager
+                .formatMessage("label.couldnt_save_file", new Object[]
+                { lastFilenameSaved }));
+      }
     }
     else
     {
@@ -1345,19 +1354,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                             + (lastSaveSuccessful ? "" : "un")
                             + "successfully");
           }
-
-          if (!lastSaveSuccessful)
-          {
-            if (!Platform.isHeadless())
-            {
-              JvOptionPane.showInternalMessageDialog(AlignFrame.this,
-                      MessageManager.formatMessage(
-                              "label.couldnt_save_file", new Object[]
-                              { fileName }),
-                      MessageManager.getString("label.error_saving_file"),
-                      JvOptionPane.WARNING_MESSAGE);
-            }
-          }
         }
       }
     };