From bdabf83b38616aecbea15867d86d510d6b43fbcc Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 17 Dec 2017 22:28:39 +0100 Subject: [PATCH] Revert "Use user notification for init errors" This reverts commit 2745bd9457a72572ebb292482b7d1611311124be. --- NvimView/NvimView/NvimView+Resize.swift | 20 ++++++-------------- NvimView/NvimView/NvimView.swift | 3 +-- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/NvimView/NvimView/NvimView+Resize.swift b/NvimView/NvimView/NvimView+Resize.swift index f4e82782..74da3fda 100644 --- a/NvimView/NvimView/NvimView+Resize.swift +++ b/NvimView/NvimView/NvimView+Resize.swift @@ -34,12 +34,6 @@ extension NvimView { self.resizeNeoVimUi(to: self.bounds.size) } - public func userNotificationCenter(_ center: NSUserNotificationCenter, - shouldPresent notification: NSUserNotification) -> Bool { - - return true - } - func discreteSize(size: CGSize) -> Size { return Size(width: Int(floor(size.width / self.cellSize.width)), height: Int(floor(size.height / self.cellSize.height))) @@ -77,14 +71,12 @@ extension NvimView { self.logger.fault("There was an error launching neovim.") DispatchQueue.main.async { - let notification = NSUserNotification() - notification.identifier = self.uuid - notification.title = "Error during initialization" - notification.informativeText = "There was an error during the initialization of NeoVim. " + - "Use :messages to view the error messages." - - NSUserNotificationCenter.default.delegate = self - NSUserNotificationCenter.default.deliver(notification) + let alert = NSAlert() + alert.alertStyle = .warning + alert.messageText = "Error during initialization" + alert.informativeText = "There was an error during the initialization of NeoVim. " + + "Use :messages to view the error messages." + alert.runModal() } } } diff --git a/NvimView/NvimView/NvimView.swift b/NvimView/NvimView/NvimView.swift index e58c5743..da5be5e0 100644 --- a/NvimView/NvimView/NvimView.swift +++ b/NvimView/NvimView/NvimView.swift @@ -10,8 +10,7 @@ import RxSwift public class NvimView: NSView, NvimUiBridgeProtocol, NSUserInterfaceValidations, - NSTextInputClient, - NSUserNotificationCenterDelegate { + NSTextInputClient { // MARK: - Public public struct Config {