Fixex project saving
package io.github.mzmine.modules.io.projectsave;
import java.io.File;
-import java.util.concurrent.FutureTask;
import io.github.mzmine.main.MZmineCore;
import io.github.mzmine.parameters.Parameter;
import io.github.mzmine.parameters.impl.SimpleParameterSet;
import io.github.mzmine.parameters.parametertypes.filenames.FileNameParameter;
import io.github.mzmine.parameters.parametertypes.filenames.FileSelectionType;
import io.github.mzmine.util.ExitCode;
-import javafx.application.Platform;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
@@ -64,11 +62,7 @@ public class ProjectSaveParameters extends SimpleParameterSet {
fileChooser.setInitialDirectory(currentDir);
}
- final FutureTask<File> task = new FutureTask<>(() -> fileChooser.showSaveDialog(null));
- Platform.runLater(task);
-
- try {
- File selectedFile = task.get();
+ File selectedFile = fileChooser.showSaveDialog(null);
if (selectedFile == null)
return ExitCode.CANCEL;
if (!selectedFile.getName().endsWith(".mzmine")) {
@@ -85,9 +79,6 @@ public class ProjectSaveParameters extends SimpleParameterSet {
}
getParameter(projectFile).setValue(selectedFile);
- } catch (Exception e) {
- e.printStackTrace();
- }
return ExitCode.OK;
