diff options
author | stuconnolly <stuart02@gmail.com> | 2011-03-05 00:14:43 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-03-05 00:14:43 +0000 |
commit | 32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c (patch) | |
tree | 4d1f2fe472fa622665b81f775f3a43f924a5b71f /Source/SPConnectionController.m | |
parent | bea72ac3bbebb9e35e34b840968b4ba0f433e87a (diff) | |
download | sequelpro-32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c.tar.gz sequelpro-32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c.tar.bz2 sequelpro-32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c.zip |
Add support for auto saving expanded items.
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r-- | Source/SPConnectionController.m | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 8424b427..49dcb542 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -167,9 +167,14 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v // Register double click action for the favorites outline view (double click favorite to connect) [favoritesOutlineView setTarget:self]; [favoritesOutlineView setDoubleAction:@selector(nodeDoubleClicked:)]; + + // Register drag types for the favorites outline view [favoritesOutlineView registerForDraggedTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType]]; [favoritesOutlineView setDraggingSourceOperationMask:NSDragOperationMove forLocal:YES]; + // Preserve expanded group nodes + [favoritesOutlineView setAutosaveExpandedItems:YES]; + // Registered to be notified of changes to connection information [self addObserver:self forKeyPath:SPFavoriteNameKey options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:NULL]; [self addObserver:self forKeyPath:SPFavoriteHostKey options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:NULL]; @@ -1283,7 +1288,7 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v - (void)_reloadFavoritesViewData { [favoritesOutlineView reloadData]; - [favoritesOutlineView expandItem:[[favoritesRoot childNodes] objectAtIndex:0] expandChildren:YES]; + [favoritesOutlineView expandItem:[[favoritesRoot childNodes] objectAtIndex:0] expandChildren:NO]; [favoritesOutlineView scrollRowToVisible:[favoritesOutlineView selectedRow]]; } |