JAL-1988 Allow generic Container object in JvOptionPane showDialog. Fix dynamically...
[jalview.git] / src / jalview / io / BackupFiles.java
index 3024edf..9112042 100644 (file)
@@ -167,29 +167,32 @@ public class BackupFiles
   public static boolean hasSavesInProgress()
   {
     boolean has = false;
-    for (CompletableFuture cf : savesInProgressCompletableFutures())
+    for (CompletableFuture cf : savesInProgressCompletableFutures(true))
     {
       has |= !cf.isDone();
     }
     return has;
   }
 
-  public static List<File> savesInProgressFiles()
+  public static List<File> savesInProgressFiles(boolean all)
   {
     List<File> files = new ArrayList<>();
     for (BackupFiles bfile : savesInProgress)
     {
-      files.add(bfile.getFile());
+      if (all || !bfile.getMyFuture().isDone())
+        files.add(bfile.getFile());
     }
     return files;
   }
 
-  public static List<CompletableFuture<Boolean>> savesInProgressCompletableFutures()
+  public static List<CompletableFuture<Boolean>> savesInProgressCompletableFutures(
+          boolean all)
   {
     List<CompletableFuture<Boolean>> cfs = new ArrayList<>();
     for (BackupFiles bfile : savesInProgress)
     {
-      cfs.add(bfile.getMyFuture());
+      if (all || !bfile.getMyFuture().isDone())
+        cfs.add(bfile.getMyFuture());
     }
     return cfs;
   }