macOS: Both list and detail main menu items should be always enabled

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-05-09 18:52:58 +05:30
parent 404fa741e8
commit f9880907a2
1 changed files with 18 additions and 0 deletions

View File

@ -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)
}
}
}