aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExtendedTableInfo.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-28 09:15:53 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-28 09:15:53 +0000
commit297086a539bc69bf389979e68e3d8dcfc64f56d4 (patch)
tree167dea172c1f7dac7780a91b3f0608a3154eac98 /Source/SPExtendedTableInfo.m
parent1f708a13801b64299effcf6cf3df7b2224ba2e6e (diff)
downloadsequelpro-297086a539bc69bf389979e68e3d8dcfc64f56d4.tar.gz
sequelpro-297086a539bc69bf389979e68e3d8dcfc64f56d4.tar.bz2
sequelpro-297086a539bc69bf389979e68e3d8dcfc64f56d4.zip
• Table Info
- show create syntax for views - fixed editing behaviour of the Comments field (esp. for views)
Diffstat (limited to 'Source/SPExtendedTableInfo.m')
-rw-r--r--Source/SPExtendedTableInfo.m17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index d2e39509..2b20fbab 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -187,6 +187,14 @@
if ([[statusFields objectForKey:@"Engine"] isEqualToString:@"View"]) {
[tableTypePopUpButton addItemWithTitle:@"View"];
+ // Set create syntax
+ [tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView setString:@""];
+ [tableCreateSyntaxTextView insertText:[[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier]];
+ [tableCreateSyntaxTextView setEditable:NO];
+ } else {
+ [tableCreateSyntaxTextView setEditable:NO];
+ [tableCreateSyntaxTextView setString:@""];
}
[tableCreatedAt setStringValue:@"Created at: "];
@@ -206,9 +214,8 @@
// Set comments
[tableCommentsTextView setString:@""];
+ [tableCommentsTextView setEditable:NO];
- // Set create syntax
- [tableCreateSyntaxTextView setString:@""];
return;
}
@@ -274,6 +281,7 @@
[tableSizeFree setStringValue:[self _formatValueWithKey:@"Data_free" inDictionary:statusFields withLabel:@"Free data size"]];
// Set comments
+ [tableCommentsTextView setEditable:YES];
[tableCommentsTextView setString:[statusFields objectForKey:@"Comment"]];
// Set create syntax
@@ -288,11 +296,12 @@
*/
- (void)textDidEndEditing:(NSNotification *)notification
{
- if (([notification object] == tableCommentsTextView) && ([selectedTable length] > 0)) {
+ id object = [notification object];
+ if ((object == tableCommentsTextView) && ([object isEditable]) && ([selectedTable length] > 0)) {
NSString *currentComment = [tableDataInstance statusValueForKey:@"Comment"];
NSString *newComment = [[tableCommentsTextView string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
-
+
// Check that the user actually changed the tables comment
if (![currentComment isEqualToString:newComment]) {