aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-02-08 21:02:48 +0000
committerstuconnolly <stuart02@gmail.com>2011-02-08 21:02:48 +0000
commitf5a99e49839174bdfa2364fbba1c963da4a3481b (patch)
treef882f789e74db49e800775f366d0bf1dcce56385 /Source/SPConnectionController.m
parentfd4305711129a5b6a5ff4571f2b39295bcddf831 (diff)
downloadsequelpro-f5a99e49839174bdfa2364fbba1c963da4a3481b.tar.gz
sequelpro-f5a99e49839174bdfa2364fbba1c963da4a3481b.tar.bz2
sequelpro-f5a99e49839174bdfa2364fbba1c963da4a3481b.zip
When the user cancels the SSH password prompt, prevent further prompts and also suppress the error detail dialog. Fixes issue #975.
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")];
}
}