diff --git a/build.xml b/build.xml index b330622e..8d88ecaf 100644 --- a/build.xml +++ b/build.xml @@ -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" /> @@ -366,7 +366,7 @@ <target name="ubuntu-debsrc" depends="svn-update, fatjar"> <property name="jre.version" value="jdk-8u45" /> <property name="jre.dir" value="${basedir}/jre" /> - + <property name="path.tarbin" location="${dir.dist}/filebot-${version}-tarbin.tar.gz" /> <property name="path.debsrc" location="${dir.dist}/filebot-${version}-debsrc.tar.gz" /> <property name="dir.debsrc" location="${dir.dist}/debian-source-package/filebot/filebot-${version}" /> @@ -534,7 +534,7 @@ <icon size="72" file="${dir.installer}/icons/icon72.png" /> <icon size="256" file="${dir.installer}/icons/icon256.png" /> - + <package file="${path.fatjar}" fullpath="FileBot.jar" /> <package dir="${dir.installer}/spk/package" includes="*.sh" filemode="755" /> <scripts dir="${dir.installer}/spk/scripts" filemode="755" /> diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java index 97fc28f0..4280c42b 100644 --- a/source/net/filebot/UserFiles.java +++ b/source/net/filebot/UserFiles.java @@ -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