aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authordrx777 <david.rekowski@gmx.de>2010-04-29 20:04:17 +0000
committerdrx777 <david.rekowski@gmx.de>2010-04-29 20:04:17 +0000
commitf24fb1fb21d9c73c707d3c32ab4b6e380131ce8a (patch)
tree01d52307e9801076c9dc635c5c9dc28a027fbfee /Source/TableDocument.m
parent2cd8213451d16c37c465a30cc5bd9bdc90b4ee31 (diff)
downloadsequelpro-f24fb1fb21d9c73c707d3c32ab4b6e380131ce8a.tar.gz
sequelpro-f24fb1fb21d9c73c707d3c32ab4b6e380131ce8a.tar.bz2
sequelpro-f24fb1fb21d9c73c707d3c32ab4b6e380131ce8a.zip
For add/rename/duplicate DB: check new name input for an existing db name and disable OK button if it does.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index a5dc87b4..49d931c3 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -3940,13 +3940,13 @@
id object = [notification object];
if (object == databaseNameField) {
- [addDatabaseButton setEnabled:([[databaseNameField stringValue] length] > 0)];
+ [addDatabaseButton setEnabled:([[databaseNameField stringValue] length] > 0 && ![allDatabases containsObject: [databaseNameField stringValue]])];
}
else if (object == databaseCopyNameField) {
- [copyDatabaseButton setEnabled:([[databaseCopyNameField stringValue] length] > 0)];
+ [copyDatabaseButton setEnabled:([[databaseCopyNameField stringValue] length] > 0 && ![allDatabases containsObject: [databaseCopyNameField stringValue]])];
}
else if (object == databaseRenameNameField) {
- [renameDatabaseButton setEnabled:([[databaseRenameNameField stringValue] length] > 0)];
+ [renameDatabaseButton setEnabled:([[databaseRenameNameField stringValue] length] > 0 && ![allDatabases containsObject: [databaseRenameNameField stringValue]])];
}
else if (object == saveConnectionEncryptString) {
[saveConnectionEncryptString setStringValue:[saveConnectionEncryptString stringValue]];