diff options
author | Marius Ursache <marius@marius.me.uk> | 2013-11-11 02:28:11 -0800 |
---|---|---|
committer | Marius Ursache <marius@marius.me.uk> | 2013-11-11 02:28:11 -0800 |
commit | d46ab590d6a76894b7f282159663f00e5df511ef (patch) | |
tree | 1cbe404daf3c106f9809d5db540154e79e8a9b23 /Source/SPQueryController.m | |
parent | c769bd0a420bdd1273c43b91b28a818bfd5f5008 (diff) | |
parent | df35d702fe561629fddfa66cd99d0839b8e05910 (diff) | |
download | sequelpro-d46ab590d6a76894b7f282159663f00e5df511ef.tar.gz sequelpro-d46ab590d6a76894b7f282159663f00e5df511ef.tar.bz2 sequelpro-d46ab590d6a76894b7f282159663f00e5df511ef.zip |
Merge pull request #1853 from bamse16/master
beginSheetForDirectory: updates for OSX 10.6+ SDK
Diffstat (limited to 'Source/SPQueryController.m')
-rw-r--r-- | Source/SPQueryController.m | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 929de617..8febfd2b 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -228,7 +228,13 @@ static SPQueryController *sharedQueryController = nil; [panel setAccessoryView:saveLogView]; - [panel beginSheetForDirectory:nil file:NSLocalizedString(@"ConsoleLog", @"Console : Save as : Initial filename") modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:NULL]; + [panel setNameFieldStringValue:NSLocalizedString(@"ConsoleLog", @"Console : Save as : Initial filename")]; + [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) { + if (returnCode == NSOKButton) { + [[self _getConsoleStringWithTimeStamps:[includeTimeStampsButton state] + connections:[includeConnectionButton state]] writeToFile:[[panel URL] path] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; + } + }]; #endif } @@ -310,18 +316,6 @@ static SPQueryController *sharedQueryController = nil; #endif } -/** - * Called when the NSSavePanel sheet ends. Writes the console's current content to the selected file if required. - */ -- (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo -{ -#ifndef SP_CODA - if (returnCode == NSOKButton) { - [[self _getConsoleStringWithTimeStamps:[includeTimeStampsButton state] connections:[includeConnectionButton state]] writeToFile:[[sheet URL] path] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; - } -#endif -} - #pragma mark - #pragma mark Other |