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

* disable crash workaround until we actually fix it

This commit is contained in:
Reinhard Pointner 2015-05-05 13:48:16 +00:00
parent 73dddd93a2
commit 7c5b6bf891
2 changed files with 20 additions and 21 deletions

View File

@ -209,7 +209,7 @@
<target name="appbundle" description="Build an OSX application bundle">
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${dir.lib}/build/appbundler.jar" />
<bundleapp minimumsystemversion="10.8" outputdirectory="${dir.dist}" name="${title}" displayname="${title}" shortversion="${version}" identifier="net.sourceforge.FileBot" mainclassname="net.filebot.Main" icon="${dir.installer}/appbundle/filebot.icns" copyright="2015 Reinhard Pointner" applicationcategory="public.app-category.productivity">
<bundleapp minimumsystemversion="10.8" outputdirectory="${dir.dist}" name="${title}" displayname="${title}" shortversion="${version}" identifier="net.sourceforge.FileBot" mainclassname="net.filebot.Main" icon="${dir.installer}/appbundle/filebot.icns" copyright="2015 Reinhard Pointner" applicationcategory="public.app-category.productivity" supportsautomaticgraphicsswitching="true">
<classpath file="${path.fatjar}" />
<librarypath dir="${dir.lib}/native/mac-x86_64" />
<arch name="x86_64" />
@ -259,7 +259,7 @@
<property name="jre.version" value="jdk1.8.0_45.jdk" />
<property name="jre.path" value="/Library/Java/JavaVirtualMachines/${jre.version}/Contents/Home" />
<bundleapp minimumsystemversion="10.8" executablename="FileBotAppLauncher" version="${svn.revision}" outputdirectory="${dir.dist}" name="${title}" displayname="${title}" shortversion="${version}" identifier="net.filebot.FileBot" mainclassname="net.filebot.Main" icon="${dir.installer}/appbundle/filebot.icns" copyright="2015 Reinhard Pointner" applicationcategory="public.app-category.productivity" supportsautomaticgraphicsswitching="false">
<bundleapp minimumsystemversion="10.8" executablename="FileBotAppLauncher" version="${svn.revision}" outputdirectory="${dir.dist}" name="${title}" displayname="${title}" shortversion="${version}" identifier="net.filebot.FileBot" mainclassname="net.filebot.Main" icon="${dir.installer}/appbundle/filebot.icns" copyright="2015 Reinhard Pointner" applicationcategory="public.app-category.productivity" supportsautomaticgraphicsswitching="true">
<classpath file="${path.fatjar}" />
<librarypath dir="${dir.lib}/native/mac-x86_64" />
<arch name="x86_64" />

View File

@ -17,7 +17,6 @@ import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.JFileChooser;
@ -201,30 +200,30 @@ public class UserFiles {
COCOA {
private final String KEY_NSOPENPANEL_BROKEN = "NSOPENPANEL_BROKEN";
// 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();
// 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.");
// 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