diff options
author | rowanbeentje <rowan@beent.je> | 2013-04-03 01:00:57 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-04-03 01:00:57 +0000 |
commit | 9a1f06bd2328561b0ca0a59840470b3f50ec8a47 (patch) | |
tree | 3b36ac31ec617fbc818711197068cc4fe7938fcb /Source/SPDatabaseDocument.m | |
parent | f2d7bfd3eec70fd38797806a95693a7ba3d4feb6 (diff) | |
download | sequelpro-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/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index ed739caf..6511eb4e 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3294,15 +3294,18 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; if(!spf || ![spf count] || readError != nil || [convError length] || !(format == NSPropertyListXMLFormat_v1_0 || format == NSPropertyListBinaryFormat_v1_0)) { - SPBeginWaitingAlertSheet(@"title", - NSLocalizedString(@"OK", @"OK button"), NSLocalizedString(@"Ignore", @"ignore button"), nil, - NSCriticalAlertStyle, parentWindow, self, - @selector(sheetDidEnd:returnCode:contextInfo:), - @"saveDocPrefSheetStatus", - [NSString stringWithFormat:NSLocalizedString(@"Error while reading connection data file", @"error while reading connection data file")], - [NSString stringWithFormat:NSLocalizedString(@"Connection data file “%@” couldn't be read. Please try to save the document under a different name.", @"message error while reading connection data file and suggesting to save it under a differnet name"), [fileName lastPathComponent]], - &saveDocPrefSheetStatus - ); + [SPAlertSheets beginWaitingAlertSheetWithTitle:@"title" + defaultButton:NSLocalizedString(@"OK", @"OK button") + alternateButton:NSLocalizedString(@"Ignore", @"ignore button") + otherButton:nil + alertStyle:NSCriticalAlertStyle + docWindow:parentWindow + modalDelegate:self + didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) + contextInfo:@"saveDocPrefSheetStatus" + msg:[NSString stringWithFormat:NSLocalizedString(@"Error while reading connection data file", @"error while reading connection data file")] + infoText:[NSString stringWithFormat:NSLocalizedString(@"Connection data file “%@” couldn't be read. Please try to save the document under a different name.", @"message error while reading connection data file and suggesting to save it under a differnet name"), [fileName lastPathComponent]] + returnCode:&saveDocPrefSheetStatus]; if (spf) [spf release]; if(saveDocPrefSheetStatus == NSAlertAlternateReturn) |