macOS: Manage tunnels: Import pulldown menu implementation
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
38bb0faf86
commit
f33cd0b6fd
|
@ -127,7 +127,15 @@ class TunnelsListTableViewController: NSViewController {
|
|||
}
|
||||
|
||||
@objc func importTunnelClicked() {
|
||||
print("importTunnelClicked")
|
||||
guard let window = view.window else { return }
|
||||
let openPanel = NSOpenPanel()
|
||||
openPanel.allowedFileTypes = ["conf", "zip"]
|
||||
openPanel.beginSheetModal(for: window) { [weak tunnelsManager] response in
|
||||
guard let tunnelsManager = tunnelsManager else { return }
|
||||
guard response == .OK else { return }
|
||||
guard let url = openPanel.url else { return }
|
||||
TunnelImporter.importFromFile(url: url, into: tunnelsManager, sourceVC: nil, errorPresenterType: ErrorPresenter.self)
|
||||
}
|
||||
}
|
||||
|
||||
@objc func removeTunnelClicked() {
|
||||
|
|
Loading…
Reference in New Issue