diff --git a/WireGuard/WireGuard/Base.lproj/Localizable.strings b/WireGuard/WireGuard/Base.lproj/Localizable.strings index e69b6b6..c392085 100644 --- a/WireGuard/WireGuard/Base.lproj/Localizable.strings +++ b/WireGuard/WireGuard/Base.lproj/Localizable.strings @@ -220,3 +220,8 @@ "alertSystemErrorMessageTunnelConfigurationStale" = "The configuration is stale."; "alertSystemErrorMessageTunnelConfigurationReadWriteFailed" = "Reading or writing the configuration failed."; "alertSystemErrorMessageTunnelConfigurationUnknown" = "Unknown system error."; + +// Mac status bar menu + +"macMenuManageTunnels" = "Manage tunnels"; +"macMenuImportTunnels" = "Import tunnel(s) from file..."; diff --git a/WireGuard/WireGuard/UI/macOS/StatusMenu.swift b/WireGuard/WireGuard/UI/macOS/StatusMenu.swift index 4ac4b91..ed42bad 100644 --- a/WireGuard/WireGuard/UI/macOS/StatusMenu.swift +++ b/WireGuard/WireGuard/UI/macOS/StatusMenu.swift @@ -11,6 +11,8 @@ class StatusMenu: NSMenu { self.tunnelsManager = tunnelsManager super.init(title: "WireGuard Status Bar Menu") addTunnelMenuItems() + addItem(NSMenuItem.separator()) + addTunnelManagementItems() } required init(coder decoder: NSCoder) { @@ -31,4 +33,21 @@ class StatusMenu: NSMenu { guard let tunnel = sender.representedObject as? TunnelContainer else { return } print("Tunnel \(tunnel.name) clicked") } + + func addTunnelManagementItems() { + let manageItem = NSMenuItem(title: tr("macMenuManageTunnels"), action: #selector(manageTunnelsClicked), keyEquivalent: "") + manageItem.target = self + addItem(manageItem) + let importItem = NSMenuItem(title: tr("macMenuImportTunnels"), action: #selector(importTunnelsClicked), keyEquivalent: "") + importItem.target = self + addItem(importItem) + } + + @objc func manageTunnelsClicked() { + print("Unimplemented") + } + + @objc func importTunnelsClicked() { + print("Unimplemented") + } }