From 89d3b6d3707be0e971086c1273fdecbbfb9538d8 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Mon, 18 May 2009 16:09:19 +0000 Subject: 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. --- Source/SPTableRelations.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Source') 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 - -- cgit v1.2.3