From 5357fd1375d19a6c5de96293b3899f430422a3c0 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 20 Oct 2015 15:24:10 +0200 Subject: Replace a lot of SPBeginAlertSheet()s with the more concise SPOnewayAlertSheet() This should also eliminate a few use-after-free crashes --- Source/SPAlertSheets.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Source/SPAlertSheets.m') diff --git a/Source/SPAlertSheets.m b/Source/SPAlertSheets.m index d19da6df..258aac6d 100644 --- a/Source/SPAlertSheets.m +++ b/Source/SPAlertSheets.m @@ -143,6 +143,17 @@ @end +/** + * Shorthand for SPOnewayAlertSheetWithStyle() with defaultButton=nil and alertStyle=NSWarningAlertStyle + */ +void SPOnewayAlertSheet( + NSString *title, + NSWindow *docWindow, + NSString *msg) +{ + SPOnewayAlertSheetWithStyle(title, nil, docWindow, msg, NSWarningAlertStyle); +} + /** * A Send-and-forget variant for displaying alerts. * It will queue the alert on the main thread and *always* immediately return. @@ -151,7 +162,7 @@ * If nil is passed as the button title it will be changed to @"OK". * If nil is passed as the window NSAlert will be modal */ -void SPOnewayAlertSheet( +void SPOnewayAlertSheetWithStyle( NSString *title, NSString *defaultButton, NSWindow *docWindow, -- cgit v1.2.3