diff options
author | stuconnolly <stuart02@gmail.com> | 2010-09-17 20:54:33 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-09-17 20:54:33 +0000 |
commit | 78a2c32e9d163a558be1d221770587639a92fd6e (patch) | |
tree | ef1cab603282f48167853980d8f6a653e2fcc245 | |
parent | 6770f1b6d9aa0f677daf73daa51e5c2da27ba86f (diff) | |
download | sequelpro-78a2c32e9d163a558be1d221770587639a92fd6e.tar.gz sequelpro-78a2c32e9d163a558be1d221770587639a92fd6e.tar.bz2 sequelpro-78a2c32e9d163a558be1d221770587639a92fd6e.zip |
- Fix a UI validation bug when adding an additional indexed field with a length specified and the advanced view open.
- Fix an exception when adding the same indexed field when creating a new index.
Both found by Max. Thanks Max!
-rw-r--r-- | Source/SPIndexesController.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index ddd80354..7302a4a5 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -320,7 +320,7 @@ NSString *SPNewIndexStorageType = @"IndexStorageType"; { [[indexedFields objectAtIndex:rowIndex] setObject:object forKey:[tableColumn identifier]]; - if ([[tableColumn identifier] isEqualToString:@"name"]) { + if ([[tableColumn identifier] isEqualToString:@"name"] && [object isKindOfClass:[NSDictionary class]]) { // If the field type is foud within the requires length array then a length prefix is required so // display the size column. if ([requiresLength containsObject:[[object objectForKey:@"type"] uppercaseString]]) [indexSizeTableColumn setHidden:NO]; @@ -560,7 +560,9 @@ NSString *SPNewIndexStorageType = @"IndexStorageType"; if ([requiresLength containsObject:[[field objectForKey:@"type"] uppercaseString]]) c++; } - [indexSizeTableColumn setHidden:(!c)]; + // Only toggle the sizes column if the advanced view is hidden + if (!showAdvancedView) [indexSizeTableColumn setHidden:(!c)]; + [confirmAddIndexButton setEnabled:(!c)]; [indexedColumnsTableView reloadData]; |