aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2020-12-02 12:27:39 +0100
committerAndrej Mihajlov <and@mullvad.net>2020-12-03 13:32:24 +0100
commitec574085703ea1c8b2d4538596961beb910c4382 (patch)
tree73cf8bbdb74fe5575606664bccd0232ffa911803 /WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift
parentWireGuardKit: Assert that resolutionResults must not contain failures (diff)
downloadwireguard-apple-ec574085703ea1c8b2d4538596961beb910c4382.tar.xz
wireguard-apple-ec574085703ea1c8b2d4538596961beb910c4382.zip
Move all source files to `Sources/` and rename WireGuardKit targets
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift23
1 files changed, 0 insertions, 23 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift
deleted file mode 100644
index 1eb2b04..0000000
--- a/WireGuard/WireGuard/UI/macOS/ErrorPresenter.swift
+++ /dev/null
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: MIT
-// Copyright © 2018-2019 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?()
- if let sourceVC = sourceVC as? NSViewController {
- NSApp.activate(ignoringOtherApps: true)
- sourceVC.view.window!.makeKeyAndOrderFront(nil)
- alert.beginSheetModal(for: sourceVC.view.window!) { _ in
- onDismissal?()
- }
- } else {
- alert.runModal()
- onDismissal?()
- }
- }
-}