From 3b9f9e101c56130afcc9d83339c0bd01d1bbaa3c Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 17 Sep 2010 21:07:34 +0000 Subject: - When opening the add new sheet, ensure that the remove button is disabled when there is only one indexed field. - When cancelling adding a new index reset the indexed columns. --- Source/SPIndexesController.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 7302a4a5..80e8434c 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -161,6 +161,9 @@ NSString *SPNewIndexStorageType = @"IndexStorageType"; modalDelegate:self didEndSelector:@selector(addIndexSheetDidEnd:returnCode:contextInfo:) contextInfo:nil]; + + // Because there is only one indexed column initially, disable the remove button + [removeIndexedColumnButton setEnabled:NO]; } /** @@ -242,12 +245,19 @@ NSString *SPNewIndexStorageType = @"IndexStorageType"; [indexAdvancedOptionsView setHidden:YES]; [indexAdvancedOptionsViewButton setState:NSOffState]; + // Hide the size column [indexSizeTableColumn setHidden:YES]; + + // Reset the indexed columns + [indexedFields removeAllObjects]; + [indexedFields addObject:[[[fields objectAtIndex:0] copy] autorelease]]; [self _resizeWindowForAdvancedOptionsViewByHeightDelta:0]; [NSApp endSheet:[sender window] returnCode:[sender tag]]; [[sender window] orderOut:self]; + + [self _reloadIndexedColumnsTableData]; } /** -- cgit v1.2.3