aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-04-03 01:00:57 +0000
committerrowanbeentje <rowan@beent.je>2013-04-03 01:00:57 +0000
commit9a1f06bd2328561b0ca0a59840470b3f50ec8a47 (patch)
tree3b36ac31ec617fbc818711197068cc4fe7938fcb /Source/SPCustomQuery.m
parentf2d7bfd3eec70fd38797806a95693a7ba3d4feb6 (diff)
downloadsequelpro-9a1f06bd2328561b0ca0a59840470b3f50ec8a47.tar.gz
sequelpro-9a1f06bd2328561b0ca0a59840470b3f50ec8a47.tar.bz2
sequelpro-9a1f06bd2328561b0ca0a59840470b3f50ec8a47.zip
- Move the SPBeginWaitingAlertSheet function to a beginWaitingAlertSheetWithTitle:... class method on a new SPAlertSheets class, allowing us to use invocation forwarding to ensure the entire function is executing on the main thread. This allows runloop processing to happen on the main thread, addressing Issue #1676
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m22
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 43bb425a..f89b095c 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -733,15 +733,19 @@
if (![mySQLConnection lastQueryWasCancelled]) {
[tableDocumentInstance setTaskIndicatorShouldAnimate:NO];
- SPBeginWaitingAlertSheet(@"title",
- NSLocalizedString(@"Run All", @"run all button"), NSLocalizedString(@"Continue", @"continue button"), NSLocalizedString(@"Stop", @"stop button"),
- NSWarningAlertStyle, [tableDocumentInstance parentWindow], self,
- @selector(sheetDidEnd:returnCode:contextInfo:),
- @"runAllContinueStopSheet",
- NSLocalizedString(@"MySQL Error", @"mysql error message"),
- [mySQLConnection lastErrorMessage],
- &runAllContinueStopSheetReturnCode
- );
+ [SPAlertSheets beginWaitingAlertSheetWithTitle:@"title"
+ defaultButton:NSLocalizedString(@"Run All", @"run all button")
+ alternateButton:NSLocalizedString(@"Continue", @"continue button")
+ otherButton:NSLocalizedString(@"Stop", @"stop button")
+ alertStyle:NSWarningAlertStyle
+ docWindow:[tableDocumentInstance parentWindow]
+ modalDelegate:self
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:@"runAllContinueStopSheet"
+ msg:NSLocalizedString(@"MySQL Error", @"mysql error message")
+ infoText:[mySQLConnection lastErrorMessage]
+ returnCode:&runAllContinueStopSheetReturnCode];
+
[tableDocumentInstance setTaskIndicatorShouldAnimate:YES];
switch (runAllContinueStopSheetReturnCode) {