From b0bdae8834988a46095006d61d347fcd44c117a7 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Thu, 9 May 2019 18:52:58 +0530 Subject: [PATCH] macOS: Both list and detail main menu items should be always enabled --- .../ManageTunnelsRootViewController.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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) + } + } +}