diff options
author | Stuart Connolly <stuart02@gmail.com> | 2014-01-17 00:09:54 +0000 |
---|---|---|
committer | Stuart Connolly <stuart02@gmail.com> | 2014-01-17 00:09:54 +0000 |
commit | 902c9540a283f75b414cfef9806e4f443cc21c06 (patch) | |
tree | 6ee865d83cf59d34e193a87b7218d0b31e9b6f44 /Source | |
parent | f3bad7a571142a284ac3e983530bd9d42ac7c7e2 (diff) | |
download | sequelpro-902c9540a283f75b414cfef9806e4f443cc21c06.tar.gz sequelpro-902c9540a283f75b414cfef9806e4f443cc21c06.tar.bz2 sequelpro-902c9540a283f75b414cfef9806e4f443cc21c06.zip |
Fix remaining deprecation warnings.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPBundleEditorController.m | 15 | ||||
-rw-r--r-- | Source/SPContentFilterManager.m | 2 | ||||
-rw-r--r-- | Source/SPFieldEditorController.m | 24 |
3 files changed, 21 insertions, 20 deletions
diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 15b4dc77..90625087 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -37,6 +37,8 @@ #import "SPBundleCommandTextView.h" #import "SPSplitView.h" +static NSString *SPSaveBundleAction = @"SPSaveBundle"; + #define kBundleNameKey @"bundleName" #define kChildrenKey @"_children_" #define kInputFieldScopeArrayIndex 0 @@ -728,12 +730,10 @@ */ - (IBAction)revealCommandBundleInFinder:(id)sender { - - if([commandsOutlineView numberOfSelectedRows] != 1) return; + if ([commandsOutlineView numberOfSelectedRows] != 1) return; [[NSWorkspace sharedWorkspace] selectFile:[NSString stringWithFormat:@"%@/%@.%@/%@", bundlePath, [[self _currentSelectedObject] objectForKey:kBundleNameKey], SPUserBundleFileExtension, SPBundleFileName] inFileViewerRootedAtPath:nil]; - } /** @@ -750,7 +750,12 @@ [panel setCanSelectHiddenExtension:YES]; [panel setCanCreateDirectories:YES]; - [panel beginSheetForDirectory:nil file:[[self _currentSelectedObject] objectForKey:kBundleNameKey] modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"saveBundle"]; + [panel setNameFieldStringValue:[[self _currentSelectedObject] objectForKey:kBundleNameKey]]; + + [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) + { + [self sheetDidEnd:panel returnCode:returnCode contextInfo:SPSaveBundleAction]; + }]; } /** @@ -774,9 +779,7 @@ */ - (IBAction)showWindow:(id)sender { - [super showWindow:sender]; - } - (IBAction)performClose:(id)sender diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 0b4a376e..9fe94169 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -40,7 +40,7 @@ #import "SPConnectionController.h" #import "SPSplitView.h" -static NSString *SPExportFilterAction = @"SPExportFilterAction"; +static NSString *SPExportFilterAction = @"SPExportFilter"; #define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]") #define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]") diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index f7bbd5e2..3d172370 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -580,11 +580,12 @@ */ - (IBAction)openEditSheet:(id)sender { - [[NSOpenPanel openPanel] beginSheetForDirectory:nil - file:@"" - modalForWindow:usedSheet - modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) - contextInfo:NULL]; + NSOpenPanel *panel = [NSOpenPanel openPanel]; + + [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) + { + [self openPanelDidEnd:panel returnCode:returnCode contextInfo:nil]; + }]; } /** @@ -593,10 +594,9 @@ - (IBAction)saveEditSheet:(id)sender { NSSavePanel *panel = [NSSavePanel savePanel]; - NSString *fileDefault = @""; if ([editSheetSegmentControl selectedSegment] == 1 && [sheetEditData isKindOfClass:[SPMySQLGeometryData class]]) { - [panel setAllowedFileTypes:[NSArray arrayWithObject:@"pdf"]]; + [panel setAllowedFileTypes:@[@"pdf"]]; [panel setAllowsOtherFileTypes:NO]; } else { @@ -606,12 +606,10 @@ [panel setCanSelectHiddenExtension:YES]; [panel setExtensionHidden:NO]; - [panel beginSheetForDirectory:nil - file:fileDefault - modalForWindow:usedSheet - modalDelegate:self - didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) - contextInfo:NULL]; + [panel beginSheetModalForWindow:usedSheet completionHandler:^(NSInteger returnCode) + { + [self savePanelDidEnd:panel returnCode:returnCode contextInfo:nil]; + }]; } - (void)sheetDidEnd:(id)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo |