Refactor ProgressDialog

This commit is contained in:
Reinhard Pointner 2016-05-08 04:12:16 +08:00
parent c7b97825f3
commit 0e126daace
2 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,9 @@ class RenameAction extends AbstractAction {
} else {
// call and wait
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) {
debug.finest(e::toString);

View File

@ -12,10 +12,8 @@ import java.util.logging.Level;
import org.controlsfx.dialog.ProgressDialog;
import javafx.concurrent.Task;
import javafx.event.EventHandler;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
public class ProgressMonitor<T> {