From 17309b1f8bc10f674941b0a375ecc0cc8a189945 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Mon, 4 Jul 2011 18:44:34 +0000 Subject: Fixes for issue #1098: - Fix logic for enabling/disabling the index storage type popup button when changing the index type. - Add a number formatter to the index length field. --- Source/SPIndexesController.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/SPIndexesController.m') diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index f045c9b3..8058ff3f 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -150,13 +150,12 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; */ - (IBAction)addIndex:(id)sender { - // Check whether table editing is permitted (necessary as some actions - eg table double-click - bypass validation) if ([dbDocument isWorking] || [tablesList tableType] != SPTableTypeTable) return; // Check whether a save of the current field row is required. if (![tableStructure saveRowOnDeselect]) return; - + // Reset visibility of the primary key item [[[indexTypePopUpButton menu] itemWithTag:SPPrimaryKeyMenuTag] setHidden:NO]; @@ -340,8 +339,10 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; } #ifndef SP_REFACTOR + NSString *engine = [[tableData statusValues] objectForKey:@"Engine"]; + // Specifiying an index storage type (i.e. HASH or BTREE) is not permitted with SPATIAL indexes - [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag)]; + [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !([engine isEqualToString:@"MyISAM"] || [engine isEqualToString:@"InnoDB"])]; #endif } } -- cgit v1.2.3