1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 00:38:52 -05:00

* use without fail-save (hopefully we fixed the freeze issue)

This commit is contained in:
Reinhard Pointner 2015-05-07 17:01:11 +00:00
parent 77f51df2fb
commit 2fddcf0a2d
2 changed files with 4 additions and 21 deletions

View File

@ -214,6 +214,7 @@
<librarypath dir="${dir.lib}/native/mac-x86_64" /> <librarypath dir="${dir.lib}/native/mac-x86_64" />
<arch name="x86_64" /> <arch name="x86_64" />
<option value="-Dnet.filebot.UserFiles.fileChooser=COCOA" />
<option value="-Dapplication.deployment=app" /> <option value="-Dapplication.deployment=app" />
<option value="-Dapplication.update=auto" /> <option value="-Dapplication.update=auto" />
<option value="-Dunixfs=false" /> <option value="-Dunixfs=false" />

View File

@ -200,30 +200,12 @@ public class UserFiles {
COCOA { COCOA {
// private final String KEY_NSOPENPANEL_BROKEN = "NSOPENPANEL_BROKEN";
@Override @Override
public List<File> showLoadDialogSelectFiles(boolean folderMode, boolean multiSelection, File defaultFile, ExtensionFileFilter filter, String title, ActionEvent evt) { 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 // directly use NSOpenPanel for via Objective-C bridge for FILES_AND_DIRECTORIES mode
if (folderMode && filter != null) { 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 // call native NSOpenPanel openPanel via Objective-C bridge
return MacAppUtilities.NSOpenPanel_openPanel_runModal(title, true, true, true, filter.acceptAny() ? null : filter.extensions()); 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 // default to AWT implementation