aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-17 01:44:40 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-17 01:44:50 +0530
commitc477d24d67c359c4a5edc34b9b23232649dcfb6f (patch)
tree9cfdb6dedfaf91e8f8b9812b6cc92572272015a0 /WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
parentmacOS: Tunnel edit: Rename action handling methods (diff)
downloadwireguard-apple-c477d24d67c359c4a5edc34b9b23232649dcfb6f.tar.xz
wireguard-apple-c477d24d67c359c4a5edc34b9b23232649dcfb6f.zip
macOS: Manage tunnels: Keyboard shortcuts
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift8
1 files changed, 8 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift
index 2c7f25ad..adb32aa4 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 {