Add Help menu items.
This commit is contained in:
parent
b502d297e6
commit
e79dbaef68
@ -12,6 +12,7 @@ import DataModel
|
|||||||
import RSTextDrawing
|
import RSTextDrawing
|
||||||
import RSTree
|
import RSTree
|
||||||
import RSXML
|
import RSXML
|
||||||
|
import RSWeb
|
||||||
|
|
||||||
var currentTheme: VSTheme!
|
var currentTheme: VSTheme!
|
||||||
|
|
||||||
@ -283,6 +284,26 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
}
|
}
|
||||||
addFeed(appNewsURLString, "Evergreen News")
|
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 {
|
private extension AppDelegate {
|
||||||
|
@ -400,7 +400,33 @@
|
|||||||
<items>
|
<items>
|
||||||
<menuItem title="Evergreen Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
<menuItem title="Evergreen Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
<action selector="showHelp:" target="Voe-Tx-rLC" id="WJP-8V-s4K"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="iyN-Fr-QXC"/>
|
||||||
|
<menuItem title="Add Evergreen News Feed" id="cmP-uH-mS8">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="addAppNews:" target="Ady-hI-5gd" id="xHC-9j-EpT"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="rK6-cL-4Vj"/>
|
||||||
|
<menuItem title="Website" id="q2Z-9K-GBd">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="openWebsite:" target="Ady-hI-5gd" id="rmL-lt-p8g"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="GitHub Repository" id="QfD-Xw-sdF">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="openRepository:" target="Ady-hI-5gd" id="7xZ-V2-iPD"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Bug Tracker" id="mE2-pM-rQF">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="openBugTracker:" target="Ady-hI-5gd" id="fZQ-ng-gIm"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
</items>
|
</items>
|
||||||
|
@ -21,7 +21,7 @@ func openInBrowser(_ urlString: String) {
|
|||||||
func openInBrowser(_ urlString: String, inBackground: Bool) {
|
func openInBrowser(_ urlString: String, inBackground: Bool) {
|
||||||
|
|
||||||
if let url = URL(string: urlString) {
|
if let url = URL(string: urlString) {
|
||||||
let _ = MacWebBrowser.openURL(url, inBackground: inBackground)
|
MacWebBrowser.openURL(url, inBackground: inBackground)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import Cocoa
|
|||||||
|
|
||||||
public class MacWebBrowser {
|
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 {
|
guard let preparedURL = url.preparedForOpeningInBrowser() else {
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user