aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-05 14:26:20 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:33 +0530
commitdf8b40085080aa83d660adb5a62b4108ffbff964 (patch)
tree8f548305cc8a16eb7fb38150b99a577615b96265 /WireGuard/WireGuard/UI/macOS/AppDelegate.swift
parentmacOS: Present errors as a sheet when applicable (diff)
downloadwireguard-apple-df8b40085080aa83d660adb5a62b4108ffbff964.tar.xz
wireguard-apple-df8b40085080aa83d660adb5a62b4108ffbff964.zip
macOS: Present tunnel activation errors from the window when possible
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/AppDelegate.swift')
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppDelegate.swift20
1 files changed, 1 insertions, 19 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
index 2403d0fc..994495ef 100644
--- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
@@ -20,29 +20,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.statusItem = createStatusBarItem(with: statusMenu)
tunnelsManager.tunnelsListDelegate = statusMenu
- tunnelsManager.activationDelegate = self
+ tunnelsManager.activationDelegate = statusMenu
}
}
}
-extension AppDelegate: TunnelsManagerActivationDelegate {
- func tunnelActivationAttemptFailed(tunnel: TunnelContainer, error: TunnelsManagerActivationAttemptError) {
- ErrorPresenter.showErrorAlert(error: error, from: nil)
- }
-
- func tunnelActivationAttemptSucceeded(tunnel: TunnelContainer) {
- // Nothing to do
- }
-
- func tunnelActivationFailed(tunnel: TunnelContainer, error: TunnelsManagerActivationError) {
- ErrorPresenter.showErrorAlert(error: error, from: nil)
- }
-
- func tunnelActivationSucceeded(tunnel: TunnelContainer) {
- // Nothing to do
- }
-}
-
func createStatusBarItem(with statusMenu: StatusMenu) -> NSStatusItem {
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)
if let statusBarImage = NSImage(named: "WireGuardMacStatusBarIcon") {