From afdbcf676f250e219c25a7009d146a465d08b3d9 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 12 Nov 2020 14:27:51 +0000 Subject: [PATCH] JAL-3628 Error when saving alert box has been moved in develop for JS, adding Platform.isHeadless test to new isSaveAlignmentSuccessful method. --- src/jalview/gui/AlignFrame.java | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index a5ec3d8..4354ac6 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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); - } - } } } }; -- 1.7.10.2