From df35d702fe561629fddfa66cd99d0839b8e05910 Mon Sep 17 00:00:00 2001 From: Marius Ursache Date: Mon, 11 Nov 2013 21:20:26 +1100 Subject: Updated Change Export Directory panel sheet to 10.6+ SDK --- Source/SPExportController.m | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'Source/SPExportController.m') 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]; + } + }]; } /** @@ -698,17 +699,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. */ -- cgit v1.2.3