mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
* use without fail-save (hopefully we fixed the freeze issue)
This commit is contained in:
parent
77f51df2fb
commit
2fddcf0a2d
@ -214,6 +214,7 @@
|
||||
<librarypath dir="${dir.lib}/native/mac-x86_64" />
|
||||
<arch name="x86_64" />
|
||||
|
||||
<option value="-Dnet.filebot.UserFiles.fileChooser=COCOA" />
|
||||
<option value="-Dapplication.deployment=app" />
|
||||
<option value="-Dapplication.update=auto" />
|
||||
<option value="-Dunixfs=false" />
|
||||
|
@ -200,30 +200,12 @@ public class UserFiles {
|
||||
|
||||
COCOA {
|
||||
|
||||
// private final String KEY_NSOPENPANEL_BROKEN = "NSOPENPANEL_BROKEN";
|
||||
|
||||
@Override
|
||||
public List<File> showLoadDialogSelectFiles(boolean folderMode, boolean multiSelection, File defaultFile, ExtensionFileFilter filter, String title, ActionEvent evt) {
|
||||
// directly use NSOpenPanel for via Objective-C bridge for FILES_AND_DIRECTORIES mode
|
||||
if (folderMode && filter != null) {
|
||||
// NSOpenPanel causes deadlocks on some machines
|
||||
// Preferences persistence = Preferences.userNodeForPackage(UserFiles.class);
|
||||
// if (!persistence.getBoolean(KEY_NSOPENPANEL_BROKEN, false)) {
|
||||
try {
|
||||
// assume that NSOpenPanel may freeze the application until it is killed, and make sure to not use NSOpenPanel on subsequent runs
|
||||
// persistence.putBoolean(KEY_NSOPENPANEL_BROKEN, true);
|
||||
// persistence.flush();
|
||||
|
||||
// call native NSOpenPanel openPanel via Objective-C bridge
|
||||
return MacAppUtilities.NSOpenPanel_openPanel_runModal(title, true, true, true, filter.acceptAny() ? null : filter.extensions());
|
||||
} catch (Throwable e) {
|
||||
Logger.getLogger(UserFiles.class.getName()).log(Level.WARNING, e.toString());
|
||||
} finally {
|
||||
// persistence.putBoolean(KEY_NSOPENPANEL_BROKEN, false); // NSOpenPanel did not freeze application
|
||||
}
|
||||
// } else {
|
||||
// Logger.getLogger(UserFiles.class.getName()).log(Level.WARNING, "NSOpenPanel broken. Using AWT implementation instead.");
|
||||
// }
|
||||
}
|
||||
|
||||
// default to AWT implementation
|
||||
|
Loading…
Reference in New Issue
Block a user