aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/AppDelegate.swift')
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppDelegate.swift19
1 files changed, 19 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
index 3f69ea3..8dc5825 100644
--- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
@@ -17,6 +17,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
Logger.configureGlobal(tagged: "APP", withFilePath: FileManager.logFileURL?.path)
registerLoginItem(shouldLaunchAtLogin: true)
+ NSApp.mainMenu = MainMenu()
TunnelsManager.create { [weak self] result in
guard let self = self else { return }
@@ -104,6 +105,24 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
+extension AppDelegate {
+ @objc func aboutClicked() {
+ var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
+ if let appBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String {
+ appVersion += " (\(appBuild))"
+ }
+ let appVersionString = [
+ tr(format: "macAppVersion (%@)", appVersion),
+ tr(format: "macGoBackendVersion (%@)", WIREGUARD_GO_VERSION)
+ ].joined(separator: "\n")
+ NSApp.activate(ignoringOtherApps: true)
+ NSApp.orderFrontStandardAboutPanel(options: [
+ .applicationVersion: appVersionString,
+ .version: ""
+ ])
+ }
+}
+
extension AppDelegate: StatusMenuWindowDelegate {
func manageTunnelsWindow() -> NSWindow {
if manageTunnelsWindowObject == nil {