Create and use shared HelpURL for various help URLs.

This commit is contained in:
Brent Simmons committed 2025-09-29 13:50:01 -07:00
1 parent 6f947467ac
commit f7dfac3e6a
4 files changed
+52 -25

No files matched your search

+13 -19
View File
@@ -616,45 +616,39 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidat
}
@IBAction func openWebsite(_ sender: Any?) {
Browser.open("https://netnewswire.com/", inBackground: false)
HelpURL.website.open()
}
@IBAction func openReleaseNotes(_ sender: Any?) {
Browser.open(URL.releaseNotes.absoluteString, inBackground: false)
HelpURL.releaseNotes.open()
}
@IBAction func openHowToSupport(_ sender: Any?) {
Browser.open("https://github.com/brentsimmons/NetNewsWire/blob/main/Technotes/HowToSupportNetNewsWire.markdown", inBackground: false)
HelpURL.howToSupportNetNewsWire.open()
}
@IBAction func openRepository(_ sender: Any?) {
Browser.open("https://github.com/brentsimmons/NetNewsWire", inBackground: false)
@IBAction func openTechnotes(_ sender: Any?) {
HelpURL.technotes.open()
}
@IBAction func openRepository(_ sender: Any?) {
HelpURL.githubRepo.open()
}
@IBAction func openBugTracker(_ sender: Any?) {
Browser.open("https://github.com/brentsimmons/NetNewsWire/issues", inBackground: false)
HelpURL.bugTracker.open()
}
@IBAction func openSlackGroup(_ sender: Any?) {
Browser.open("https://netnewswire.com/slack", inBackground: false)
HelpURL.slack.open()
}
@IBAction func showHelp(_ sender: Any?) {
Browser.open("https://netnewswire.com/help/mac/6.1/en/", inBackground: false)
}
@IBAction func donateToAppCampForGirls(_ sender: Any?) {
Browser.open("https://appcamp4girls.com/contribute/", inBackground: false)
HelpURL.helpHome.open()
}
@IBAction func showPrivacyPolicy(_ sender: Any?) {
Browser.open("https://netnewswire.com/privacypolicy.html", inBackground: false)
HelpURL.privacyPolicy.open()
}
@IBAction func gotoToday(_ sender: Any?) {
+8 -2
View File
@@ -646,10 +646,16 @@
<action selector="openBugTracker:" target="Ady-hI-5gd" id="fZQ-ng-gIm"/>
</connections>
</menuItem>
<menuItem title="Slack Group" id="4eb-qF-n9S">
<menuItem title="Slack Group" id="OKC-FV-V33">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openSlackGroup:" target="Ady-hI-5gd" id="YX2-gA-pgV"/>
<action selector="openSlackGroup:" target="Ady-hI-5gd" id="5HZ-0D-vG5"/>
</connections>
</menuItem>
<menuItem title="Technotes" id="4eb-qF-n9S">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openTechnotes:" target="Ady-hI-5gd" id="O06-UA-SCO"/>
</connections>
</menuItem>
</items>
+28
View File
@@ -0,0 +1,28 @@
//
// HelpURL.swift
// NetNewsWire
//
// Created by Brent Simmons on 9/29/25.
// Copyright © 2025 Ranchero Software. All rights reserved.
//
import Foundation
enum HelpURL: String {
case helpHome = "https://netnewswire.com/help/"
case website = "https://netnewswire.com/"
case releaseNotes = "https://github.com/Ranchero-Software/NetNewsWire/releases/"
case howToSupportNetNewsWire = "https://github.com/Ranchero-Software/NetNewsWire/blob/main/Technotes/HowToSupportNetNewsWire.markdown"
case githubRepo = "https://github.com/Ranchero-Software/NetNewsWire"
case bugTracker = "https://github.com/Ranchero-Software/NetNewsWire/issues"
case slack = "https://netnewswire.com/slack"
case technotes = "https://github.com/Ranchero-Software/NetNewsWire/tree/main/Technotes"
case privacyPolicy = "https://netnewswire.com/privacypolicy.html"
#if os(macOS)
func open() {
Browser.open(self.rawValue, inBackground: false)
}
#endif
}
+3 -4
View File
@@ -222,13 +222,13 @@ final class SettingsViewController: UITableViewController {
case 6:
switch indexPath.row {
case 0:
openURL("https://netnewswire.com/help/ios/6.1/en/")
openURL(HelpURL.helpHome.rawValue)
tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
case 1:
openURL(URL.releaseNotes.absoluteString)
openURL(HelpURL.releaseNotes.rawValue)
tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
case 2:
openURL("https://github.com/brentsimmons/NetNewsWire/issues")
openURL(HelpURL.bugTracker.rawValue)
tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
case 3:
let timeline = UIStoryboard.settings.instantiateController(ofType: AboutViewController.self)
@@ -476,5 +476,4 @@ private extension SettingsViewController {
vc.modalPresentationStyle = .pageSheet
present(vc, animated: true)
}
}