Better cancel support

This commit is contained in:
0xNF 2012-12-07 11:25:40 -05:00
parent 41f2ac3f78
commit a2616adb49

View File

@ -129,7 +129,7 @@ public final class ExtractUnallocAction extends AbstractAction {
uw.execute(); uw.execute();
} }
} else { } else {
logger.log(Level.WARNING, "Tried to get unallocated content from volume ID " + u.VolumeId + ", but its list of unallocated files was empty or null"); logger.log(Level.WARNING, "Tried to get unallocated content from volume ID but " + u.VolumeId + u.llf == null ? "its list of unallocated files was null" : "the volume is locked" );
} }
} }
if (isImage && !copyList.isEmpty()) { if (isImage && !copyList.isEmpty()) {
@ -250,7 +250,6 @@ public final class ExtractUnallocAction extends AbstractAction {
} else { } else {
logger.log(Level.INFO, "Finished writing unalloc file " + u.getFile().getPath()); logger.log(Level.INFO, "Finished writing unalloc file " + u.getFile().getPath());
} }
lockedVols.remove(u.FileName);
} }
progress.finish(); progress.finish();
@ -270,7 +269,10 @@ public final class ExtractUnallocAction extends AbstractAction {
if (isImage) { if (isImage) {
lockedImages.remove(currentImage); lockedImages.remove(currentImage);
} }
if (!canceled) { for (UnallocStruct u : lus) {
lockedVols.remove(u.getFileName());
}
if (!canceled && !lus.isEmpty()) {
JOptionPane.showMessageDialog(new Frame(), "Completed extraction of unallocated space. Files were extracted to " + lus.get(0).getFile().getParent()); JOptionPane.showMessageDialog(new Frame(), "Completed extraction of unallocated space. Files were extracted to " + lus.get(0).getFile().getParent());
} }
} }