From 2af8b4caa41b66311036b6f5a1009c8494f5bcab Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 15 Nov 2008 02:46:46 +0000 Subject: Clean up connection cancellations - When cancel is pressed in the connection sheet, close the associated window, and check whether a connection was opened before closing it and notifying of connection close via Growl. --- TableDocument.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TableDocument.m b/TableDocument.m index a7f33ea8..ec42b1a6 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -239,6 +239,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa - (IBAction)cancelConnectSheet:(id)sender { [NSApp endSheet:connectSheet]; + [tableWindow close]; } - (IBAction)closeSheet:(id)sender @@ -1442,7 +1443,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa - (void)windowWillClose:(NSNotification *)aNotification { - [self closeConnection]; + if ([mySQLConnection isConnected]) [self closeConnection]; [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- cgit v1.2.3