Add bug report and feature request options to Help menu

This will support error messages that instruct the user to go to the Help menu for these things.
This commit is contained in:
Brandon Evans 2021-01-25 19:09:06 -07:00
parent 9a2057bcd5
commit 6b5a64010e
No known key found for this signature in database
GPG key ID: D58A4B8DB64F8E93
2 changed files with 22 additions and 1 deletions

View file

@ -2,6 +2,7 @@ import SwiftUI
struct AboutView: View {
let showAcknowledgementsWindow: () -> Void
@SwiftUI.Environment(\.openURL) var openURL: OpenURLAction
var body: some View {
HStack {
@ -18,7 +19,7 @@ struct AboutView: View {
HStack(spacing: 32) {
Button(action: {
NSWorkspace.shared.open(URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")!)
openURL(URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")!)
}) {
Label("GitHub Repo", systemImage: "link")
}

View file

@ -7,6 +7,7 @@ import SwiftUI
struct XcodesApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate: AppDelegate
@SwiftUI.Environment(\.scenePhase) private var scenePhase: ScenePhase
@SwiftUI.Environment(\.openURL) var openURL: OpenURLAction
@StateObject private var appState = AppState()
var body: some Scene {
@ -51,6 +52,25 @@ struct XcodesApp: App {
}
XcodeCommands(appState: appState)
CommandGroup(replacing: CommandGroupPlacement.help) {
Button("Xcodes GitHub Repo") {
let xcodesRepoURL = URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")!
openURL(xcodesRepoURL)
}
Divider()
Button("Report a Bug") {
let bugReportURL = URL(string: "https://github.com/RobotsAndPencils/XcodesApp/issues/new?assignees=&labels=bug&template=bug_report.md&title=")!
openURL(bugReportURL)
}
Button("Request a New Feature") {
let featureRequestURL = URL(string: "https://github.com/RobotsAndPencils/XcodesApp/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=")!
openURL(featureRequestURL)
}
}
}
}