From: Roopesh Chander Date: Tue, 27 Jul 2021 21:00:24 +0000 (+0530) Subject: UI: iOS: Show on-demand state in 'Status' if there are on-demand rules X-Git-Tag: 1.0.14-25~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=147ac02f0d065e3f68261f2ee7394874ae5d970f;p=thirdparty%2Fwireguard-apple.git UI: iOS: Show on-demand state in 'Status' if there are on-demand rules Signed-off-by: Roopesh Chander --- diff --git a/Sources/WireGuardApp/Base.lproj/Localizable.strings b/Sources/WireGuardApp/Base.lproj/Localizable.strings index 87935d1..0e24ed3 100644 --- a/Sources/WireGuardApp/Base.lproj/Localizable.strings +++ b/Sources/WireGuardApp/Base.lproj/Localizable.strings @@ -57,6 +57,7 @@ "tunnelStatusWaiting" = "Waiting"; "tunnelStatusAddendumOnDemand" = " (On Demand)"; +"tunnelStatusOnDemandDisabled" = "On Demand Disabled"; "macToggleStatusButtonActivate" = "Activate"; "macToggleStatusButtonActivating" = "Activating…"; diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift index 675adfd..196de0c 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelDetailTableViewController.swift @@ -365,6 +365,11 @@ extension TunnelDetailTableViewController { cell.switchView.isUserInteractionEnabled = (status == .inactive || status == .active) cell.isEnabled = (status == .inactive || status == .active) } + + if tunnel.hasOnDemandRules && !isOnDemandEngaged && status == .inactive { + text = tr("tunnelStatusOnDemandDisabled") + } + cell.textLabel?.text = text }