From 374b6ec778c7feceebf658480bb78dfba9cd119f Mon Sep 17 00:00:00 2001 From: abhibeckert Date: Fri, 2 May 2008 11:42:24 +0000 Subject: added 'copy table syntax' menu item fixed copy button on show table syntax window --- TableDocument.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'TableDocument.m') diff --git a/TableDocument.m b/TableDocument.m index 63d852af..d273a102 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -748,7 +748,7 @@ reused when user hits the close button of the variablseSheet or of the createTab #pragma mark Table Methods -- (IBAction)createTableSyntax:(id)sender +- (IBAction)showCreateTableSyntax:(id)sender { //Create the query and get results NSString *query = [NSString stringWithFormat:@"SHOW CREATE TABLE `%@`", [self table]]; @@ -769,9 +769,9 @@ reused when user hits the close button of the variablseSheet or of the createTab [createTableSyntaxWindow makeKeyAndOrderFront:self]; } -- (IBAction)copyTableSyntax:(id)sender +- (IBAction)copyCreateTableSyntax:(id)sender { - //Create the query and get results + // Create the query and get results NSString *query = [NSString stringWithFormat:@"SHOW CREATE TABLE `%@`", [self table]]; CMMCPResult *theResult = [mySQLConnection queryString:query]; @@ -787,12 +787,11 @@ reused when user hits the close button of the variablseSheet or of the createTab tableSyntax = [[NSString alloc] initWithData:tableSyntax encoding:[mySQLConnection encoding]]; // copy to the clipboard - - [[NSPasteboard generalPasteboard] setString:tableSyntax forType:NSStringPboardType]; - + NSPasteboard *pb = [NSPasteboard generalPasteboard]; + [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; + [pb setString:tableSyntax forType:NSStringPboardType]; } - - (IBAction)checkTable:(id)sender { NSString *query; -- cgit v1.2.3