From 57fd11364c284318be3cae3ded0df30a36ee0d98 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 2 Mar 2022 14:49:56 +0000 Subject: [PATCH] JAL-3619 fix up warning message and minimal patch to make sure failed-to-launch viewers tidy up after themselves. --- resources/lang/Messages.properties | 2 +- src/jalview/gui/ChimeraViewFrame.java | 1 + src/jalview/gui/PymolViewer.java | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index b448b4c..fec31b8 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -273,7 +273,7 @@ label.viewer_path = Path to {0} program label.viewer_path_tip = Jalview will first try any path entered here, else standard installation locations.
Double-click to browse for file. label.invalid_viewer_path = Path not found or not executable label.viewer_missing = Structure viewer not found.
Please enter the path to the executable (if installed),
or download and install the program. -label.open_viewer_failed = Error opening {0} - is it installed?\nCheck path in Preferences, Structure +label.open_viewer_failed = Error opening {0} - is it installed?\nCheck configured path in the Preferences' Structure tab label.min_colour = Minimum Colour label.max_colour = Maximum Colour label.no_colour = No Colour diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 9d98585..4f1f26b 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -331,6 +331,7 @@ public class ChimeraViewFrame extends StructureViewerBase getViewerName()), MessageManager.getString("label.error_loading_file"), JvOptionPane.ERROR_MESSAGE); + jmb.closeViewer(true); this.dispose(); return; } diff --git a/src/jalview/gui/PymolViewer.java b/src/jalview/gui/PymolViewer.java index d426051..3b6ea99 100644 --- a/src/jalview/gui/PymolViewer.java +++ b/src/jalview/gui/PymolViewer.java @@ -211,6 +211,8 @@ public class PymolViewer extends StructureViewerBase } catch (Exception ex) { Console.error("Couldn't open PyMOL viewer!", ex); + // if we couldn't open Pymol, no point continuing + return; } } int num = -1; @@ -314,6 +316,7 @@ public class PymolViewer extends StructureViewerBase getViewerName()), MessageManager.getString("label.error_loading_file"), JvOptionPane.ERROR_MESSAGE); + binding.closeViewer(true); this.dispose(); return; } -- 1.7.10.2