From 89da71c0b164a26d5613167ec467db95701b4638 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 27 Oct 2016 09:03:05 +0100 Subject: [PATCH] JAL-2287 treat Escape like Cancel in dialog box --- src/jalview/gui/ChimeraViewFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index bccbda8..ce719d0 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -59,9 +59,7 @@ import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Random; -import java.util.Set; import java.util.Vector; import javax.swing.JCheckBoxMenuItem; @@ -535,7 +533,11 @@ public class ChimeraViewFrame extends StructureViewerBase int confirm = JOptionPane.showConfirmDialog(this, prompt, MessageManager.getString("label.close_viewer"), JOptionPane.YES_NO_CANCEL_OPTION); - if (confirm == JOptionPane.CANCEL_OPTION) + /* + * abort closure if user hits escape or Cancel + */ + if (confirm == JOptionPane.CANCEL_OPTION + || confirm == JOptionPane.CLOSED_OPTION) { return; } -- 1.7.10.2