Merge branch 'develop' into bug/JAL-4125_flatlaf_quithandler_warning_doesnt_display_p... bug/JAL-4125_flatlaf_quithandler_warning_doesnt_display_properly
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 20 Feb 2023 10:09:46 +0000 (10:09 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 20 Feb 2023 10:09:46 +0000 (10:09 +0000)
1  2 
src/jalview/io/FileLoader.java

@@@ -41,7 -41,6 +41,7 @@@ import jalview.gui.AlignFrame
  import jalview.gui.AlignViewport;
  import jalview.gui.Desktop;
  import jalview.gui.JvOptionPane;
 +import jalview.gui.QuitHandler;
  import jalview.json.binding.biojson.v1.ColourSchemeMapper;
  import jalview.project.Jalview2XML;
  import jalview.schemes.ColourSchemeI;
@@@ -312,7 -311,6 +312,7 @@@ public class FileLoader implements Runn
                    MessageManager.getString("label.couldnt_read_data"),
                    JvOptionPane.WARNING_MESSAGE);
          }
 +        this.setShouldBeSaved();
          return;
        }
        // TODO: cache any stream datasources as a temporary file (eg. PDBs
              {
                alignFrame.setFileName(file, format);
                alignFrame.setFileObject(selectedFile); // BH 2018 SwingJS
 -              alignFrame.getViewport().setSavedUpToDate(true);
              }
              if (proxyColourScheme != null)
              {
                // that perform queries to find the 'current working alignment'
                Desktop.addInternalFrame(alignFrame, title,
                        AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+               /*
+                * for an Overview automatically opened with alignment,
+                * set its title now alignFrame title has been set
+                */
+               alignFrame.alignPanel.setOverviewTitle(alignFrame);
              }
  
              try
        Desktop.instance.stopLoading();
      }
  
 +    this.setShouldBeSaved();
    }
  
    /**
      return tempStructFile.toString();
    }
  
 +  /*
 +   * set whether quit should ask to save when just loaded this source
 +   */
 +  private void setShouldBeSaved()
 +  {
 +    if (protocol == null)
 +      return;
 +    AlignFrame af = this.alignFrame;
 +    if (af == null)
 +      return;
 +    AlignViewport avp = af.getViewport();
 +    if (avp == null)
 +      return;
 +    avp.setSavedUpToDate(!protocol.isDynamic(),
 +            QuitHandler.Message.UNSAVED_ALIGNMENTS);
 +  }
 +
  }