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;
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)
{
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);
+ }
+
}