aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-02-25 16:22:52 +0530
committerRoopesh Chander <roop@roopc.net>2019-02-25 18:43:20 +0530
commita389bd93cb6dd068c06ada10905d8fcf3ac65a84 (patch)
tree77050c44f2e4c319083bcd162cd3d64e4f9bf22e /WireGuard/WireGuard/UI/macOS
parentImporting: Use case-insensitive comparison for zip extension (diff)
downloadwireguard-apple-a389bd93cb6dd068c06ada10905d8fcf3ac65a84.tar.xz
wireguard-apple-a389bd93cb6dd068c06ada10905d8fcf3ac65a84.zip
Importing: macOS: Support importing of multiple files at a time
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift4
1 files changed, 2 insertions, 2 deletions
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)
}
}
}