From fc9e2de72cd9166572b3099fe0cc8102c9f2f2d0 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 9 Jan 2019 00:52:11 +0530 Subject: macOS: Update detail view after editing Signed-off-by: Roopesh Chander --- .../ViewController/TunnelDetailTableViewController.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift') diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift index 9e84e12..3c07060 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift @@ -192,6 +192,7 @@ class TunnelDetailTableViewController: NSViewController { @objc func editButtonClicked() { let tunnelEditVC = TunnelEditViewController(tunnelsManager: tunnelsManager, tunnel: tunnel) + tunnelEditVC.delegate = self presentAsSheet(tunnelEditVC) } @@ -234,3 +235,14 @@ extension TunnelDetailTableViewController: NSTableViewDelegate { } } } + +extension TunnelDetailTableViewController: TunnelEditViewControllerDelegate { + func tunnelSaved(tunnel: TunnelContainer) { + tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration) + tableView.reloadData() + } + + func tunnelEditingCancelled() { + // Nothing to do + } +} -- cgit v1.2.3-59-g8ed1b