JAL-1759 merge from develop
[jalview.git] / src / jalview / gui / AlignFrame.java
index 343d5c7..68d7397 100644 (file)
@@ -37,6 +37,7 @@ import jalview.api.SplitContainerI;
 import jalview.api.ViewStyleI;
 import jalview.api.analysis.ScoreModelI;
 import jalview.bin.Cache;
+import jalview.bin.Jalview;
 import jalview.commands.CommandI;
 import jalview.commands.EditCommand;
 import jalview.commands.EditCommand.Action;
@@ -335,7 +336,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void init()
   {
-    progressBar = new ProgressBar(this.statusPanel, this.statusBar);
+    if (!Jalview.isHeadlessMode())
+    {
+      progressBar = new ProgressBar(this.statusPanel, this.statusBar);
+    }
 
     avc = new jalview.controller.AlignViewController(this, viewport,
             alignPanel);
@@ -1135,8 +1139,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       {
         warningMessage("Cannot save file " + fileName + " using format "
                 + format, "Alignment output format not supported");
-        saveAs_actionPerformed(null);
-        // JBPNote need to have a raise_gui flag here
+        if (!Jalview.isHeadlessMode())
+        {
+          saveAs_actionPerformed(null);
+        }
         return false;
       }
 
@@ -1822,9 +1828,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               viewport.getSelectionGroup().getEndRes() + groupAdjustment);
     }
 
+    /*
+     * just extend the last slide command if compatible; but not if in
+     * SplitFrame mode (to ensure all edits are broadcast - JAL-1802)
+     */
     boolean appendHistoryItem = false;
     Deque<CommandI> historyList = viewport.getHistoryList();
-    if (historyList != null
+    boolean inSplitFrame = getSplitViewContainer() != null;
+    if (!inSplitFrame && historyList != null
             && historyList.size() > 0
             && historyList.peek() instanceof SlideSequencesCommand)
     {