From 5ac664f47c4da867bdbc2f7376e5079a97b74b20 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 30 Jan 2019 10:10:42 +0000 Subject: [PATCH] JAL-3141 Enabled the 'Include backpup files' checkbox for loading alignments from local file --- src/jalview/gui/Desktop.java | 2 +- src/jalview/io/JalviewFileChooser.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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); } /** -- 1.7.10.2