macOS: Manage tunnels: Keyboard shortcuts

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander
2019-01-17 01:44:40 +05:30
parent bf9cb092a9
commit c477d24d67
2 changed files with 35 additions and 0 deletions
@@ -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 {