diff options
-rw-r--r-- | Source/SPExportController.m | 26 |
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 |