mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
Refactor ProgressDialog
This commit is contained in:
parent
c7b97825f3
commit
0e126daace
@ -97,7 +97,9 @@ class RenameAction extends AbstractAction {
|
|||||||
} else {
|
} else {
|
||||||
// call and wait
|
// call and wait
|
||||||
RenameWorker worker = new RenameWorker(renameMap, renameLog, action);
|
RenameWorker worker = new RenameWorker(renameMap, renameLog, action);
|
||||||
ProgressMonitor.runTask(action.getDisplayName(), String.format("%s %d %s. This may take a while.", action.getDisplayName() + "ing", renameMap.size(), renameMap.size() == 1 ? "file" : "files"), worker).get();
|
String title = String.format("%s - %s", getApplicationName(), action.getDisplayName());
|
||||||
|
String message = String.format("%s %d %s. This may take a while.", action.getDisplayName() + "ing", renameMap.size(), renameMap.size() == 1 ? "file" : "files");
|
||||||
|
ProgressMonitor.runTask(title, message, worker).get();
|
||||||
}
|
}
|
||||||
} catch (CancellationException e) {
|
} catch (CancellationException e) {
|
||||||
debug.finest(e::toString);
|
debug.finest(e::toString);
|
||||||
|
@ -12,10 +12,8 @@ import java.util.logging.Level;
|
|||||||
import org.controlsfx.dialog.ProgressDialog;
|
import org.controlsfx.dialog.ProgressDialog;
|
||||||
|
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
import javafx.event.EventHandler;
|
|
||||||
import javafx.stage.Modality;
|
import javafx.stage.Modality;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.WindowEvent;
|
|
||||||
|
|
||||||
public class ProgressMonitor<T> {
|
public class ProgressMonitor<T> {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user