From c477d24d67c359c4a5edc34b9b23232649dcfb6f Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Thu, 17 Jan 2019 01:44:40 +0530 Subject: macOS: Manage tunnels: Keyboard shortcuts Signed-off-by: Roopesh Chander --- .../UI/macOS/ViewController/TunnelDetailTableViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift') diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift index 2c7f25a..adb32aa 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift @@ -201,6 +201,14 @@ class TunnelDetailTableViewController: NSViewController { presentAsSheet(tunnelEditVC) } + @objc func handleToggleActiveStatusAction() { + if tunnel.status == .inactive { + tunnelsManager.startActivation(of: tunnel) + } else if tunnel.status == .active { + tunnelsManager.startDeactivation(of: tunnel) + } + } + @objc func statusCheckboxToggled(sender: AnyObject?) { guard let statusCheckbox = sender as? NSButton else { return } if statusCheckbox.state == .on { -- cgit v1.2.3-59-g8ed1b