From b0195c5305a4fc3db4ffaa113ce4d246bd4dec66 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 23 Apr 2010 13:49:12 +0000 Subject: Only attempt to check or set the max allowed packet if there is an active connection as well as only displaying dialogs when there is a window visible. Fixes http://spbug.com/l/113. --- Source/SPConnectionController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/SPConnectionController.m') diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 9d646278..f2d5fcdd 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -436,8 +436,10 @@ [delegate connectionControllerConnectAttemptFailed:self]; } - // Display the connection error message - SPBeginAlertSheet(theTitle, NSLocalizedString(@"OK", @"OK button"), (errorDetail) ? NSLocalizedString(@"Show Detail", @"Show detail button") : nil, (isSSHTunnelBindError) ? NSLocalizedString(@"Use Standard Connection", @"use standard connection button") : nil, documentWindow, self, nil, @selector(errorSheetDidEnd:returnCode:contextInfo:), @"connect", theErrorMessage); + // Only display the connection error message if there is a window visible + if ([documentWindow isVisible]) { + SPBeginAlertSheet(theTitle, NSLocalizedString(@"OK", @"OK button"), (errorDetail) ? NSLocalizedString(@"Show Detail", @"Show detail button") : nil, (isSSHTunnelBindError) ? NSLocalizedString(@"Use Standard Connection", @"use standard connection button") : nil, documentWindow, self, nil, @selector(errorSheetDidEnd:returnCode:contextInfo:), @"connect", theErrorMessage); + } } /** -- cgit v1.2.3