]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
on-demand: TunnelViewModel: Remove unused on-demand-related methods
authorRoopesh Chander <roop@roopc.net>
Fri, 8 Mar 2019 10:22:51 +0000 (15:52 +0530)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 18 Mar 2019 05:46:55 +0000 (06:46 +0100)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/TunnelViewModel.swift

index 956bfd1f0618458466e7c8ea33a4e56fb524c2ff..217de48193c072fd8e2ec86f56b903f775e1c04f 100644 (file)
@@ -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: