Remove unused code
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
59b9a6e5d2
commit
f3e32ab737
|
@ -31,10 +31,6 @@ class MainViewController: UISplitViewController {
|
||||||
// On iPad, always show both masterVC and detailVC, even in portrait mode, like the Settings app
|
// On iPad, always show both masterVC and detailVC, even in portrait mode, like the Settings app
|
||||||
self.preferredDisplayMode = .allVisible
|
self.preferredDisplayMode = .allVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
func openForEditing(configFileURL: URL) {
|
|
||||||
tunnelsListVC?.openForEditing(configFileURL: configFileURL)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MainViewController: UISplitViewControllerDelegate {
|
extension MainViewController: UISplitViewControllerDelegate {
|
||||||
|
|
|
@ -127,26 +127,6 @@ class TunnelsListTableViewController: UIViewController {
|
||||||
self.present(settingsNC, animated: true)
|
self.present(settingsNC, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func openForEditing(configFileURL: URL) {
|
|
||||||
let tunnelConfiguration: TunnelConfiguration?
|
|
||||||
let name = configFileURL.deletingPathExtension().lastPathComponent
|
|
||||||
do {
|
|
||||||
let fileContents = try String(contentsOf: configFileURL)
|
|
||||||
try tunnelConfiguration = WgQuickConfigFileParser.parse(fileContents, name: name)
|
|
||||||
} catch (let error) {
|
|
||||||
showErrorAlert(title: "Unable to import tunnel", message: "An error occured when importing the tunnel configuration: \(String(describing: error))")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
tunnelConfiguration?.interface.name = name
|
|
||||||
if let tunnelsManager = tunnelsManager {
|
|
||||||
presentViewControllerForTunnelCreation(tunnelsManager: tunnelsManager, tunnelConfiguration: tunnelConfiguration)
|
|
||||||
} else {
|
|
||||||
onTunnelsManagerReady = { [weak self] tunnelsManager in
|
|
||||||
self?.presentViewControllerForTunnelCreation(tunnelsManager: tunnelsManager, tunnelConfiguration: tunnelConfiguration)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func presentViewControllerForTunnelCreation(tunnelsManager: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
|
func presentViewControllerForTunnelCreation(tunnelsManager: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
|
||||||
let editVC = TunnelEditTableViewController(tunnelsManager: tunnelsManager, tunnelConfiguration: tunnelConfiguration)
|
let editVC = TunnelEditTableViewController(tunnelsManager: tunnelsManager, tunnelConfiguration: tunnelConfiguration)
|
||||||
let editNC = UINavigationController(rootViewController: editVC)
|
let editNC = UINavigationController(rootViewController: editVC)
|
||||||
|
|
Loading…
Reference in New Issue