aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExtendedTableInfo.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-11-18 01:03:21 +0000
committerrowanbeentje <rowan@beent.je>2009-11-18 01:03:21 +0000
commit251bc8a52e56fbf240b74d7bfcaf21090bbfe83f (patch)
treee992739c33d2d89f34eb4a30632984c859739810 /Source/SPExtendedTableInfo.m
parent1c7cf0aa49e68714dbfc4d7ca01fccd519e22aee (diff)
downloadsequelpro-251bc8a52e56fbf240b74d7bfcaf21090bbfe83f.tar.gz
sequelpro-251bc8a52e56fbf240b74d7bfcaf21090bbfe83f.tar.bz2
sequelpro-251bc8a52e56fbf240b74d7bfcaf21090bbfe83f.zip
- Make some thread safety improvements to improve on Issue #460
- Add some NSTextView editing notifications to maintain state correctly in an attempt to fix issue in crash log on comment 9 on #460
Diffstat (limited to 'Source/SPExtendedTableInfo.m')
-rw-r--r--Source/SPExtendedTableInfo.m24
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 9a84286e..b2d92a58 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -204,12 +204,19 @@
[tableTypePopUpButton addItemWithTitle:@"View"];
// Set create syntax
[tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCreateSyntaxTextView string] length]) replacementString:@""];
[tableCreateSyntaxTextView setString:@""];
- [tableCreateSyntaxTextView insertText:[[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier]];
+ NSString *createViewSyntax = [[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:createViewSyntax];
+ [tableCreateSyntaxTextView insertText:createViewSyntax];
+ [tableCreateSyntaxTextView didChangeText];
[tableCreateSyntaxTextView setEditable:NO];
} else {
- [tableCreateSyntaxTextView setEditable:NO];
+ [tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCreateSyntaxTextView string] length]) replacementString:@""];
[tableCreateSyntaxTextView setString:@""];
+ [tableCreateSyntaxTextView didChangeText];
+ [tableCreateSyntaxTextView setEditable:NO];
}
[tableCreatedAt setStringValue:@"Created at: "];
@@ -228,8 +235,10 @@
[tableSizeFree setStringValue:@"Free data size: "];
// Set comments
- [tableCommentsTextView setString:@""];
[tableCommentsTextView setEditable:NO];
+ [tableCommentsTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:@""];
+ [tableCommentsTextView setString:@""];
+ [tableCommentsTextView didChangeText];
return;
}
@@ -304,13 +313,20 @@
[tableSizeFree setStringValue:[self _formatValueWithKey:@"Data_free" inDictionary:statusFields withLabel:@"Free data size"]];
// Set comments
- [tableCommentsTextView setEditable:enableInteraction];
+ [tableCommentsTextView setEditable:YES];
+ [tableCommentsTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:[statusFields objectForKey:@"Comment"]];
[tableCommentsTextView setString:[statusFields objectForKey:@"Comment"]];
+ [tableCommentsTextView didChangeText];
+ [tableCommentsTextView setEditable:enableInteraction];
// Set create syntax
[tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:@""];
[tableCreateSyntaxTextView setString:@""];
+ [tableCreateSyntaxTextView didChangeText];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:[tableDataInstance tableCreateSyntax]];
[tableCreateSyntaxTextView insertText:[tableDataInstance tableCreateSyntax]];
+ [tableCreateSyntaxTextView didChangeText];
[tableCreateSyntaxTextView setEditable:NO];
}