diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 07f3d1162..11089f18b 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -588,6 +588,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, Browser.open("https://ranchero.com/netnewswire/", inBackground: false) } + + @IBAction func openReleaseNotes(_ sender: Any?) { + Browser.open(URL.releaseNotes.absoluteString, inBackground: false) + } + @IBAction func openHowToSupport(_ sender: Any?) { diff --git a/Mac/Base.lproj/Main.storyboard b/Mac/Base.lproj/Main.storyboard index b17af2ae5..9e3bdf707 100644 --- a/Mac/Base.lproj/Main.storyboard +++ b/Mac/Base.lproj/Main.storyboard @@ -615,6 +615,12 @@ + + + + + + diff --git a/Multiplatform/Shared/MainApp.swift b/Multiplatform/Shared/MainApp.swift index b6d4bbc40..e3b3dc473 100644 --- a/Multiplatform/Shared/MainApp.swift +++ b/Multiplatform/Shared/MainApp.swift @@ -75,7 +75,7 @@ struct MainApp: App { }) CommandGroup(after: .help, addition: { Button("Release Notes", action: { - NSWorkspace.shared.open(ReleaseNotes().url) + NSWorkspace.shared.open(URL.releaseNotes) }) .keyboardShortcut("V", modifiers: [.shift, .command]) }) diff --git a/Multiplatform/Shared/Release Notes/ReleaseNotes.swift b/Multiplatform/Shared/Release Notes/ReleaseNotes.swift deleted file mode 100644 index d9a91fbba..000000000 --- a/Multiplatform/Shared/Release Notes/ReleaseNotes.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ReleaseNotes.swift -// NetNewsWire -// -// Created by Stuart Breckenridge on 13/8/20. -// Copyright © 2020 Ranchero Software. All rights reserved. -// - -import Foundation - -struct ReleaseNotes { - - var url: URL { - var gitHub = "https://github.com/Ranchero-Software/NetNewsWire/releases/tag/" - #if os(macOS) - gitHub += "mac-\(String(describing: versionString()))" - return URL(string: gitHub)! - #else - gitHub += "ios-\(String(describing: versionString()))" - return URL(string: gitHub)! - #endif - } - - private func versionString() -> String { - Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "" - } - -} diff --git a/Multiplatform/iOS/Settings/SettingsModel.swift b/Multiplatform/iOS/Settings/SettingsModel.swift index 2710601bd..63443d3fc 100644 --- a/Multiplatform/iOS/Settings/SettingsModel.swift +++ b/Multiplatform/iOS/Settings/SettingsModel.swift @@ -31,7 +31,7 @@ class SettingsModel: ObservableObject { case .netNewsWireSlack: return URL(string: "https://ranchero.com/netnewswire/slack")! case .releaseNotes: - return ReleaseNotes().url + return URL.releaseNotes case .none: return nil } diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 37c5c2141..7ea6da89a 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -56,8 +56,6 @@ 17A1598624E3DEDD005DA32A /* RSDatabase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 17A1598424E3DEDD005DA32A /* RSDatabase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 17A1598824E3DEDD005DA32A /* RSParser in Frameworks */ = {isa = PBXBuildFile; productRef = 17A1598724E3DEDD005DA32A /* RSParser */; }; 17A1598924E3DEDD005DA32A /* RSParser in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 17A1598724E3DEDD005DA32A /* RSParser */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 17AC0ABB24E4B65E004C1231 /* ReleaseNotes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17AC0ABA24E4B65E004C1231 /* ReleaseNotes.swift */; }; - 17AC0ABC24E4B65E004C1231 /* ReleaseNotes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17AC0ABA24E4B65E004C1231 /* ReleaseNotes.swift */; }; 17D232A824AFF10A0005F075 /* AddWebFeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D232A724AFF10A0005F075 /* AddWebFeedModel.swift */; }; 17D232A924AFF10A0005F075 /* AddWebFeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D232A724AFF10A0005F075 /* AddWebFeedModel.swift */; }; 17D5F17124B0BC6700375168 /* SidebarToolbarModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D5F17024B0BC6700375168 /* SidebarToolbarModel.swift */; }; @@ -1474,7 +1472,6 @@ 1799E6A824C2F93F00511E91 /* InspectorPlatformModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorPlatformModifier.swift; sourceTree = ""; }; 1799E6CC24C320D600511E91 /* InspectorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorModel.swift; sourceTree = ""; }; 179DBBA2B22A659F81EED6F9 /* AccountsNewsBlurWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountsNewsBlurWindowController.swift; sourceTree = ""; }; - 17AC0ABA24E4B65E004C1231 /* ReleaseNotes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReleaseNotes.swift; sourceTree = ""; }; 17B223DB24AC24D2001E4592 /* TimelineLayoutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineLayoutView.swift; sourceTree = ""; }; 17D232A724AFF10A0005F075 /* AddWebFeedModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddWebFeedModel.swift; sourceTree = ""; }; 17D5F17024B0BC6700375168 /* SidebarToolbarModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarToolbarModel.swift; sourceTree = ""; }; @@ -2282,14 +2279,6 @@ path = Add; sourceTree = ""; }; - 17AC0ACB24E4B66A004C1231 /* Release Notes */ = { - isa = PBXGroup; - children = ( - 17AC0ABA24E4B65E004C1231 /* ReleaseNotes.swift */, - ); - path = "Release Notes"; - sourceTree = ""; - }; 510289CE2451BA1E00426DDF /* Twitter */ = { isa = PBXGroup; children = ( @@ -2706,7 +2695,6 @@ 514E6C0424AD2B0400AC6F6E /* SwiftUI Extensions */, 51919FCB24AB855000541E64 /* Timeline */, 171BCBB124CBD569006E22D9 /* Account Management */, - 17AC0ACB24E4B66A004C1231 /* Release Notes */, ); path = Shared; sourceTree = ""; @@ -4575,7 +4563,6 @@ 51E4991724A8090400B667CB /* ArticleUtilities.swift in Sources */, 51E4991B24A8091000B667CB /* IconImage.swift in Sources */, 51E4995424A8734D00B667CB /* ExtensionPointIdentifer.swift in Sources */, - 17AC0ABB24E4B65E004C1231 /* ReleaseNotes.swift in Sources */, 51E4996924A8760C00B667CB /* ArticleStylesManager.swift in Sources */, 5177471E24B387E100EB0F74 /* ImageTransition.swift in Sources */, 51E498F324A8085D00B667CB /* PseudoFeed.swift in Sources */, @@ -4792,7 +4779,6 @@ 51E4990724A808C300B667CB /* AuthorAvatarDownloader.swift in Sources */, 51E4997424A8784400B667CB /* DefaultFeedsImporter.swift in Sources */, 51919FF524AB869C00541E64 /* TimelineItem.swift in Sources */, - 17AC0ABC24E4B65E004C1231 /* ReleaseNotes.swift in Sources */, 51E4992024A8095000B667CB /* RSImage-Extensions.swift in Sources */, 51E499FE24A9137600B667CB /* SidebarModel.swift in Sources */, 51E498FE24A808BA00B667CB /* FaviconDownloader.swift in Sources */, diff --git a/Shared/Extensions/URL-Extensions.swift b/Shared/Extensions/URL-Extensions.swift index 4fb9b8d7f..a9577c9e1 100644 --- a/Shared/Extensions/URL-Extensions.swift +++ b/Shared/Extensions/URL-Extensions.swift @@ -15,4 +15,17 @@ extension URL { scheme == "mailto" ? URLComponents(url: self, resolvingAgainstBaseURL: false)?.path : nil } + /// URL pointing to current app version release notes. + static var releaseNotes: URL { + let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "" + var gitHub = "https://github.com/Ranchero-Software/NetNewsWire/releases/tag/" + #if os(macOS) + gitHub += "mac-\(String(describing: appVersion))" + return URL(string: gitHub)! + #else + gitHub += "ios-\(String(describing: appVersion))" + return URL(string: gitHub)! + #endif + } + } diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 78e2a1dfb..6dd97105e 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -1,10 +1,12 @@ - + - + + + @@ -144,7 +146,7 @@ - + @@ -780,13 +799,13 @@ @@ -801,7 +820,7 @@ - + @@ -820,7 +839,8 @@ - + + @@ -835,7 +855,6 @@ - @@ -878,7 +897,7 @@ - + @@ -891,14 +910,14 @@ - + + - @@ -915,7 +934,7 @@ - + @@ -963,18 +982,18 @@ - + - +