From 4b1bb2ab913cd40cea1c13f43d096c07f3cdeaf4 Mon Sep 17 00:00:00 2001 From: James Procter Date: Wed, 20 Sep 2023 18:02:41 +0100 Subject: [PATCH] =?utf8?q?JAL-4265=20JAL-4286=20reinstated=20explicit=20rest?= =?utf8?q?oreSession=20method=20because=20Jmol=E2=80=99s=20LOAD=20files=20co?= =?utf8?q?mmand=20does=20not=20behave=20the=20same=20way=20as=20restore=20ST?= =?utf8?q?ATE.=20Also=20added=20defensive=20check=20for=20unexpected=20excep?= =?utf8?q?tions=20if=20the=20state=20restore=20trashes=20the=20Jmol/Jalview=20?= =?utf8?q?binding?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/bin/Commands.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 65030a4..36d8e88 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -782,7 +782,11 @@ public class Commands // RESTORE SESSION AFTER EXPORT IF NEED BE if (sessionToRestore != null) { - sview.getBinding().openSession(sessionToRestore.getCanonicalPath()); + Console.debug("Restoring session from " + + sessionToRestore); + + sview.getBinding().restoreSession(sessionToRestore.getAbsolutePath()); + } } catch (ImageOutputException ioexc) { @@ -791,15 +795,14 @@ public class Commands isError = true; continue; } - catch (IOException ioexec) - { - addError("Unexpected error when restoring structure viewer session after custom view operations."); - isError = true; - continue; - } finally { - this.colourAlignFrame(af, originalColourScheme); + try { + this.colourAlignFrame(af, originalColourScheme); + } catch (Exception t) + { + addError("Unexpected error when restoring colourscheme to alignment after temporary change for export.",t); + } } } } -- 1.7.10.2