aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index c521213c..41f44a1d 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -382,16 +382,28 @@
- (void)sshTunnelCallback:(SPSSHTunnel *)theTunnel
{
if (cancellingConnection) return;
+
NSInteger newState = [theTunnel state];
+
+ // If the user cancelled the password prompt dialog
+ if ([theTunnel passwordPromptCancelled]) {
+ [self _restoreConnectionInterface];
+
+ return;
+ }
if (newState == PROXY_STATE_IDLE) {
[tableDocument setTitlebarStatus:NSLocalizedString(@"SSH Disconnected", @"SSH disconnected titlebar marker")];
+
[self failConnectionWithTitle:NSLocalizedString(@"SSH connection failed!", @"SSH connection failed title") errorMessage:[theTunnel lastError] detail:[sshTunnel debugMessages]];
[self _restoreConnectionInterface];
- } else if (newState == PROXY_STATE_CONNECTED) {
+ }
+ else if (newState == PROXY_STATE_CONNECTED) {
[tableDocument setTitlebarStatus:NSLocalizedString(@"SSH Connected", @"SSH connected titlebar marker")];
+
[self initiateMySQLConnection];
- } else {
+ }
+ else {
[tableDocument setTitlebarStatus:NSLocalizedString(@"SSH Connecting…", @"SSH connecting titlebar marker")];
}
}