macOS: Present errors as a sheet when applicable
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -9,7 +9,15 @@ class ErrorPresenter: ErrorPresenterProtocol {
|
|||||||
alert.messageText = title
|
alert.messageText = title
|
||||||
alert.informativeText = message
|
alert.informativeText = message
|
||||||
onPresented?()
|
onPresented?()
|
||||||
alert.runModal()
|
if let sourceVC = sourceVC as? NSViewController {
|
||||||
onDismissal?()
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
sourceVC.view.window!.makeKeyAndOrderFront(nil)
|
||||||
|
alert.beginSheetModal(for: sourceVC.view.window!) { _ in
|
||||||
|
onDismissal?()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
alert.runModal()
|
||||||
|
onDismissal?()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user