From e79dbaef68963c3a048241f4a1a65a0f25f9e3fd Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 27 May 2017 13:37:50 -0700 Subject: [PATCH] Add Help menu items. --- Evergreen/AppDelegate.swift | 21 ++++++++++++++++ Evergreen/Base.lproj/Main.storyboard | 28 +++++++++++++++++++++- Evergreen/Browser.swift | 2 +- Frameworks/RSWeb/RSWeb/MacWebBrowser.swift | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Evergreen/AppDelegate.swift b/Evergreen/AppDelegate.swift index 639cb3c4b..65d55ce55 100644 --- a/Evergreen/AppDelegate.swift +++ b/Evergreen/AppDelegate.swift @@ -12,6 +12,7 @@ import DataModel import RSTextDrawing import RSTree import RSXML +import RSWeb var currentTheme: VSTheme! @@ -283,6 +284,26 @@ class AppDelegate: NSObject, NSApplicationDelegate { } addFeed(appNewsURLString, "Evergreen News") } + + @IBAction func openWebsite(_ sender: AnyObject) { + + openInBrowser("http://ranchero.com/evergreen/", inBackground: false) + } + + @IBAction func openRepository(_ sender: AnyObject) { + + openInBrowser("https://github.com/brentsimmons/Evergreen", inBackground: false) + } + + @IBAction func openBugTracker(_ sender: AnyObject) { + + openInBrowser("https://github.com/brentsimmons/Evergreen/issues", inBackground: false) + } + + @IBAction func showHelp(_ sender: AnyObject) { + + openInBrowser("http://ranchero.com/evergreen/help/1.0/", inBackground: false) + } } private extension AppDelegate { diff --git a/Evergreen/Base.lproj/Main.storyboard b/Evergreen/Base.lproj/Main.storyboard index 9b0947de2..d2ce2dd21 100644 --- a/Evergreen/Base.lproj/Main.storyboard +++ b/Evergreen/Base.lproj/Main.storyboard @@ -400,7 +400,33 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Evergreen/Browser.swift b/Evergreen/Browser.swift index 2a6593205..f5df40be3 100644 --- a/Evergreen/Browser.swift +++ b/Evergreen/Browser.swift @@ -21,7 +21,7 @@ func openInBrowser(_ urlString: String) { func openInBrowser(_ urlString: String, inBackground: Bool) { if let url = URL(string: urlString) { - let _ = MacWebBrowser.openURL(url, inBackground: inBackground) + MacWebBrowser.openURL(url, inBackground: inBackground) } } diff --git a/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift b/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift index 05dc6cdb6..6b457681f 100755 --- a/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift +++ b/Frameworks/RSWeb/RSWeb/MacWebBrowser.swift @@ -10,7 +10,7 @@ import Cocoa public class MacWebBrowser { - public class func openURL(_ url: URL, inBackground: Bool) -> Bool { + @discardableResult public class func openURL(_ url: URL, inBackground: Bool) -> Bool { guard let preparedURL = url.preparedForOpeningInBrowser() else { return false