on-demand: iOS: Only n SSIDs / Except m SSIDs
This commit is contained in:
parent
0e04f5d337
commit
a876386c05
|
@ -89,6 +89,10 @@
|
||||||
"tunnelOnDemandAnySSID" = "Any SSID";
|
"tunnelOnDemandAnySSID" = "Any SSID";
|
||||||
"tunnelOnDemandOnlySelectedSSIDs" = "Only selected SSIDs";
|
"tunnelOnDemandOnlySelectedSSIDs" = "Only selected SSIDs";
|
||||||
"tunnelOnDemandExceptSelectedSSIDs" = "Except selected SSIDs";
|
"tunnelOnDemandExceptSelectedSSIDs" = "Except selected SSIDs";
|
||||||
|
"tunnelOnDemandOnlySSID (%d)" = "Only %d SSID";
|
||||||
|
"tunnelOnDemandOnlySSIDs (%d)" = "Only %d SSIDs";
|
||||||
|
"tunnelOnDemandExceptSSID (%d)" = "Except %d SSID";
|
||||||
|
"tunnelOnDemandExceptSSIDs (%d)" = "Except %d SSIDs";
|
||||||
|
|
||||||
"tunnelOnDemandSSIDViewTitle" = "SSIDs";
|
"tunnelOnDemandSSIDViewTitle" = "SSIDs";
|
||||||
"tunnelOnDemandSectionTitleSelectedSSIDs" = "SSIDs";
|
"tunnelOnDemandSectionTitleSelectedSSIDs" = "SSIDs";
|
||||||
|
|
|
@ -130,6 +130,25 @@ extension ActivateOnDemandViewModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var localizedSSIDDescription: String {
|
||||||
|
guard isWiFiInterfaceEnabled else { return "" }
|
||||||
|
switch ssidOption {
|
||||||
|
case .anySSID: return tr("tunnelOnDemandAnySSID")
|
||||||
|
case .onlySpecificSSIDs:
|
||||||
|
if selectedSSIDs.count == 1 {
|
||||||
|
return tr(format: "tunnelOnDemandOnlySSID (%d)", selectedSSIDs.count)
|
||||||
|
} else {
|
||||||
|
return tr(format: "tunnelOnDemandOnlySSIDs (%d)", selectedSSIDs.count)
|
||||||
|
}
|
||||||
|
case .exceptSpecificSSIDs:
|
||||||
|
if selectedSSIDs.count == 1 {
|
||||||
|
return tr(format: "tunnelOnDemandExceptSSID (%d)", selectedSSIDs.count)
|
||||||
|
} else {
|
||||||
|
return tr(format: "tunnelOnDemandExceptSSIDs (%d)", selectedSSIDs.count)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func fixSSIDOption() {
|
func fixSSIDOption() {
|
||||||
selectedSSIDs = uniquifiedNonEmptySelectedSSIDs()
|
selectedSSIDs = uniquifiedNonEmptySelectedSSIDs()
|
||||||
if selectedSSIDs.isEmpty {
|
if selectedSSIDs.isEmpty {
|
||||||
|
|
|
@ -423,7 +423,7 @@ extension TunnelDetailTableViewController {
|
||||||
} else {
|
} else {
|
||||||
let cell: ChevronCell = tableView.dequeueReusableCell(for: indexPath)
|
let cell: ChevronCell = tableView.dequeueReusableCell(for: indexPath)
|
||||||
cell.message = field.localizedUIString
|
cell.message = field.localizedUIString
|
||||||
cell.detailMessage = onDemandViewModel.ssidOption.localizedUIString
|
cell.detailMessage = onDemandViewModel.localizedSSIDDescription
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,7 +442,7 @@ extension TunnelEditTableViewController {
|
||||||
} else {
|
} else {
|
||||||
let cell: ChevronCell = tableView.dequeueReusableCell(for: indexPath)
|
let cell: ChevronCell = tableView.dequeueReusableCell(for: indexPath)
|
||||||
cell.message = field.localizedUIString
|
cell.message = field.localizedUIString
|
||||||
cell.detailMessage = onDemandViewModel.ssidOption.localizedUIString
|
cell.detailMessage = onDemandViewModel.localizedSSIDDescription
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue