diff options
author | bamse16 <marius@marius.me.uk> | 2009-03-23 12:45:56 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2009-03-23 12:45:56 +0000 |
commit | 3d58dc8578c5a48e254f3ffa2394ed875c83a60e (patch) | |
tree | 67c904ae99a61665adb4cf367b7019cba4c12dd0 /Source/TablesList.m | |
parent | a6003a92fc507924f439cd69050cb44e349e0e29 (diff) | |
download | sequelpro-3d58dc8578c5a48e254f3ffa2394ed875c83a60e.tar.gz sequelpro-3d58dc8578c5a48e254f3ffa2394ed875c83a60e.tar.bz2 sequelpro-3d58dc8578c5a48e254f3ffa2394ed875c83a60e.zip |
Issue 194: reload table list deselects tables
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r-- | Source/TablesList.m | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m index afe60a25..1f33d5ab 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -46,6 +46,13 @@ loads all table names in array tables and reload the tableView NSArray *resultRow; int i; BOOL containsViews = NO; + NSString *selectedTable = nil; + NSInteger selectedRowIndex; + + selectedRowIndex = [tablesListView selectedRow]; + if(selectedRowIndex > 0 && [tables count]){ + selectedTable = [NSString stringWithString:[tables objectAtIndex:selectedRowIndex]]; + } [tablesListView deselectAll:self]; [tables removeAllObjects]; @@ -89,7 +96,12 @@ loads all table names in array tables and reload the tableView // Notify listeners that the query has finished [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self]; - [tablesListView reloadData]; + [tablesListView reloadData]; + + //if the previous selected table still exists, select it + if( selectedTable != nil && [tables indexOfObject:selectedTable] < [tables count]) { + [tablesListView selectRowIndexes:[NSIndexSet indexSetWithIndex:[tables indexOfObject:selectedTable]] byExtendingSelection:NO]; + } } /* |