From e3a67c9070a9c331c68503be481a6eda18402d96 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 11 Dec 2010 22:22:02 +0000 Subject: - Fix an issue where after failing to select a database the database dropdown stayed disabled --- Source/SPDatabaseDocument.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index c51a87e3..731ff3c6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5293,14 +5293,18 @@ if ([chooseDatabaseButton indexOfItemWithTitle:targetDatabaseName] == NSNotFound || ![mySQLConnection selectDB:targetDatabaseName]) { + + // End the task first to ensure the database dropdown can be reselected + [self endTask]; + if ( [mySQLConnection isConnected] ) { - SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to connect to database %@.\nBe sure that you have the necessary privileges.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]); // Update the database list [[self onMainThread] setDatabases:self]; + + SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to select database %@.\nPlease check you have the necessary privileges to view the database, and that the database still exists.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]); } - [self endTask]; [taskPool drain]; return; } -- cgit v1.2.3