aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-04 20:19:59 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-04 20:19:59 +0000
commit905dd61bd91f3dce22655bf942302739544dd86c (patch)
treeb8b6247c72a7716a8dff5e2211949dcfe186bf53
parenta62ac5494e570f782ab9bf74270f0ca7a61e033b (diff)
downloadsequelpro-905dd61bd91f3dce22655bf942302739544dd86c.tar.gz
sequelpro-905dd61bd91f3dce22655bf942302739544dd86c.tar.bz2
sequelpro-905dd61bd91f3dce22655bf942302739544dd86c.zip
• added: the "Show Create Syntax" window now follows the selection in the table list if it was already opened
• commented out the NSLog "not parsed" in SPTableData.m
-rw-r--r--Source/SPTableData.m2
-rw-r--r--Source/TableDocument.h1
-rw-r--r--Source/TableDocument.m16
-rw-r--r--Source/TablesList.m6
4 files changed, 22 insertions, 3 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index e1467c2d..ebb03a71 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -487,7 +487,7 @@
}
// who knows
else {
- NSLog( @"not parsed: %@", [parts objectAtIndex:0] );
+ // NSLog( @"not parsed: %@", [parts objectAtIndex:0] );
}
}
}
diff --git a/Source/TableDocument.h b/Source/TableDocument.h
index c996a0bd..f492a3bc 100644
--- a/Source/TableDocument.h
+++ b/Source/TableDocument.h
@@ -183,6 +183,7 @@
- (void)flushPrivileges:(id)sender;
- (void)showVariables:(id)sender;
- (void)closeConnection;
+- (NSWindow *)getCreateTableSyntaxWindow;
//getter methods
- (NSString *)name;
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index ca89d597..28e898a5 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -1177,13 +1177,17 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
if ([tableSyntax isKindOfClass:[NSData class]])
tableSyntax = [[NSString alloc] initWithData:tableSyntax encoding:[mySQLConnection encoding]];
+ [syntaxViewContent setEditable:YES];
if([tablesListInstance tableType] == SP_TABLETYPE_VIEW)
[syntaxViewContent setString:[tableSyntax createViewSyntaxPrettifier]];
else
[syntaxViewContent setString:tableSyntax];
-
+ [syntaxViewContent setEditable:NO];
+
[createTableSyntaxWindow setTitle:createWindowTitle];
- [createTableSyntaxWindow makeKeyAndOrderFront:self];
+
+ if(![createTableSyntaxWindow isVisible])
+ [createTableSyntaxWindow makeKeyAndOrderFront:self];
}
/**
@@ -1923,6 +1927,14 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
}
}
+/*
+ * Return the createTableSyntaxWindow
+ */
+- (NSWindow *)getCreateTableSyntaxWindow
+{
+ return createTableSyntaxWindow;
+}
+
#pragma mark Toolbar Methods
/**
diff --git a/Source/TablesList.m b/Source/TablesList.m
index fa4db07a..716727d8 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -1226,6 +1226,12 @@
// set window title
[tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@/%@", [tableDocumentInstance mySQLVersion],
[tableDocumentInstance name], [tableDocumentInstance database], [tables objectAtIndex:[tablesListView selectedRow]]]];
+
+ // Update the "Show Create Syntax" window if it's already opened
+ // according to the selected table/view/proc/func
+ if([[tableDocumentInstance getCreateTableSyntaxWindow] isVisible])
+ [tableDocumentInstance showCreateTableSyntax:self];
+
} else {
[tableSourceInstance loadTable:nil];
[tableContentInstance loadTable:nil];