1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

* fix docs

This commit is contained in:
Reinhard Pointner 2015-05-07 14:23:24 +00:00
parent 680317bb03
commit 9869f30081

View File

@ -48,20 +48,17 @@ public class MacAppUtilities {
final EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue(); final EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
final SecondaryLoop secondaryLoop = eventQueue.createSecondaryLoop(); final SecondaryLoop secondaryLoop = eventQueue.createSecondaryLoop();
System.out.println("before dispatch_async"); // WARNING: dispatch_sync seems to work on most Mac always causes a deadlock and freezes the application on others (in particular MBP with 2 graphics chips)
dispatch_async(new Runnable() { dispatch_async(new Runnable() {
@Override @Override
public void run() { public void run() {
System.out.println("before NSOpenPanel");
Proxy peer = objc().sendProxy("NSOpenPanel", "openPanel"); Proxy peer = objc().sendProxy("NSOpenPanel", "openPanel");
peer.send("setTitle:", title); peer.send("setTitle:", title);
peer.send("setAllowsMultipleSelection:", multipleMode ? 1 : 0); peer.send("setAllowsMultipleSelection:", multipleMode ? 1 : 0);
System.out.println("before setCanChooseDirectories");
peer.send("setCanChooseDirectories:", canChooseDirectories ? 1 : 0); peer.send("setCanChooseDirectories:", canChooseDirectories ? 1 : 0);
peer.send("setCanChooseFiles:", canChooseFiles ? 1 : 0); peer.send("setCanChooseFiles:", canChooseFiles ? 1 : 0);
System.out.println("before NSMutableArray");
if (allowedFileTypes != null) { if (allowedFileTypes != null) {
Proxy mutableArray = objc().sendProxy("NSMutableArray", "arrayWithCapacity:", allowedFileTypes.length); Proxy mutableArray = objc().sendProxy("NSMutableArray", "arrayWithCapacity:", allowedFileTypes.length);
for (String type : allowedFileTypes) { for (String type : allowedFileTypes) {
@ -70,7 +67,6 @@ public class MacAppUtilities {
peer.send("setAllowedFileTypes:", mutableArray); peer.send("setAllowedFileTypes:", mutableArray);
} }
System.out.println("before runModal");
if (peer.sendInt("runModal") != 0) { if (peer.sendInt("runModal") != 0) {
Proxy nsArray = peer.getProxy("URLs"); Proxy nsArray = peer.getProxy("URLs");
int size = nsArray.sendInt("count"); int size = nsArray.sendInt("count");
@ -81,17 +77,14 @@ public class MacAppUtilities {
} }
} }
System.out.println("before secondaryLoop.exit");
secondaryLoop.exit(); secondaryLoop.exit();
} }
}); });
// Enter the loop to block the current event handler, but leave UI responsive // Enter the loop to block the current event handler, but leave UI responsive
System.out.println("before secondaryLoop.enter");
if (!secondaryLoop.enter()) { if (!secondaryLoop.enter()) {
throw new RuntimeException("SecondaryLoop.enter()"); throw new RuntimeException("SecondaryLoop.enter()");
} }
System.out.println("after secondaryLoop.enter");
return result; return result;
} }