diff --git a/Multiplatform/Shared/MainApp.swift b/Multiplatform/Shared/MainApp.swift index 7d987072d..b6d4bbc40 100644 --- a/Multiplatform/Shared/MainApp.swift +++ b/Multiplatform/Shared/MainApp.swift @@ -73,6 +73,12 @@ struct MainApp: App { Button("Open in Browser", action: {}) .keyboardShortcut(.rightArrow, modifiers: [.command]) }) + CommandGroup(after: .help, addition: { + Button("Release Notes", action: { + NSWorkspace.shared.open(ReleaseNotes().url) + }) + .keyboardShortcut("V", modifiers: [.shift, .command]) + }) } // Mac Preferences diff --git a/Multiplatform/Shared/Release Notes/ReleaseNotes.swift b/Multiplatform/Shared/Release Notes/ReleaseNotes.swift new file mode 100644 index 000000000..f5cda3473 --- /dev/null +++ b/Multiplatform/Shared/Release Notes/ReleaseNotes.swift @@ -0,0 +1,32 @@ +// +// 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()))-\(String(describing: buildVersionString()))" + return URL(string: gitHub)! + #endif + } + + private func versionString() -> String { + Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "" + } + + private func buildVersionString() -> String { + Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "" + } + +} diff --git a/Multiplatform/iOS/Settings/SettingsModel.swift b/Multiplatform/iOS/Settings/SettingsModel.swift index 382be4e62..2710601bd 100644 --- a/Multiplatform/iOS/Settings/SettingsModel.swift +++ b/Multiplatform/iOS/Settings/SettingsModel.swift @@ -12,7 +12,7 @@ import Account class SettingsModel: ObservableObject { enum HelpSites { - case netNewsWireHelp, netNewsWire, supportNetNewsWire, github, bugTracker, technotes, netNewsWireSlack, none + case netNewsWireHelp, netNewsWire, supportNetNewsWire, github, bugTracker, technotes, netNewsWireSlack, releaseNotes, none var url: URL? { switch self { @@ -30,6 +30,8 @@ class SettingsModel: ObservableObject { return URL(string: "https://github.com/brentsimmons/NetNewsWire/tree/main/Technotes")! case .netNewsWireSlack: return URL(string: "https://ranchero.com/netnewswire/slack")! + case .releaseNotes: + return ReleaseNotes().url case .none: return nil } diff --git a/Multiplatform/iOS/Settings/SettingsView.swift b/Multiplatform/iOS/Settings/SettingsView.swift index ad4dbad45..3ba8de30b 100644 --- a/Multiplatform/iOS/Settings/SettingsView.swift +++ b/Multiplatform/iOS/Settings/SettingsView.swift @@ -203,6 +203,9 @@ struct SettingsView: View { Button("NetNewsWire Slack", action: { viewModel.selectedWebsite = .netNewsWireSlack }).foregroundColor(.primary) + Button("Release Notes", action: { + viewModel.selectedWebsite = .releaseNotes + }).foregroundColor(.primary) NavigationLink( destination: SettingsAboutView(), label: { diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 0c1d3ab89..fda989d4a 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -54,6 +54,8 @@ 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 */; }; @@ -1439,6 +1441,7 @@ 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 = ""; }; @@ -2231,6 +2234,14 @@ path = Add; sourceTree = ""; }; + 17AC0ACB24E4B66A004C1231 /* Release Notes */ = { + isa = PBXGroup; + children = ( + 17AC0ABA24E4B65E004C1231 /* ReleaseNotes.swift */, + ); + path = "Release Notes"; + sourceTree = ""; + }; 510289CE2451BA1E00426DDF /* Twitter */ = { isa = PBXGroup; children = ( @@ -2634,6 +2645,7 @@ 514E6C0424AD2B0400AC6F6E /* SwiftUI Extensions */, 51919FCB24AB855000541E64 /* Timeline */, 171BCBB124CBD569006E22D9 /* Account Management */, + 17AC0ACB24E4B66A004C1231 /* Release Notes */, ); path = Shared; sourceTree = ""; @@ -4447,6 +4459,7 @@ 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 */, @@ -4662,6 +4675,7 @@ 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 */,