From a389bd93cb6dd068c06ada10905d8fcf3ac65a84 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 25 Feb 2019 16:22:52 +0530 Subject: Importing: macOS: Support importing of multiple files at a time Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift') diff --git a/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift b/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift index 1ef8f75..67b074c 100644 --- a/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift +++ b/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift @@ -9,12 +9,12 @@ class ImportPanelPresenter { let openPanel = NSOpenPanel() openPanel.prompt = tr("macSheetButtonImport") openPanel.allowedFileTypes = ["conf", "zip"] + openPanel.allowsMultipleSelection = true 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 } AppStorePrivacyNotice.show(from: sourceVC, into: tunnelsManager) { - TunnelImporter.importFromFile(url: url, into: tunnelsManager, sourceVC: sourceVC, errorPresenterType: ErrorPresenter.self) + TunnelImporter.importFromFile(urls: openPanel.urls, into: tunnelsManager, sourceVC: sourceVC, errorPresenterType: ErrorPresenter.self) } } } -- cgit v1.2.3-59-g8ed1b