aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-10-08 22:37:55 +0000
committerrowanbeentje <rowan@beent.je>2012-10-08 22:37:55 +0000
commit3bfd9431190fef1aa0e15fd0b80d775b6314e9cd (patch)
tree5e06bf0517ca5ba073ff044e24128459f6e8d635
parent13f38b3466737b4794b7f8af882290b692eef497 (diff)
downloadsequelpro-3bfd9431190fef1aa0e15fd0b80d775b6314e9cd.tar.gz
sequelpro-3bfd9431190fef1aa0e15fd0b80d775b6314e9cd.tar.bz2
sequelpro-3bfd9431190fef1aa0e15fd0b80d775b6314e9cd.zip
- Connection interface: when adding a group node or item, ensure that it's visible by ensuring the parent item is expanded
-rw-r--r--Source/SPConnectionController.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index f6e23656..12ead317 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -720,6 +720,9 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
SPTreeNode *selectedNode = [self selectedFavoriteNode];
SPTreeNode *parent = ([selectedNode isGroup]) ? selectedNode : (SPTreeNode *)[selectedNode parentNode];
+
+ // Ensure the parent is expanded
+ [favoritesOutlineView expandItem:parent];
SPTreeNode *node = [favoritesController addFavoriteNodeWithData:favorite asChildOfNode:parent];
@@ -750,7 +753,10 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
SPTreeNode *selectedNode = [self selectedFavoriteNode];
SPTreeNode *parent = ([selectedNode isGroup]) ? selectedNode : (SPTreeNode *)[selectedNode parentNode];
-
+
+ // Ensure the parent is expanded
+ [favoritesOutlineView expandItem:parent];
+
SPTreeNode *node = [favoritesController addGroupNodeWithName:NSLocalizedString(@"New Folder", @"new folder placeholder name") asChildOfNode:parent];
[self _reloadFavoritesViewData];
@@ -1274,6 +1280,9 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
parentNode = (SPTreeNode *)[selectedNode parentNode];
}
+ // Ensure the parent is expanded
+ [favoritesOutlineView expandItem:parentNode];
+
// Add the new node and select it
SPTreeNode *newNode = [favoritesController addFavoriteNodeWithData:theFavorite asChildOfNode:parentNode];
[self _reloadFavoritesViewData];