From: Jim Procter Date: Fri, 1 Oct 2021 16:32:20 +0000 (+0100) Subject: JAL-3616 explicit configure external viewer config X-Git-Tag: Release_2_11_2_1~77 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fc46c75d41d5bc962216a96062699ecb2e6e1220;p=jalview.git JAL-3616 explicit configure external viewer config --- diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index e3e3932..baed0df 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -446,11 +446,27 @@ public class Preferences extends GPreferences { if (validateViewerPath()) { - Cache.setProperty( - structViewer.getSelectedItem().equals( - ViewerType.CHIMERAX.name()) ? CHIMERAX_PATH - : CHIMERA_PATH, - structureViewerPath.getText()); + String path = structureViewerPath.getText(); + try { + ViewerType type = ViewerType.valueOf(viewerType); + switch (type) + { + case JMOL: + break; + case CHIMERA: + Cache.setProperty(CHIMERA_PATH, path); + break; + case CHIMERAX: + Cache.setProperty(CHIMERAX_PATH, path); + break; + case PYMOL: + Cache.setProperty(PYMOL_PATH, path); + break; + } + } catch (IllegalArgumentException x) + { + Cache.log.error("Failed to set path - unknown viewer type",x); + } } } });