aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionControllerDelegate.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-05-03 12:05:01 +0000
committerstuconnolly <stuart02@gmail.com>2012-05-03 12:05:01 +0000
commit83fa503079f7a049ffab9747b0360046474f3253 (patch)
tree028d0a92e558ba42e796847ab0f68d6e3037fb50 /Source/SPConnectionControllerDelegate.m
parent0d3af5fe7631325e8a892011f0595c76b1ebd49a (diff)
downloadsequelpro-83fa503079f7a049ffab9747b0360046474f3253.tar.gz
sequelpro-83fa503079f7a049ffab9747b0360046474f3253.tar.bz2
sequelpro-83fa503079f7a049ffab9747b0360046474f3253.zip
Add support for saving the state of the connection favorites outline view.
Diffstat (limited to 'Source/SPConnectionControllerDelegate.m')
-rw-r--r--Source/SPConnectionControllerDelegate.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index 389bd46c..bc6800c3 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -47,6 +47,8 @@ static NSString *SPDatabaseImage = @"database-small";
- (NSString *)_stripInvalidCharactersFromString:(NSString *)subject;
+- (void)_setNodeIsExpanded:(BOOL)expanded fromNotification:(NSNotification *)notification;
+
@end
@implementation SPConnectionController (SPConnectionControllerDelegate)
@@ -154,6 +156,16 @@ static NSString *SPDatabaseImage = @"database-small";
return ([[item parentNode] parentNode] != nil);
}
+- (void)outlineViewItemDidCollapse:(NSNotification *)notification
+{
+ [self _setNodeIsExpanded:NO fromNotification:notification];
+}
+
+- (void)outlineViewItemDidExpand:(NSNotification *)notification
+{
+ [self _setNodeIsExpanded:YES fromNotification:notification];
+}
+
#pragma mark -
#pragma mark Outline view drag & drop
@@ -557,4 +569,14 @@ static NSString *SPDatabaseImage = @"database-small";
}
}
+#pragma mark -
+#pragma mark Private API
+
+- (void)_setNodeIsExpanded:(BOOL)expanded fromNotification:(NSNotification *)notification
+{
+ SPGroupNode *node = [[[notification userInfo] valueForKey:@"NSObject"] representedObject];
+
+ [node setNodeIsExpanded:expanded];
+}
+
@end