aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-09-28 22:11:49 +0000
committerrowanbeentje <rowan@beent.je>2009-09-28 22:11:49 +0000
commite2aa62d6038da6b49015bf860090fe7b41fc3770 (patch)
tree58a0e206537683c4c266e75f1740bfe2944825ec /Source
parent85418096bef008f1a9d7839bff9190a2f7b7817d (diff)
downloadsequelpro-e2aa62d6038da6b49015bf860090fe7b41fc3770.tar.gz
sequelpro-e2aa62d6038da6b49015bf860090fe7b41fc3770.tar.bz2
sequelpro-e2aa62d6038da6b49015bf860090fe7b41fc3770.zip
- When adding tables, use standard selection update methods rather than custom (and partial) code; fixes issues of showing old columns/data from the previous table when creating new tables.
Diffstat (limited to 'Source')
-rw-r--r--Source/TablesList.m32
1 files changed, 2 insertions, 30 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m
index bfe053c4..3cd4a8a2 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -1775,41 +1775,13 @@
[tableTypes insertObject:[NSNumber numberWithInt:SP_TABLETYPE_TABLE] atIndex:addItemAtIndex];
}
- // Set the selected table name and type, and then use updateFilter to update the filter list and selection.
+ // Set the selected table name and type, and then use updateFilter and updateSelection to update the filter list and selection.
if (selectedTableName) [selectedTableName release];
selectedTableName = [[NSString alloc] initWithString:tableName];
selectedTableType = SP_TABLETYPE_TABLE;
[self updateFilter:self];
+ [self updateSelection];
[tablesListView scrollRowToVisible:[tablesListView selectedRow]];
-
- NSInteger selectedIndex = [tabView indexOfTabViewItem:[tabView selectedTabViewItem]];
-
- if (selectedIndex == 0) {
- [tableSourceInstance loadTable:tableName];
- structureLoaded = YES;
- contentLoaded = NO;
- statusLoaded = NO;
- }
- else if (selectedIndex == 1) {
- [tableContentInstance loadTable:tableName];
- structureLoaded = NO;
- contentLoaded = YES;
- statusLoaded = NO;
- }
- else if (selectedIndex == 3) {
- [extendedTableInfoInstance loadTable:tableName];
- structureLoaded = NO;
- contentLoaded = NO;
- statusLoaded = YES;
- }
- else {
- statusLoaded = NO;
- structureLoaded = NO;
- contentLoaded = NO;
- }
-
- // Set window title
- [tableWindow setTitle:[tableDocumentInstance displayName]];
}
else {
// Error while creating new table