Bug gixes, features added, GUI updates and more
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
#if os(macOS)
|
||||
import AppKit
|
||||
#endif
|
||||
|
||||
@main
|
||||
struct oAIApp: App {
|
||||
@@ -32,7 +35,25 @@ struct oAIApp: App {
|
||||
showAbout = true
|
||||
}
|
||||
}
|
||||
|
||||
CommandGroup(replacing: .help) {
|
||||
Button("oAI Help") {
|
||||
openHelp()
|
||||
}
|
||||
.keyboardShortcut("?", modifiers: .command)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
private func openHelp() {
|
||||
if let helpBookURL = Bundle.main.url(forResource: "oAI.help", withExtension: nil) {
|
||||
NSWorkspace.shared.open(helpBookURL.appendingPathComponent("Contents/Resources/en.lproj/index.html"))
|
||||
} else {
|
||||
// Fallback to Apple Help if help book not found
|
||||
NSHelpManager.shared.openHelpAnchor("", inBook: Bundle.main.object(forInfoDictionaryKey: "CFBundleHelpBookName") as? String)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user