* fix FileChooser issues
@see https://www.filebot.net/forums/viewtopic.php?f=6&t=2165&p=12432#p12432
This commit is contained in:
parent
2676762686
commit
f1ddcb3e7e
|
@ -98,7 +98,9 @@ public class MediaTypes {
|
|||
public static ExtensionFileFilter combineFilter(ExtensionFileFilter... filters) {
|
||||
List<String> extensions = new ArrayList<String>();
|
||||
for (ExtensionFileFilter it : filters) {
|
||||
addAll(extensions, it.extensions());
|
||||
if (!it.acceptAny()) {
|
||||
addAll(extensions, it.extensions());
|
||||
}
|
||||
}
|
||||
return new ExtensionFileFilter(extensions);
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ public class UserFiles {
|
|||
}
|
||||
}
|
||||
|
||||
if (filter != null) {
|
||||
if (filter != null && !filter.acceptAny()) {
|
||||
chooser.setFileFilter(new javax.swing.filechooser.FileNameExtensionFilter(filter.toString(), filter.extensions()));
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ public class UserFiles {
|
|||
// show FileChooser
|
||||
javafx.stage.FileChooser fileChooser = new javafx.stage.FileChooser();
|
||||
fileChooser.setTitle(title);
|
||||
if (filter != null) {
|
||||
if (filter != null && !filter.acceptAny()) {
|
||||
String[] globFilter = filter.extensions();
|
||||
for (int i = 0; i < globFilter.length; i++) {
|
||||
globFilter[i] = "*." + globFilter[i];
|
||||
|
|
Loading…
Reference in New Issue