aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-03-08 15:52:51 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-18 06:46:55 +0100
commitd9bdc61fb9db316a595fdcd99a6702356d7d1a02 (patch)
treefc3ef35057c33ea0d688c45ccddaea1cf7a43e1c /WireGuard/WireGuard
parenton-demand: macOS: Tunnel detail: Show SSID info (diff)
downloadwireguard-apple-d9bdc61fb9db316a595fdcd99a6702356d7d1a02.tar.xz
wireguard-apple-d9bdc61fb9db316a595fdcd99a6702356d7d1a02.zip
on-demand: TunnelViewModel: Remove unused on-demand-related methods
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/TunnelViewModel.swift43
1 files changed, 0 insertions, 43 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift
index 956bfd1..217de48 100644
--- a/WireGuard/WireGuard/UI/TunnelViewModel.swift
+++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift
@@ -622,49 +622,6 @@ class TunnelViewModel {
}
}
-extension TunnelViewModel {
- static func activateOnDemandOptionText(for activateOnDemandOption: ActivateOnDemandOption) -> String {
- switch activateOnDemandOption {
- case .none:
- return tr("tunnelOnDemandOptionOff")
- case .wiFiInterfaceOnly:
- return tr("tunnelOnDemandOptionWiFiOnly")
- case .nonWiFiInterfaceOnly:
- #if os(iOS)
- return tr("tunnelOnDemandOptionCellularOnly")
- #elseif os(macOS)
- return tr("tunnelOnDemandOptionEthernetOnly")
- #else
- #error("Unimplemented")
- #endif
- case .anyInterface:
- #if os(iOS)
- return tr("tunnelOnDemandOptionWiFiOrCellular")
- #elseif os(macOS)
- return tr("tunnelOnDemandOptionWiFiOrEthernet")
- #else
- #error("Unimplemented")
- #endif
- }
- }
-
- static func activateOnDemandDetailText(for activateOnDemandSetting: ActivateOnDemandSetting?) -> String {
- if let activateOnDemandSetting = activateOnDemandSetting {
- if activateOnDemandSetting.isActivateOnDemandEnabled {
- return TunnelViewModel.activateOnDemandOptionText(for: activateOnDemandSetting.activateOnDemandOption)
- } else {
- return TunnelViewModel.activateOnDemandOptionText(for: .none)
- }
- } else {
- return TunnelViewModel.activateOnDemandOptionText(for: .none)
- }
- }
-
- static func defaultActivateOnDemandOption() -> ActivateOnDemandOption {
- return .anyInterface(.anySSID)
- }
-}
-
private func prettyBytes(_ bytes: UInt64) -> String {
switch bytes {
case 0..<1024: