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/SPConnectionControllerDelegate.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/SPConnectionControllerDelegate.m')
-rw-r--r-- | Source/SPConnectionControllerDelegate.m | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 3318958e..3aeb2da6 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -50,62 +50,6 @@ } #pragma mark - -#pragma mark Outline view datasource methods - -- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item -{ - SPTreeNode *node = (item == nil ? favoritesRoot : (SPTreeNode *)item); - - return [[node childNodes] count]; -} - -- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item -{ - SPTreeNode *node = (item == nil ? favoritesRoot : (SPTreeNode *)item); - - return NSArrayObjectAtIndex([node childNodes], index); -} - -- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item -{ - return [(SPTreeNode *)item isGroup]; -} - -- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item -{ - SPTreeNode *node = (SPTreeNode *)item; - - return (![node isGroup]) ? [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteNameKey] : [[node representedObject] nodeName]; -} - -- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item -{ - // Trim whitespace - NSString *newName = [object stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - - if ([newName length]) { - - // Get the node that was renamed - SPTreeNode *node = [self selectedFavoriteNode]; - - if (![node isGroup]) { - // Updating the name triggers a KVO update - [self setName:newName]; - - // Update associated Keychain items - [self _updateFavoritePasswordsFromField:nil]; - } - else { - [[node representedObject] setNodeName:newName]; - - [favoritesController saveFavorites]; - - [self _reloadFavoritesViewData]; - } - } -} - -#pragma mark - #pragma mark Outline view delegate methods - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item |