mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 06:21:16 +00:00
allow selecting multiple files in openFileDialog (when openMultipleFiles is enabled)
This commit is contained in:
@@ -612,6 +612,9 @@ public class Main {
|
|||||||
|
|
||||||
public static boolean openFileDialog() {
|
public static boolean openFileDialog() {
|
||||||
JFileChooser fc = new JFileChooser();
|
JFileChooser fc = new JFileChooser();
|
||||||
|
if (Configuration.openMultipleFiles.get()) {
|
||||||
|
fc.setMultiSelectionEnabled(true);
|
||||||
|
}
|
||||||
fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get()));
|
fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get()));
|
||||||
FileFilter allSupportedFilter = new FileFilter() {
|
FileFilter allSupportedFilter = new FileFilter() {
|
||||||
private final String[] supportedExtensions = new String[]{".swf", ".gfx", ".swc", ".zip"};
|
private final String[] supportedExtensions = new String[]{".swf", ".gfx", ".swc", ".zip"};
|
||||||
@@ -705,8 +708,11 @@ public class Main {
|
|||||||
int returnVal = fc.showOpenDialog(f);
|
int returnVal = fc.showOpenDialog(f);
|
||||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
|
Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
|
||||||
File selfile = Helper.fixDialogFile(fc.getSelectedFile());
|
File[] selFiles = fc.getSelectedFiles();
|
||||||
Main.openFile(selfile.getAbsolutePath(), null);
|
for (File file : selFiles) {
|
||||||
|
File selfile = Helper.fixDialogFile(file);
|
||||||
|
Main.openFile(selfile.getAbsolutePath(), null);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user