JAL-4265 JAL-4286 reinstated explicit restoreSession method because Jmol’s LOAD files...
authorJames Procter <j.procter@dundee.ac.uk>
Wed, 20 Sep 2023 17:02:41 +0000 (18:02 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Wed, 20 Sep 2023 17:02:41 +0000 (18:02 +0100)
src/jalview/bin/Commands.java

index 65030a4..36d8e88 100644 (file)
@@ -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);
+                  }
                 }
               }
             }