Invert caption/logic about trusted network policy
Looks more intuitive (default ON).
This commit is contained in:
parent
2afe881aa9
commit
2dafe9f1f2
|
@ -293,14 +293,14 @@ class ServiceViewController: UIViewController, TableModelHost {
|
|||
}
|
||||
}
|
||||
|
||||
private func toggleRetainTrustedConnection(_ isOn: Bool, sender: ToggleTableViewCell) {
|
||||
private func toggleTrustedConnectionPolicy(_ isOn: Bool, sender: ToggleTableViewCell) {
|
||||
let completionHandler: () -> Void = {
|
||||
self.service.preferences.trustPolicy = isOn ? .ignore : .disconnect
|
||||
self.service.preferences.trustPolicy = isOn ? .disconnect : .ignore
|
||||
if self.vpn.isEnabled {
|
||||
self.vpn.reinstall(completionHandler: nil)
|
||||
}
|
||||
}
|
||||
guard !isOn else {
|
||||
guard isOn else {
|
||||
completionHandler()
|
||||
return
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ class ServiceViewController: UIViewController, TableModelHost {
|
|||
completionHandler()
|
||||
}
|
||||
alert.addCancelAction(L10n.Global.cancel) {
|
||||
sender.setOn(true, animated: true)
|
||||
sender.setOn(false, animated: true)
|
||||
}
|
||||
present(alert, animated: true, completion: nil)
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
|
|||
case .trustedPolicy:
|
||||
let cell = Cells.toggle.dequeue(from: tableView, for: indexPath, tag: row.rawValue, delegate: self)
|
||||
cell.caption = L10n.Service.Cells.TrustedPolicy.caption
|
||||
cell.isOn = (service.preferences.trustPolicy == .ignore)
|
||||
cell.isOn = (service.preferences.trustPolicy == .disconnect)
|
||||
return cell
|
||||
|
||||
// diagnostics
|
||||
|
@ -826,7 +826,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
|
|||
}
|
||||
|
||||
case .trustedPolicy:
|
||||
toggleRetainTrustedConnection(cell.isOn, sender: cell)
|
||||
toggleTrustedConnectionPolicy(cell.isOn, sender: cell)
|
||||
|
||||
default:
|
||||
break
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
"service.sections.vpn_resolves_hostname.footer" = "Preferred in most networks and required in some IPv6 networks. Disable where DNS is blocked, or to speed up negotiation when DNS is slow to respond.";
|
||||
//"service.sections.vpn_prefers_udp.footer" = "UDP is faster than TCP, but may not work in some networks. Disable in networks where UDP might be blocked.";
|
||||
"service.sections.trusted.header" = "Trusted networks";
|
||||
"service.sections.trusted.footer" = "When entering a trusted network, an existing VPN connection will not be shut down by default. Disable to always enforce a disconnection.";
|
||||
"service.sections.trusted.footer" = "When entering a trusted network, the VPN connection is normally shut down and kept disconnected. Disable this option to allow manual VPN connections.";
|
||||
"service.sections.diagnostics.header" = "Diagnostics";
|
||||
//"service.sections.destruction.footer" = "Delete configuration from device settings.";
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
|||
"service.cells.trusted_mobile.caption" = "Cellular network";
|
||||
"service.cells.trusted_wifi.caption" = "%@";
|
||||
"service.cells.trusted_add_wifi.caption" = "Add current Wi-Fi";
|
||||
"service.cells.trusted_policy.caption" = "Retain existing connection";
|
||||
"service.cells.trusted_policy.caption" = "Disconnect VPN when trusted";
|
||||
"service.cells.test_connectivity.caption" = "Test connectivity";
|
||||
"service.cells.data_count.caption" = "Exchanged bytes count";
|
||||
"service.cells.debug_log.caption" = "Debug log";
|
||||
|
|
|
@ -532,7 +532,7 @@ internal enum L10n {
|
|||
internal static let caption = L10n.tr("Localizable", "service.cells.trusted_mobile.caption")
|
||||
}
|
||||
internal enum TrustedPolicy {
|
||||
/// Retain existing connection
|
||||
/// Disconnect VPN when trusted
|
||||
internal static let caption = L10n.tr("Localizable", "service.cells.trusted_policy.caption")
|
||||
}
|
||||
internal enum TrustedWifi {
|
||||
|
@ -582,7 +582,7 @@ internal enum L10n {
|
|||
internal static let header = L10n.tr("Localizable", "service.sections.status.header")
|
||||
}
|
||||
internal enum Trusted {
|
||||
/// When entering a trusted network, an existing VPN connection will not be shut down by default. Disable to always enforce a disconnection.
|
||||
/// When entering a trusted network, the VPN connection is normally shut down and kept disconnected. Disable this option to allow manual VPN connections.
|
||||
internal static let footer = L10n.tr("Localizable", "service.sections.trusted.footer")
|
||||
/// Trusted networks
|
||||
internal static let header = L10n.tr("Localizable", "service.sections.trusted.header")
|
||||
|
|
Loading…
Reference in New Issue