diff options
author | stuconnolly <stuart02@gmail.com> | 2010-06-15 10:41:34 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-06-15 10:41:34 +0000 |
commit | 1b2c88384d941b28437feaf9d408ca343c485f7e (patch) | |
tree | ad170503f07fc33b0a4cd486daa33a058fafedc9 /Source/SPIndexesController.m | |
parent | bb77a4a36318cdb0a101a1ceba04d35301a64026 (diff) | |
download | sequelpro-1b2c88384d941b28437feaf9d408ca343c485f7e.tar.gz sequelpro-1b2c88384d941b28437feaf9d408ca343c485f7e.tar.bz2 sequelpro-1b2c88384d941b28437feaf9d408ca343c485f7e.zip |
Revert a change made in r2320 that required an explicit name when adding new index.
Diffstat (limited to 'Source/SPIndexesController.m')
-rw-r--r-- | Source/SPIndexesController.m | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 819a8bc2..1c0fe8db 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -231,11 +231,9 @@ /** * Performs various interface validation */ -- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +- (void)tableViewSelectionDidChange:(NSNotification *)notification { - id object = [aNotification object]; - - if (object == indexesTableView) { + if ([notification object] == indexesTableView) { // Check if there is currently an index selected and change button state accordingly [removeIndexButton setEnabled:([indexesTableView numberOfSelectedRows] > 0 && [tablesList tableType] == SPTableTypeTable)]; @@ -247,30 +245,12 @@ #pragma mark Text field delegate methods /** - * When an index other than a primary key is being added ensure there is a name specified. + * Only enable the add button if there is at least one indexed column. */ - (void)controlTextDidChange:(NSNotification *)notification -{ - // Only proceed if we are not adding a primary key - if ([indexTypePopUpButton indexOfSelectedItem] == 0) return; - - if ([notification object] == indexNameTextField) { - [addIndexButton setEnabled:(([[[indexNameTextField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0) && - ([[[indexedColumnsComboBox stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0))]; - } -} - -#pragma mark - -#pragma mark Combo box delegate methods - -/** - * Only enable the add button if there is an index name and at least one indexed column. - */ -- (void)comboBoxSelectionDidChange:(NSNotification *)notification -{ - if ([notification object] == indexedColumnsComboBox) { - [addIndexButton setEnabled:(([[[indexNameTextField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0) && - ([[[indexedColumnsComboBox stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0))]; +{ + if ([notification object] == indexedColumnsComboBox) { + [addIndexButton setEnabled:([[[indexedColumnsComboBox stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0)]; } } |