aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportController.m
diff options
context:
space:
mode:
authorMarius Ursache <marius@marius.me.uk>2013-11-11 02:28:11 -0800
committerMarius Ursache <marius@marius.me.uk>2013-11-11 02:28:11 -0800
commitd46ab590d6a76894b7f282159663f00e5df511ef (patch)
tree1cbe404daf3c106f9809d5db540154e79e8a9b23 /Source/SPExportController.m
parentc769bd0a420bdd1273c43b91b28a818bfd5f5008 (diff)
parentdf35d702fe561629fddfa66cd99d0839b8e05910 (diff)
downloadsequelpro-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/SPExportController.m')
-rw-r--r--Source/SPExportController.m26
1 files changed, 8 insertions, 18 deletions
diff --git a/Source/SPExportController.m b/Source/SPExportController.m
index 3fc5fbf0..4ffbe085 100644
--- a/Source/SPExportController.m
+++ b/Source/SPExportController.m
@@ -399,13 +399,14 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled";
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel setCanCreateDirectories:YES];
-
- [panel beginSheetForDirectory:[exportPathField stringValue]
- file:nil
- modalForWindow:[self window]
- modalDelegate:self
- didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:)
- contextInfo:nil];
+
+ [panel setDirectoryURL:[NSURL URLWithString:[exportPathField stringValue]]];
+ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) {
+ if (returnCode == NSOKButton) {
+ [exportPathField setStringValue:[[panel directoryURL] path]];
+ [prefs setObject:[[panel directoryURL] path] forKey:SPExportLastDirectory];
+ }
+ }];
}
/**
@@ -699,17 +700,6 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled";
}
/**
- * Invoked when the user dismisses the save panel. Updates the selected directory if they clicked OK.
- */
-- (void)savePanelDidEnd:(NSSavePanel *)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
-{
- if (returnCode == NSOKButton) {
- [exportPathField setStringValue:[panel directory]];
- [prefs setObject:[panel directory] forKey:SPExportLastDirectory];
- }
-}
-
-/**
* Menu item validation.
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem