mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-22 15:58:52 -05:00
Notify the user if background computation is still in progress
This commit is contained in:
parent
9d15ac34b4
commit
06eb06830d
@ -72,9 +72,15 @@ class RenameAction extends AbstractAction {
|
||||
|
||||
Window window = getWindow(evt.getSource());
|
||||
withWaitCursor(window, () -> {
|
||||
Map<File, File> renameMap = validate(model.getRenameMap(), window);
|
||||
// prepare rename map (abort and notify the user if background computation is still in progress)
|
||||
Map<File, File> renameMap = null;
|
||||
try {
|
||||
renameMap = validate(model.getRenameMap(), window);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, e::getMessage);
|
||||
}
|
||||
|
||||
if (renameMap.isEmpty()) {
|
||||
if (renameMap == null || renameMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class RenameModel extends MatchModel<Object, File> {
|
||||
} catch (ExecutionException e) {
|
||||
throw new IllegalStateException(String.format("\"%s\" could not be formatted: %s.", task.preview(), e.getCause().getMessage()));
|
||||
} catch (TimeoutException e) {
|
||||
throw new IllegalStateException(String.format("\"%s\" has not been formatted yet.", task.preview()));
|
||||
throw new IllegalStateException(String.format("\"%s\" has not been formatted yet. Applying custom formats may take a while.", task.preview()));
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user