aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPServerVariablesController.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/SPServerVariablesController.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/SPServerVariablesController.m')
-rw-r--r--Source/SPServerVariablesController.m35
1 files changed, 15 insertions, 20 deletions
diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m
index 0d591f2f..b2afbc13 100644
--- a/Source/SPServerVariablesController.m
+++ b/Source/SPServerVariablesController.m
@@ -133,7 +133,21 @@
[panel setAllowsOtherFileTypes:YES];
[panel setCanSelectHiddenExtension:YES];
- [panel beginSheetForDirectory:nil file:@"ServerVariables" modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:nil];
+ [panel setNameFieldStringValue:@"ServerVariables"];
+ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) {
+ if (returnCode == NSOKButton) {
+ if ([variablesFiltered count] > 0) {
+ NSMutableString *variablesString = [NSMutableString stringWithFormat:@"# MySQL server variables for %@\n\n", [[(SPAppController*)[NSApp delegate] frontDocument] host]];
+
+ for (NSDictionary *variable in variablesFiltered)
+ {
+ [variablesString appendFormat:@"%@ = %@\n", [variable objectForKey:@"Variable_name"], [variable objectForKey:@"Value"]];
+ }
+
+ [variablesString writeToURL:[panel URL] atomically:YES encoding:NSUTF8StringEncoding error:NULL];
+ }
+ }
+ }];
}
@@ -164,25 +178,6 @@
}
/**
- * Invoked when the save panel is dismissed.
- */
-- (void)savePanelDidEnd:(NSSavePanel *)panel returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo
-{
- if (returnCode == NSOKButton) {
- if ([variablesFiltered count] > 0) {
- NSMutableString *variablesString = [NSMutableString stringWithFormat:@"# MySQL server variables for %@\n\n", [[(SPAppController*)[NSApp delegate] frontDocument] host]];
-
- for (NSDictionary *variable in variablesFiltered)
- {
- [variablesString appendFormat:@"%@ = %@\n", [variable objectForKey:@"Variable_name"], [variable objectForKey:@"Value"]];
- }
-
- [variablesString writeToURL:[panel URL] atomically:YES encoding:NSUTF8StringEncoding error:NULL];
- }
- }
-}
-
-/**
* Menu item validation.
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem