aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authoravenjamin <avenjamin@gmail.com>2009-02-18 04:43:30 +0000
committeravenjamin <avenjamin@gmail.com>2009-02-18 04:43:30 +0000
commit1dae450e32b269cb95c47a4274de9641ea0e779a (patch)
treedf34db5c5893cc5c0d1fc37fa64e2e9a7f740c9e /Source
parentb1809a297076acdf1d5f56f7b81b6c1bbfaf7538 (diff)
downloadsequelpro-1dae450e32b269cb95c47a4274de9641ea0e779a.tar.gz
sequelpro-1dae450e32b269cb95c47a4274de9641ea0e779a.tar.bz2
sequelpro-1dae450e32b269cb95c47a4274de9641ea0e779a.zip
Fixed Issue #168
Choose Database popup button now reverts to current database when cancelling the "Add Database…" dialog.
Diffstat (limited to 'Source')
-rw-r--r--Source/TableDocument.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 78f29d24..6969e561 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -512,8 +512,10 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa
[NSApp endSheet:databaseSheet];
[databaseSheet orderOut:nil];
- if (!code)
+ if (!code) {
+ (![self database]) ? [chooseDatabaseButton selectItemAtIndex:0] : [chooseDatabaseButton selectItemWithTitle:[self database]];
return;
+ }
if ([[databaseNameField stringValue] isEqualToString:@""]) {
NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, NSLocalizedString(@"Database must have a name.", @"message of panel when no db name is given"));