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

This commit is contained in:
Roopesh Chander 2019-05-09 18:52:58 +05:30
parent 4f79bf7b9b
commit b0bdae8834
1 changed files with 18 additions and 0 deletions

View File

@ -115,3 +115,21 @@ extension ManageTunnelsRootViewController: TunnelsListTableViewControllerDelegat
self.tunnelDetailVC = nil 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)
}
}
}