From: Jim Procter Date: Wed, 13 Nov 2024 15:59:36 +0000 (+0000) Subject: JAL-3921 escape and transform file paths for Jmol scripting environment X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=503685f9db9a9cd37212789dbd150dde18bcc529;p=jalview.git JAL-3921 escape and transform file paths for Jmol scripting environment --- diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index d37c9c0..6d57acd 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -45,6 +45,7 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.datamodel.StructureViewerModel; import jalview.datamodel.StructureViewerModel.StructureData; +import jalview.ext.jmol.JmolCommands; import jalview.gui.ImageExporter.ImageWriterI; import jalview.gui.StructureViewer.ViewerType; import jalview.io.exceptions.ImageOutputException; @@ -153,8 +154,7 @@ public class AppJmol extends StructureViewerBase } }); StringBuilder cmd = new StringBuilder(); - cmd.append("load FILES ").append(QUOTE) - .append(Platform.escapeBackslashes(sessionFile)).append(QUOTE); + cmd.append(jmb.getCommandGenerator().loadFile(sessionFile)); initJmol(cmd.toString()); } @@ -301,7 +301,7 @@ public class AppJmol extends StructureViewerBase for (String s : files) { fileList.append(SPACE).append(QUOTE) - .append(Platform.escapeBackslashes(s)).append(QUOTE); + .append(JmolCommands.escapeQuotedFilename(s)).append(QUOTE); } String filesString = fileList.toString();