From: Roopesh Chander Date: Thu, 9 May 2019 13:22:58 +0000 (+0530) Subject: macOS: Both list and detail main menu items should be always enabled X-Git-Tag: 0.0.20190531-9~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9880907a24b526dacd3d5ee0d69d0963ec5e5dd;p=thirdparty%2Fwireguard-apple.git macOS: Both list and detail main menu items should be always enabled Signed-off-by: Roopesh Chander --- diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/ManageTunnelsRootViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/ManageTunnelsRootViewController.swift index aa6a76d..179387f 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/ManageTunnelsRootViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/ManageTunnelsRootViewController.swift @@ -115,3 +115,21 @@ extension ManageTunnelsRootViewController: TunnelsListTableViewControllerDelegat self.tunnelDetailVC = nil } } + +extension ManageTunnelsRootViewController { + override func supplementalTarget(forAction action: Selector, sender: Any?) -> Any? { + switch action { + case #selector(TunnelsListTableViewController.handleViewLogAction), + #selector(TunnelsListTableViewController.handleAddEmptyTunnelAction), + #selector(TunnelsListTableViewController.handleImportTunnelAction), + #selector(TunnelsListTableViewController.handleExportTunnelsAction), + #selector(TunnelsListTableViewController.handleRemoveTunnelAction): + return tunnelsListVC + case #selector(TunnelDetailTableViewController.handleToggleActiveStatusAction), + #selector(TunnelDetailTableViewController.handleEditTunnelAction): + return tunnelDetailVC + default: + return super.supplementalTarget(forAction: action, sender: sender) + } + } +}