diff options
author | Roopesh Chander <roop@roopc.net> | 2018-12-29 15:33:41 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-01-14 14:52:30 +0530 |
commit | 545f8c88f4d3b12945aebe3849d89233f6e7051f (patch) | |
tree | c2ef28c1753554ededf96b214eb6d7ebe42483ed /WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift | |
parent | iOS: Refactor importFromFile (diff) | |
download | wireguard-apple-545f8c88f4d3b12945aebe3849d89233f6e7051f.tar.xz wireguard-apple-545f8c88f4d3b12945aebe3849d89233f6e7051f.zip |
macOS: Ability to import tunnels from file
For now, the open panel shows as a separate window.
Later, we'll open it as a sheet on the 'Manage tunnels' window.
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift new file mode 100644 index 0000000..c83a339 --- /dev/null +++ b/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018 WireGuard LLC. All Rights Reserved. + +import Cocoa + +class ErrorPresenter: ErrorPresenterProtocol { + static func showErrorAlert(title: String, message: String, from sourceVC: AnyObject?, onPresented: (() -> Void)?, onDismissal: (() -> Void)?) { + let alert = NSAlert() + alert.messageText = title + alert.informativeText = message + onPresented?() + alert.runModal() + onDismissal?() + } +} |