aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Ursache <bamse16@yahoo.com>2013-11-10 01:04:57 +1100
committerMarius Ursache <bamse16@yahoo.com>2013-11-10 01:04:57 +1100
commit0f50edf179c9b338db87b3dbc4e2bcd00416e926 (patch)
tree7432f41f7c3bd5beb14bf62dffeff532394f7462
parent4d5e4e24aa5b0b381a4472d9183ad317633ad4f3 (diff)
downloadsequelpro-0f50edf179c9b338db87b3dbc4e2bcd00416e926.tar.gz
sequelpro-0f50edf179c9b338db87b3dbc4e2bcd00416e926.tar.bz2
sequelpro-0f50edf179c9b338db87b3dbc4e2bcd00416e926.zip
Fixed warning on ‘beginSheetForDirectory’
-rw-r--r--Source/SPCustomQuery.m38
1 files changed, 16 insertions, 22 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 0a76030b..dbb7792f 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -483,7 +483,22 @@
[encodingPopUp setEnabled:YES];
- [panel beginSheetForDirectory:nil file:@"history" modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:@"saveHistory"];
+ [panel setNameFieldStringValue:@"history"];
+ [panel beginSheetModalForWindow:[tableDocumentInstance parentWindow] completionHandler:^(NSInteger returnCode) {
+ if (returnCode == NSOKButton) {
+ NSError *error = nil;
+
+ [prefs setInteger:[[encodingPopUp selectedItem] tag] forKey:SPLastSQLFileEncoding];
+ [prefs synchronize];
+
+ [[self buildHistoryString] writeToURL:[panel URL]
+ atomically:YES
+ encoding:[[encodingPopUp selectedItem] tag]
+ error:&error];
+
+ if (error) [[NSAlert alertWithError:error] runModal];
+ }
+ }];
#endif
}
@@ -3590,27 +3605,6 @@
#endif
}
-- (void)savePanelDidEnd:(NSSavePanel *)panel returnCode:(NSInteger)returnCode contextInfo:(id)contextInfo
-{
-#ifndef SP_CODA
- if([contextInfo isEqualToString:@"saveHistory"]) {
- if (returnCode == NSOKButton) {
- NSError *error = nil;
-
- [prefs setInteger:[[encodingPopUp selectedItem] tag] forKey:SPLastSQLFileEncoding];
- [prefs synchronize];
-
- [[self buildHistoryString] writeToURL:[panel URL]
- atomically:YES
- encoding:[[encodingPopUp selectedItem] tag]
- error:&error];
-
- if (error) [[NSAlert alertWithError:error] runModal];
- }
- }
-#endif
-}
-
/**
* Menu item validation.
*/