mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-01-17 22:09:06 +00:00
Tunnel edit: init() need not take a tunnelConfiguration argument
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
5c501ac9a6
commit
9268c0c4bc
@ -55,12 +55,11 @@ class TunnelEditTableViewController: UITableViewController {
|
|||||||
loadSections()
|
loadSections()
|
||||||
}
|
}
|
||||||
|
|
||||||
init(tunnelsManager: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
|
init(tunnelsManager: TunnelsManager) {
|
||||||
// Use this initializer to create a new tunnel.
|
// Use this initializer to create a new tunnel.
|
||||||
// If tunnelConfiguration is passed, data will be prepopulated from that configuration.
|
|
||||||
self.tunnelsManager = tunnelsManager
|
self.tunnelsManager = tunnelsManager
|
||||||
tunnel = nil
|
tunnel = nil
|
||||||
tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnelConfiguration)
|
tunnelViewModel = TunnelViewModel(tunnelConfiguration: nil)
|
||||||
activateOnDemandSetting = ActivateOnDemandSetting.defaultSetting
|
activateOnDemandSetting = ActivateOnDemandSetting.defaultSetting
|
||||||
super.init(style: .grouped)
|
super.init(style: .grouped)
|
||||||
loadSections()
|
loadSections()
|
||||||
|
@ -110,7 +110,7 @@ class TunnelsListTableViewController: UIViewController {
|
|||||||
|
|
||||||
let createFromScratchAction = UIAlertAction(title: "Create from scratch", style: .default) { [weak self] _ in
|
let createFromScratchAction = UIAlertAction(title: "Create from scratch", style: .default) { [weak self] _ in
|
||||||
if let self = self, let tunnelsManager = self.tunnelsManager {
|
if let self = self, let tunnelsManager = self.tunnelsManager {
|
||||||
self.presentViewControllerForTunnelCreation(tunnelsManager: tunnelsManager, tunnelConfiguration: nil)
|
self.presentViewControllerForTunnelCreation(tunnelsManager: tunnelsManager)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
alert.addAction(createFromScratchAction)
|
alert.addAction(createFromScratchAction)
|
||||||
@ -136,8 +136,8 @@ class TunnelsListTableViewController: UIViewController {
|
|||||||
present(settingsNC, animated: true)
|
present(settingsNC, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func presentViewControllerForTunnelCreation(tunnelsManager: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
|
func presentViewControllerForTunnelCreation(tunnelsManager: TunnelsManager) {
|
||||||
let editVC = TunnelEditTableViewController(tunnelsManager: tunnelsManager, tunnelConfiguration: tunnelConfiguration)
|
let editVC = TunnelEditTableViewController(tunnelsManager: tunnelsManager)
|
||||||
let editNC = UINavigationController(rootViewController: editVC)
|
let editNC = UINavigationController(rootViewController: editVC)
|
||||||
editNC.modalPresentationStyle = .formSheet
|
editNC.modalPresentationStyle = .formSheet
|
||||||
present(editNC, animated: true)
|
present(editNC, animated: true)
|
||||||
|
Loading…
Reference in New Issue
Block a user