mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add documentation comment and rename window parameter
This commit is contained in:
@@ -76,7 +76,13 @@ extension Browser {
|
||||
|
||||
extension Browser {
|
||||
|
||||
static func open(_ urlStrings: [String], alertingInWindow window: NSWindow?, invertPreference: Bool = false) {
|
||||
/// Open multiple pages in the default browser, warning if over a certain number of URLs are passed.
|
||||
/// - Parameters:
|
||||
/// - urlStrings: The URL strings to open.
|
||||
/// - window: The window on which to display the "over limit" alert sheet. If `nil`, will be displayed as a
|
||||
/// modal dialog.
|
||||
/// - invertPreference: Whether to invert the user's "Open web pages in background in browser" preference.
|
||||
static func open(_ urlStrings: [String], fromWindow window: NSWindow?, invertPreference: Bool = false) {
|
||||
if urlStrings.count > 500 {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
||||
@IBAction func openArticleInBrowser(_ sender: Any?) {
|
||||
guard let selectedArticles else { return }
|
||||
let urlStrings = selectedArticles.compactMap { $0.preferredLink }
|
||||
Browser.open(urlStrings, alertingInWindow: window, invertPreference: NSApp.currentEvent?.modifierFlags.contains(.shift) ?? false)
|
||||
Browser.open(urlStrings, fromWindow: window, invertPreference: NSApp.currentEvent?.modifierFlags.contains(.shift) ?? false)
|
||||
}
|
||||
|
||||
@IBAction func openInBrowser(_ sender: Any?) {
|
||||
|
||||
@@ -93,7 +93,7 @@ extension TimelineViewController {
|
||||
return
|
||||
}
|
||||
|
||||
Browser.open(urlStrings, alertingInWindow: self.view.window)
|
||||
Browser.open(urlStrings, fromWindow: self.view.window)
|
||||
}
|
||||
|
||||
@objc func copyURLFromContextualMenu(_ sender: Any?) {
|
||||
|
||||
@@ -316,7 +316,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
||||
|
||||
@objc func openArticleInBrowser(_ sender: Any?) {
|
||||
let urlStrings = selectedArticles.compactMap { $0.preferredLink }
|
||||
Browser.open(urlStrings, alertingInWindow: self.view.window)
|
||||
Browser.open(urlStrings, fromWindow: self.view.window)
|
||||
}
|
||||
|
||||
@IBAction func toggleStatusOfSelectedArticles(_ sender: Any?) {
|
||||
|
||||
Reference in New Issue
Block a user