aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableRelations.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-05-18 16:09:19 +0000
committerstuconnolly <stuart02@gmail.com>2009-05-18 16:09:19 +0000
commit89d3b6d3707be0e971086c1273fdecbbfb9538d8 (patch)
tree6c270e1ac78b95e1b7f5185709d5d3d4accfbb30 /Source/SPTableRelations.m
parent99fa7b664865bb7a55d18576593a585034638dcf (diff)
downloadsequelpro-89d3b6d3707be0e971086c1273fdecbbfb9538d8.tar.gz
sequelpro-89d3b6d3707be0e971086c1273fdecbbfb9538d8.tar.bz2
sequelpro-89d3b6d3707be0e971086c1273fdecbbfb9538d8.zip
Fix an issue where by selecting a table with relations and then selecting one which doesn't still displays the relations of the previously selected table.
Diffstat (limited to 'Source/SPTableRelations.m')
-rw-r--r--Source/SPTableRelations.m15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index 62ca6582..64741b70 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -244,9 +244,7 @@
{
[relData removeAllObjects];
- if([tablesListInstance tableType] == SP_TABLETYPE_TABLE) {
- // update the top label
- [labelText setStringValue:[NSString stringWithFormat:@"Relations for table: %@",[tablesListInstance tableName]]];
+ if ([tablesListInstance tableType] == SP_TABLETYPE_TABLE) {
[tableDataInstance updateInformationForCurrentTable];
@@ -283,16 +281,21 @@
NSString *engine = [tableDataInstance statusValueForKey:@"Engine"];
if (([tablesListInstance tableType] == SP_TABLETYPE_TABLE) && ([[engine lowercaseString] isEqualToString:@"innodb"])) {
+
+ // Update the text label
+ [labelText setStringValue:[NSString stringWithFormat:@"Relations for table: %@", [tablesListInstance tableName]]];
+
[addButton setEnabled:YES];
[refreshButton setEnabled:YES];
-
- [self refresh:self];
- } else {
+ }
+ else {
[addButton setEnabled:NO];
[refreshButton setEnabled:NO];
[labelText setStringValue:([tablesListInstance tableType] == SP_TABLETYPE_TABLE) ? @"This table does not support relations" : @""];
}
+
+ [self refresh:self];
}
#pragma mark -