1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

* fix mas config

This commit is contained in:
Reinhard Pointner 2014-07-29 09:06:30 +00:00
parent 7d49fa2317
commit c711e4543c
3 changed files with 3 additions and 45 deletions

View File

@ -279,7 +279,7 @@
<option value="-Dapplication.cache=./Library/Caches/ehcache.disk.store" />
<option value="-Djava.io.tmpdir=./Library/Caches/java.io.tmpdir" />
<option value="-Dnet.filebot.UserFiles.useNative=true" />
<option value="-Dnet.filebot.UserFiles.fileChooser=AWT" />
<option value="-Dapplication.deployment=mas" />
<option value="-Dapplication.update=skip" />

View File

@ -68,7 +68,8 @@ public final class Settings {
}
public static FileChooser getPreferredFileChooser() {
return FileChooser.valueOf(System.getProperty("net.filebot.UserFiles.fileChooser", FileChooser.Swing.name()));
String prop = System.getProperty("net.filebot.UserFiles.fileChooser");
return prop == null ? FileChooser.Swing : FileChooser.valueOf(prop);
}
public static int getPreferredThreadPoolSize() {

View File

@ -1,7 +1,6 @@
package net.filebot;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static net.filebot.Settings.*;
import static net.filebot.util.ui.SwingUI.*;
@ -148,48 +147,6 @@ public class UserFiles {
Frame[] frames = Frame.getFrames();
return new FileDialog(frames.length > 0 ? frames[0] : null, title, mode);
}
},
JavaFX {
@Override
public List<File> showLoadDialogSelectFiles(boolean folderMode, boolean multiSelection, File defaultFile, ExtensionFileFilter filter, String title, Object parent) {
javafx.stage.FileChooser fileChooser = new javafx.stage.FileChooser();
fileChooser.setTitle(title);
// fileChooser.getExtensionFilters().add(new javafx.stage.FileChooser.ExtensionFilter(arg0, arg1))
if (defaultFile != null) {
if (defaultFile.getParentFile() != null) {
fileChooser.setInitialDirectory(defaultFile.getParentFile());
}
fileChooser.setInitialFileName(defaultFile.getName());
}
if (multiSelection) {
List<File> files = fileChooser.showOpenMultipleDialog(null);
if (files != null)
return files;
} else {
File file = fileChooser.showOpenDialog(null);
if (file != null)
return singletonList(file);
}
return emptyList();
}
@Override
public File showSaveDialogSelectFile(boolean folderMode, File defaultFile, String title, Object parent) {
javafx.stage.FileChooser fileChooser = new javafx.stage.FileChooser();
fileChooser.setTitle(title);
if (defaultFile != null) {
if (defaultFile.getParentFile() != null) {
fileChooser.setInitialDirectory(defaultFile.getParentFile());
}
fileChooser.setInitialFileName(defaultFile.getName());
}
return fileChooser.showSaveDialog(null);
}
};
public abstract List<File> showLoadDialogSelectFiles(boolean folderMode, boolean multiSelection, File defaultFile, ExtensionFileFilter filter, String title, Object parent);