Merged
Conversation
keith
requested changes
Jun 23, 2017
Brisk/AppDelegate.swift
Outdated
|
|
||
| private func registerRadarURLs() { | ||
| let eventManager = NSAppleEventManager.shared() | ||
| let selector = #selector(handleGetURLEvent(event:withReplyEvent:)) |
Brisk/AppDelegate.swift
Outdated
|
|
||
| @objc | ||
| private func handleGetURLEvent(event: NSAppleEventDescriptor, withReplyEvent: NSAppleEventDescriptor) { | ||
| let radarID = event.paramDescriptor(forKeyword: keyDirectObject)?.stringValue.flatMap(radarID(from:)) |
Member
There was a problem hiding this comment.
I would guard the link separately here so you can put it in the alert window message
Brisk/AppDelegate.swift
Outdated
| } else { | ||
| let alert = NSAlert() | ||
| alert.messageText = "Invalid Radar ID" | ||
| alert.addButton(withTitle: "OK") |
Brisk/AppDelegate.swift
Outdated
| let radarID = event.paramDescriptor(forKeyword: keyDirectObject)?.stringValue.flatMap(radarID(from:)) | ||
| if let radarID = radarID { | ||
| _ = self.dupeRadarMenuItem.target?.perform(self.dupeRadarMenuItem.action!) | ||
| let viewControllers = NSApp.windows.flatMap { $0.contentViewController } |
Member
There was a problem hiding this comment.
let viewController = NSApp.windows
.flatMap { $0.contentViewController as? FileDuplicateViewController }
.first!
viewController.searchForOpenRadar(text: radarID)?
Brisk/AppDelegate.swift
Outdated
| private func handleGetURLEvent(event: NSAppleEventDescriptor, withReplyEvent: NSAppleEventDescriptor) { | ||
| let radarID = event.paramDescriptor(forKeyword: keyDirectObject)?.stringValue.flatMap(radarID(from:)) | ||
| if let radarID = radarID { | ||
| _ = self.dupeRadarMenuItem.target?.perform(self.dupeRadarMenuItem.action!) |
Member
There was a problem hiding this comment.
I would force unwrap target here, this is a programming error if it isn't connected
Member
|
Please add changelog entry |
Member
|
Fixes #77 |
This makes the app responsive to rdar:// URLs. rdar://12345 will open the app, search OpenRadar for radar 12345, and will display its contents if available on OpenRadar. The radar can then easily be duped.
80ab34b to
947ac45
Compare
Contributor
Author
|
All done |
keith
approved these changes
Jun 23, 2017
Member
|
🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the app responsive to rdar:// URLs. rdar://12345 will open
the app, search OpenRadar for radar 12345, and will display its
contents if available on OpenRadar. The radar can then easily be duped.
Fixes #77