aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-12-11 22:22:02 +0000
committerrowanbeentje <rowan@beent.je>2010-12-11 22:22:02 +0000
commite3a67c9070a9c331c68503be481a6eda18402d96 (patch)
tree6bbc5690fdf551ce6180b697ea15f16d00a2ca9d
parentcb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8 (diff)
downloadsequelpro-e3a67c9070a9c331c68503be481a6eda18402d96.tar.gz
sequelpro-e3a67c9070a9c331c68503be481a6eda18402d96.tar.bz2
sequelpro-e3a67c9070a9c331c68503be481a6eda18402d96.zip
- Fix an issue where after failing to select a database the database dropdown stayed disabled
-rw-r--r--Source/SPDatabaseDocument.m8
1 files 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;
}