aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-05-24 09:36:20 +0000
committerstuconnolly <stuart02@gmail.com>2012-05-24 09:36:20 +0000
commit0c949f718f591798cba9028c9292aed2be7b9d89 (patch)
treea612860813ddd8ba3cf49cce8de6b7c464d80e9c /Source/SPConnectionController.m
parentb225cf4913e4fe20dfe57922fcbb8caa78878115 (diff)
downloadsequelpro-0c949f718f591798cba9028c9292aed2be7b9d89.tar.gz
sequelpro-0c949f718f591798cba9028c9292aed2be7b9d89.tar.bz2
sequelpro-0c949f718f591798cba9028c9292aed2be7b9d89.zip
Conection outline view fixes:
- When selecting a group node, instead of hiding the connection details, reset them to an empty state. - When removing a favorite make sure the details view is also set to an empty state. - Remove setting the outline view item's text colour, which should fix display issues on 10.7 Addresses points 1 & 5 on issue #1339.
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m39
1 files changed, 38 insertions, 1 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 93b7dc36..212df1da 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -72,6 +72,7 @@ static NSString *SPExportFavoritesFilename = @"SequelProFavorites.plist";
- (NSString *)_stripInvalidCharactersFromString:(NSString *)subject;
- (void)_updateFavoritePasswordsFromField:(NSControl *)control;
+- (void)_resetConnectionDetailsInputInterface;
static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, void *key);
@@ -743,7 +744,9 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
account:[keychain accountForSSHUser:[self sshUser] sshHost:[self sshHost]]];
}
- SPTreeNode *node = [favoritesController addFavoriteNodeWithData:newFavorite asChildOfNode:nil];
+ SPTreeNode *selectedNode = [self selectedFavoriteNode];
+
+ SPTreeNode *node = [favoritesController addFavoriteNodeWithData:newFavorite asChildOfNode:[selectedNode isGroup] ? selectedNode : nil];
[self _reloadFavoritesViewData];
[self _selectNode:node];
@@ -1328,6 +1331,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
[favoritesController removeFavoriteNode:node];
+ [self _resetConnectionDetailsInputInterface];
[self _reloadFavoritesViewData];
// Clear the selection
@@ -1476,6 +1480,39 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
}
}
+/**
+ * Resets the connection details input interface to an empty state.
+ */
+- (void)_resetConnectionDetailsInputInterface
+{
+ if (currentFavorite) [currentFavorite release], currentFavorite = nil;
+
+ [self setName:@""];
+ [self setHost:@""];
+ [self setSocket:@""];
+ [self setUser:@""];
+ [self setPort:@""];
+ [self setDatabase:@""];
+ [self setPassword:@""];
+
+ // SSL details
+ [self setUseSSL:NSOffState];
+ [self setSslKeyFileLocationEnabled:NSOffState];
+ [self setSslKeyFileLocation:@""];
+ [self setSslCertificateFileLocationEnabled:NSOffState];
+ [self setSslCertificateFileLocation:@""];
+ [self setSslCACertFileLocationEnabled:NSOffState];
+ [self setSslCACertFileLocation:@""];
+
+ // SSH details
+ [self setSshHost:@""];
+ [self setSshUser:@""];
+ [self setSshPassword:@""];
+ [self setSshKeyLocationEnabled:NSOffState];
+ [self setSshKeyLocation:@""];
+ [self setSshPort:@""];
+}
+
#pragma mark -
- (void)dealloc