1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 11:37:32 +03:00

GH-232 Install AppleEvent handler in "will-finish".

- It's too late in "did-finish" when the App is not launched.
This commit is contained in:
Tae Won Ha 2016-08-25 09:53:51 +02:00
parent 8a171528ed
commit 7cf3c2e7bc
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -80,6 +80,12 @@ extension AppDelegate {
func applicationWillFinishLaunching(_: NSNotification) {
self.launching = true
let appleEventManager = NSAppleEventManager.sharedAppleEventManager()
appleEventManager.setEventHandler(self,
andSelector: #selector(AppDelegate.handleGetUrlEvent(_:withReplyEvent:)),
forEventClass: UInt32(kInternetEventClass),
andEventID: UInt32(kAEGetURL))
}
func applicationDidFinishLaunching(_: NSNotification) {
@ -92,12 +98,6 @@ extension AppDelegate {
#if DEBUG
self.debugMenu.hidden = false
#endif
let appleEventManager = NSAppleEventManager.sharedAppleEventManager()
appleEventManager.setEventHandler(self,
andSelector: #selector(AppDelegate.handleGetUrlEvent(_:withReplyEvent:)),
forEventClass: UInt32(kInternetEventClass),
andEventID: UInt32(kAEGetURL))
}
func applicationOpenUntitledFile(sender: NSApplication) -> Bool {