aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r--WireGuard/WireGuard/UI/TunnelViewModel.swift35
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift6
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift6
3 files changed, 22 insertions, 25 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift
index e6b00a10..8a9b0070 100644
--- a/WireGuard/WireGuard/UI/TunnelViewModel.swift
+++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift
@@ -627,21 +627,24 @@ extension TunnelViewModel {
switch activateOnDemandOption {
case .none:
return tr("tunnelOnDemandOptionOff")
- case .useOnDemandOverWiFiOnly:
+ case .wiFiInterfaceOnly:
return tr("tunnelOnDemandOptionWiFiOnly")
- #if os(iOS)
- case .useOnDemandOverWiFiOrCellular:
- return tr("tunnelOnDemandOptionWiFiOrCellular")
- case .useOnDemandOverCellularOnly:
+ case .nonWiFiInterfaceOnly:
+ #if os(iOS)
return tr("tunnelOnDemandOptionCellularOnly")
- #elseif os(macOS)
- case .useOnDemandOverWiFiOrEthernet:
- return tr("tunnelOnDemandOptionWiFiOrEthernet")
- case .useOnDemandOverEthernetOnly:
+ #elseif os(macOS)
return tr("tunnelOnDemandOptionEthernetOnly")
- #else
- #error("Unimplemented")
- #endif
+ #else
+ #error("Unimplemented")
+ #endif
+ case .anyInterface:
+ #if os(iOS)
+ return tr("tunnelOnDemandOptionWiFiOrCellular")
+ #elseif os(macOS)
+ return tr("tunnelOnDemandOptionWiFiOrEthernet")
+ #else
+ #error("Unimplemented")
+ #endif
}
}
@@ -658,13 +661,7 @@ extension TunnelViewModel {
}
static func defaultActivateOnDemandOption() -> ActivateOnDemandOption {
- #if os(iOS)
- return .useOnDemandOverWiFiOrCellular
- #elseif os(macOS)
- return .useOnDemandOverWiFiOrEthernet
- #else
- #error("Unimplemented")
- #endif
+ return .anyInterface
}
}
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
index a15d5fe3..1a20ffec 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/TunnelEditTableViewController.swift
@@ -44,9 +44,9 @@ class TunnelEditTableViewController: UITableViewController {
]
let activateOnDemandOptions: [ActivateOnDemandOption] = [
- .useOnDemandOverWiFiOrCellular,
- .useOnDemandOverWiFiOnly,
- .useOnDemandOverCellularOnly
+ .anyInterface,
+ .wiFiInterfaceOnly,
+ .nonWiFiInterfaceOnly
]
let tunnelsManager: TunnelsManager
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
index 6e4a23a5..2c1c5384 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
@@ -82,9 +82,9 @@ class TunnelEditViewController: NSViewController {
let activateOnDemandOptions: [ActivateOnDemandOption] = [
.none,
- .useOnDemandOverWiFiOrEthernet,
- .useOnDemandOverWiFiOnly,
- .useOnDemandOverEthernetOnly
+ .anyInterface,
+ .wiFiInterfaceOnly,
+ .nonWiFiInterfaceOnly
]
let tunnelsManager: TunnelsManager