aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-04-23 14:38:47 +0000
committerBibiko <bibiko@eva.mpg.de>2009-04-23 14:38:47 +0000
commita16c4f07fb362c3dac9af24f8df8765ca1e61900 (patch)
treea25ae3ee0f0e832557c926bc6878614930ed3fac /Source/TableDocument.m
parent985d03cb9980bc92078af8c6a6815efdeefd1377 (diff)
downloadsequelpro-a16c4f07fb362c3dac9af24f8df8765ca1e61900.tar.gz
sequelpro-a16c4f07fb362c3dac9af24f8df8765ca1e61900.tar.bz2
sequelpro-a16c4f07fb362c3dac9af24f8df8765ca1e61900.zip
• ADDED createViewSyntaxPrettifier method to a NSString to make the syntax a bit more readable
- used for show/copy create view syntax as well as for a MySQL dump
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m19
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 851213e7..3acb53b4 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -936,8 +936,12 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
if ([tableSyntax isKindOfClass:[NSData class]])
tableSyntax = [[NSString alloc] initWithData:tableSyntax encoding:[mySQLConnection encoding]];
-
- [syntaxViewContent setString:tableSyntax];
+
+ if([tablesListInstance tableType] == SP_TABLETYPE_VIEW)
+ [syntaxViewContent setString:[tableSyntax createViewSyntaxPrettifier]];
+ else
+ [syntaxViewContent setString:tableSyntax];
+
[createTableSyntaxWindow makeKeyAndOrderFront:self];
}
@@ -966,10 +970,13 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
// copy to the clipboard
NSPasteboard *pb = [NSPasteboard generalPasteboard];
[pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
- [pb setString:tableSyntax forType:NSStringPboardType];
-
- // Table syntax copied Growl notification
- [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Table Syntax Copied"
+ if([tablesListInstance tableType] == SP_TABLETYPE_VIEW)
+ [pb setString:[tableSyntax createViewSyntaxPrettifier] forType:NSStringPboardType];
+ else
+ [pb setString:tableSyntax forType:NSStringPboardType];
+
+ // Table syntax copied Growl notification
+ [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Table Syntax Copied"
description:[NSString stringWithFormat:NSLocalizedString(@"Syntax for %@ table copied",@"description for table syntax copied growl notification"), [self table]]
notificationName:@"Table Syntax Copied"];
}