diff options
Diffstat (limited to 'Source')
-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 |