aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPEditorPreferencePane.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/SPEditorPreferencePane.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/SPEditorPreferencePane.m')
-rw-r--r--Source/SPEditorPreferencePane.m25
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m
index b9df9845..186af05a 100644
--- a/Source/SPEditorPreferencePane.m
+++ b/Source/SPEditorPreferencePane.m
@@ -758,19 +758,18 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined";
[[NSColorPanel sharedColorPanel] close];
- SPBeginWaitingAlertSheet(@"title",
- NSLocalizedString(@"Proceed", @"proceed button"),
- NSLocalizedString(@"Cancel", @"cancel button"),
- nil,
- NSWarningAlertStyle,
- [[self view] window],
- self,
- @selector(checkForUnsavedThemeDidEndSheet:returnCode:contextInfo:),
- nil,
- NSLocalizedString(@"Unsaved Theme", @"unsaved theme message"),
- NSLocalizedString(@"The current color theme is unsaved. Do you want to proceed without saving it?", @"unsaved theme informative message"),
- &checkForUnsavedThemeSheetStatus
- );
+ [SPAlertSheets beginWaitingAlertSheetWithTitle:@"title"
+ defaultButton:NSLocalizedString(@"Proceed", @"proceed button")
+ alternateButton:NSLocalizedString(@"Cancel", @"cancel button")
+ otherButton:nil
+ alertStyle:NSWarningAlertStyle
+ docWindow:[[self view] window]
+ modalDelegate:self
+ didEndSelector:@selector(checkForUnsavedThemeDidEndSheet:returnCode:contextInfo:)
+ contextInfo:nil
+ msg:NSLocalizedString(@"Unsaved Theme", @"unsaved theme message")
+ infoText:NSLocalizedString(@"The current color theme is unsaved. Do you want to proceed without saving it?", @"unsaved theme informative message")
+ returnCode:&checkForUnsavedThemeSheetStatus];
return (checkForUnsavedThemeSheetStatus == NSAlertDefaultReturn);
}