aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-02-21 00:50:15 +0000
committerrowanbeentje <rowan@beent.je>2013-02-21 00:50:15 +0000
commit77b2f3d777bc743b7b96a9f2267d1a89d704510d (patch)
tree36a5a2b9369b696a280e9ca6ad1e195e8f74de44 /Source/SPConnectionController.m
parent9aaa544772539410f28df132be78e0f44da1db10 (diff)
downloadsequelpro-77b2f3d777bc743b7b96a9f2267d1a89d704510d.tar.gz
sequelpro-77b2f3d777bc743b7b96a9f2267d1a89d704510d.tar.bz2
sequelpro-77b2f3d777bc743b7b96a9f2267d1a89d704510d.zip
- When favorites in the connection view gave no password, no longer set the focus to the password field as soon as they're selected; instead, make the password field the next responder for tab keys. This addresses Issue #1555.
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m29
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 9e0d50cd..898d8154 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -651,8 +651,33 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
[prefs setInteger:[[fav objectForKey:SPFavoriteIDKey] integerValue] forKey:SPLastFavoriteID];
- // Set first responder to password field if it is empty
- [self performSelector:@selector(_updateFavoriteFirstResponder) withObject:nil afterDelay:0.0];
+ // Set the next KeyView to password field if the password is empty
+ switch ([self type])
+ {
+ case SPTCPIPConnection:
+ if (![[standardPasswordField stringValue] length]) {
+ [favoritesOutlineView setNextKeyView:standardPasswordField];
+ } else {
+ [favoritesOutlineView setNextKeyView:standardNameField];
+ }
+ break;
+ case SPSocketConnection:
+ if (![[socketPasswordField stringValue] length]) {
+ [favoritesOutlineView setNextKeyView:socketPasswordField];
+ } else {
+ [favoritesOutlineView setNextKeyView:socketNameField];
+ }
+ break;
+ case SPSSHTunnelConnection:
+ if (![[sshPasswordField stringValue] length]) {
+ [favoritesOutlineView setNextKeyView:sshPasswordField];
+ } else if (![[sshSSHPasswordField stringValue] length]) {
+ [favoritesOutlineView setNextKeyView:sshSSHPasswordField];
+ } else {
+ [favoritesOutlineView setNextKeyView:sshNameField];
+ }
+ break;
+ }
#endif
}