macOS: Quit menu item
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
bc8ea55023
commit
53e915c578
|
@ -232,6 +232,7 @@
|
|||
"macMenuAddEmptyTunnel" = "Add empty tunnel...";
|
||||
"macMenuExportLog" = "Export log to file...";
|
||||
"macMenuExportTunnels" = "Export tunnels to zip...";
|
||||
"macMenuQuit" = "Quit";
|
||||
|
||||
// Mac manage tunnels window
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ class StatusMenu: NSMenu {
|
|||
addItem(NSMenuItem.separator())
|
||||
}
|
||||
addTunnelManagementItems()
|
||||
addItem(NSMenuItem.separator())
|
||||
addApplicationItems()
|
||||
}
|
||||
|
||||
required init(coder decoder: NSCoder) {
|
||||
|
@ -118,6 +120,12 @@ class StatusMenu: NSMenu {
|
|||
addItem(importItem)
|
||||
}
|
||||
|
||||
func addApplicationItems() {
|
||||
let quitItem = NSMenuItem(title: tr("macMenuQuit"), action: #selector(NSApplication.terminate), keyEquivalent: "")
|
||||
quitItem.target = NSApp
|
||||
addItem(quitItem)
|
||||
}
|
||||
|
||||
@objc func tunnelClicked(sender: AnyObject) {
|
||||
guard let tunnelMenuItem = sender as? NSMenuItem else { return }
|
||||
guard let tunnel = tunnelMenuItem.representedObject as? TunnelContainer else { return }
|
||||
|
|
Loading…
Reference in New Issue