From: Ben Soares Date: Wed, 30 Jan 2019 10:10:42 +0000 (+0000) Subject: JAL-3141 Enabled the 'Include backpup files' checkbox for loading alignments from... X-Git-Tag: Release_2_11_0~17^2~97^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5ac664f47c4da867bdbc2f7376e5079a97b74b20;p=jalview.git JAL-3141 Enabled the 'Include backpup files' checkbox for loading alignments from local file --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 4107157..5071918 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1087,7 +1087,7 @@ public class Desktop extends jalview.jbgui.GDesktop { String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); JalviewFileChooser chooser = JalviewFileChooser - .forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat); + .forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat, true); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle( diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index 0d78bda..8deaa33 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -81,6 +81,12 @@ public class JalviewFileChooser extends JFileChooser public static JalviewFileChooser forRead(String directory, String selected) { + return JalviewFileChooser.forRead(directory, selected, false); + } + + public static JalviewFileChooser forRead(String directory, + String selected, boolean allowBackupFiles) + { List extensions = new ArrayList<>(); List descs = new ArrayList<>(); for (FileFormatI format : FileFormats.getInstance().getFormats()) @@ -91,9 +97,11 @@ public class JalviewFileChooser extends JFileChooser descs.add(format.getName()); } } + return new JalviewFileChooser(directory, extensions.toArray(new String[extensions.size()]), - descs.toArray(new String[descs.size()]), selected, true); + descs.toArray(new String[descs.size()]), selected, true, + allowBackupFiles); } /**