From: Ben Soares Date: Mon, 20 Feb 2023 10:09:46 +0000 (+0000) Subject: Merge branch 'develop' into bug/JAL-4125_flatlaf_quithandler_warning_doesnt_display_p... X-Git-Tag: Release_2_11_3_0~23^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a327fd39320e482fad4b57f256f3e3c8ebcf015b;hp=-c;p=jalview.git Merge branch 'develop' into bug/JAL-4125_flatlaf_quithandler_warning_doesnt_display_properly --- a327fd39320e482fad4b57f256f3e3c8ebcf015b diff --combined src/jalview/io/FileLoader.java index 5d290b6,a4d4043..7d226ed --- a/src/jalview/io/FileLoader.java +++ b/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 @@@ -467,6 -465,7 +467,6 @@@ { alignFrame.setFileName(file, format); alignFrame.setFileObject(selectedFile); // BH 2018 SwingJS - alignFrame.getViewport().setSavedUpToDate(true); } if (proxyColourScheme != null) { @@@ -486,6 -485,12 +486,12 @@@ // 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 @@@ -614,7 -619,6 +620,7 @@@ Desktop.instance.stopLoading(); } + this.setShouldBeSaved(); } /** @@@ -640,21 -644,4 +646,21 @@@ 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); + } + }