From 986c5d3741e9af9ff899dde99e1e51970142de59 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Sat, 9 Mar 2019 16:05:22 +0530 Subject: [PATCH] on-demand: macOS: Tunnel detail: List SSIDs --- WireGuard/WireGuard/Base.lproj/Localizable.strings | 1 + .../TunnelDetailTableViewController.swift | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/WireGuard/WireGuard/Base.lproj/Localizable.strings b/WireGuard/WireGuard/Base.lproj/Localizable.strings index 32b792f..6150a0a 100644 --- a/WireGuard/WireGuard/Base.lproj/Localizable.strings +++ b/WireGuard/WireGuard/Base.lproj/Localizable.strings @@ -93,6 +93,7 @@ "tunnelOnDemandOnlySSIDs (%d)" = "Only %d SSIDs"; "tunnelOnDemandExceptSSID (%d)" = "Except %d SSID"; "tunnelOnDemandExceptSSIDs (%d)" = "Except %d SSIDs"; +"tunnelOnDemandSSIDOptionDescriptionMac (%1$@: %2$@)" = "%1$@: %2$@"; "tunnelOnDemandSSIDViewTitle" = "SSIDs"; "tunnelOnDemandSectionTitleSelectedSSIDs" = "SSIDs"; diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift index 152cbda..06b505a 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift @@ -403,7 +403,15 @@ extension TunnelDetailTableViewController: NSTableViewDelegate { case .onDemandSSIDRow: let cell: KeyValueRow = tableView.dequeueReusableCell() cell.key = tr("macFieldOnDemandSSIDs") - cell.value = onDemandViewModel.ssidOption.localizedUIString + let value: String + if onDemandViewModel.ssidOption == .anySSID { + value = onDemandViewModel.ssidOption.localizedUIString + } else { + value = tr(format: "tunnelOnDemandSSIDOptionDescriptionMac (%1$@: %2$@)", + onDemandViewModel.ssidOption.localizedUIString, + onDemandViewModel.selectedSSIDs.joined(separator: ", ")) + } + cell.value = value cell.isKeyInBold = false return cell }