aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryFavoriteManager.m
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2014-01-16 23:50:30 +0000
committerStuart Connolly <stuart02@gmail.com>2014-01-16 23:50:30 +0000
commitf3bad7a571142a284ac3e983530bd9d42ac7c7e2 (patch)
treed0731716768549153a5fe8d36c688ea055c47ffa /Source/SPQueryFavoriteManager.m
parentf8a9ce93bcf9ee3db418c371106c9eb87d8b61d0 (diff)
downloadsequelpro-f3bad7a571142a284ac3e983530bd9d42ac7c7e2.tar.gz
sequelpro-f3bad7a571142a284ac3e983530bd9d42ac7c7e2.tar.bz2
sequelpro-f3bad7a571142a284ac3e983530bd9d42ac7c7e2.zip
Fix deprecation warnings.
Diffstat (limited to 'Source/SPQueryFavoriteManager.m')
-rw-r--r--Source/SPQueryFavoriteManager.m35
1 files changed, 19 insertions, 16 deletions
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 32563964..0f5b68ff 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -321,8 +321,13 @@
[panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[prefs integerForKey:SPLastSQLFileEncoding] includeDefaultEntry:NO encodingPopUp:&encodingPopUp]];
[encodingPopUp setEnabled:YES];
-
- [panel beginSheetForDirectory:nil file:[favoriteNameTextField stringValue] modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:@"saveQuery"];
+
+ [panel setNameFieldStringValue:[favoriteNameTextField stringValue]];
+
+ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode)
+ {
+ [self savePanelDidEnd:panel returnCode:returnCode contextInfo:@"saveQuery"];
+ }];
#endif
}
@@ -338,7 +343,10 @@
[panel setCanSelectHiddenExtension:YES];
[panel setCanCreateDirectories:YES];
- [panel beginSheetForDirectory:nil file:nil modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:@"exportFavorites"];
+ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode)
+ {
+ [self savePanelDidEnd:panel returnCode:returnCode contextInfo:@"exportFavorites"];
+ }];
#endif
}
@@ -346,19 +354,18 @@
{
#ifndef SP_CODA
NSOpenPanel *panel = [NSOpenPanel openPanel];
+
[panel setCanSelectHiddenExtension:YES];
[panel setDelegate:self];
[panel setCanChooseDirectories:NO];
[panel setAllowsMultipleSelection:NO];
- // [panel setResolvesAliases:YES];
-
- [panel beginSheetForDirectory:nil
- file:@""
- types:[NSArray arrayWithObjects:SPFileExtensionDefault, SPFileExtensionSQL, nil]
- modalForWindow:[self window]
- modalDelegate:self
- didEndSelector:@selector(importPanelDidEnd:returnCode:contextInfo:)
- contextInfo:NULL];
+
+ [panel setAllowedFileTypes:@[SPFileExtensionDefault, SPFileExtensionSQL]];
+
+ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode)
+ {
+ [self importPanelDidEnd:panel returnCode:returnCode contextInfo:NULL];
+ }];
#endif
}
@@ -372,7 +379,6 @@
*/
- (IBAction)insertPlaceholder:(id)sender
{
-
// Look up the sender's tag to determine the placeholder to insert.
// Note that tag values alter behaviour slightly - see below.
NSDictionary *lookupTable = [NSDictionary dictionaryWithObjectsAndKeys:
@@ -476,8 +482,6 @@
for(id doc in [[NSApp delegate] orderedDocuments])
if([[doc valueForKeyPath:@"customQueryInstance"] respondsToSelector:@selector(queryFavoritesHaveBeenUpdated:)])
[[doc valueForKeyPath:@"customQueryInstance"] queryFavoritesHaveBeenUpdated:self];
-
-
}
#endif
@@ -888,7 +892,6 @@
#endif
}
-
/**
* Save panel did end method.
*/