JAL-3141 Enabled the 'Include backpup files' checkbox for loading alignments from...
authorBen Soares <bsoares@dundee.ac.uk>
Wed, 30 Jan 2019 10:10:42 +0000 (10:10 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Wed, 30 Jan 2019 10:10:42 +0000 (10:10 +0000)
src/jalview/gui/Desktop.java
src/jalview/io/JalviewFileChooser.java

index 4107157..5071918 100644 (file)
@@ -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(
index 0d78bda..8deaa33 100755 (executable)
@@ -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<String> extensions = new ArrayList<>();
     List<String> 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);
   }
 
   /**