diff options
author | stuconnolly <stuart02@gmail.com> | 2012-11-18 22:36:04 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-11-18 22:36:04 +0000 |
commit | 7ce6e8149f1f1050036d1682907e453f1f205eee (patch) | |
tree | 63825e8a072c2ad95180644503c827a8e76e7538 /Source | |
parent | a1ffa498a2e23d5f98822d5ee2e7c2a0cc8b2e8e (diff) | |
download | sequelpro-7ce6e8149f1f1050036d1682907e453f1f205eee.tar.gz sequelpro-7ce6e8149f1f1050036d1682907e453f1f205eee.tar.bz2 sequelpro-7ce6e8149f1f1050036d1682907e453f1f205eee.zip |
Fix the selected node in the favorites connection view when adding a new favorite to an empty group.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConnectionController.m | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 073dc53c..a8c9da8d 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -107,7 +107,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, @end - @implementation SPConnectionController @synthesize delegate; @@ -740,12 +739,14 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, SPTreeNode *selectedNode = [self selectedFavoriteNode]; SPTreeNode *parent = ([selectedNode isGroup] && selectedNode != quickConnectItem) ? selectedNode : (SPTreeNode *)[selectedNode parentNode]; - - // Ensure the parent is expanded - [favoritesOutlineView expandItem:parent]; SPTreeNode *node = [favoritesController addFavoriteNodeWithData:favorite asChildOfNode:parent]; + //[self _reloadFavoritesViewData]; + + // Ensure the parent is expanded + [favoritesOutlineView expandItem:parent]; + [self _sortFavorites]; [self _selectNode:node]; @@ -1513,6 +1514,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, { [favoritesOutlineView reloadData]; [favoritesOutlineView expandItem:[[favoritesRoot childNodes] objectAtIndex:0] expandChildren:NO]; + [self _scrollToSelectedNode]; } @@ -1600,7 +1602,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, */ - (void)_scrollToSelectedNode { - // Don't scroll if no node is currently selected if ([favoritesOutlineView selectedRow] == -1) return; |