From f1f5e84d38e29f2258aa958f55382ef70085843b Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 1 Feb 2011 20:05:16 +0000 Subject: Bring outline view branch up to date with trunk (r3165:r3177). --- Source/SPTableContent.m | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'Source/SPTableContent.m') diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index b136d90a..7acc0187 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -244,14 +244,14 @@ // Scroll the viewport to the saved location selectionViewportToRestore.size = [tableContentView visibleRect].size; - [tableContentView scrollRectToVisible:selectionViewportToRestore]; + [[tableContentView onMainThread] scrollRectToVisible:selectionViewportToRestore]; } // Restore selection indexes if appropriate if (selectionIndexToRestore) { BOOL previousTableRowsSelectable = tableRowsSelectable; tableRowsSelectable = YES; - [tableContentView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO]; + [[tableContentView onMainThread] selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO]; tableRowsSelectable = previousTableRowsSelectable; } @@ -758,7 +758,7 @@ [self updateCountText]; // Update pagination - [self updatePaginationState]; + [[self onMainThread] updatePaginationState]; // Retrieve and cache the column definitions for editing views if (cqColumnDefinition) [cqColumnDefinition release]; @@ -784,7 +784,7 @@ } else { // Trigger a full reload if required if (fullTableReloadRequired) [self reloadTable:self]; - [filterTableWindow setTitle:NSLocalizedString(@"Filter", @"filter label")]; + [[filterTableWindow onMainThread] setTitle:NSLocalizedString(@"Filter", @"filter label")]; } } @@ -1467,6 +1467,7 @@ /** * Update the state of the pagination buttons and text. + * This function is not thread-safe and should be called on the main thread. */ - (void) updatePaginationState { @@ -2062,6 +2063,28 @@ [tempRow addObject:NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")]; else if([o isKindOfClass:[NSString class]]) [tempRow addObject:[o description]]; + else if([o isKindOfClass:[MCPGeometryData class]]) { + SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[o coordinates]]; + NSImage *image = [v thumbnailImage]; + NSString *imageStr = @""; + if(image) { + NSString *maxSizeValue = @"WIDTH"; + NSInteger imageWidth = [image size].width; + NSInteger imageHeight = [image size].height; + if(imageHeight > imageWidth) { + maxSizeValue = @"HEIGHT"; + imageWidth = imageHeight; + } + if (imageWidth > 100) imageWidth = 100; + imageStr = [NSString stringWithFormat: + @"
", + maxSizeValue, + (long)imageWidth, + [[image TIFFRepresentationUsingCompression:NSTIFFCompressionJPEG factor:0.01] base64EncodingWithLineLength:0]]; + } + [v release]; + [tempRow addObject:[NSString stringWithFormat:@"%@%@", [o wktString], imageStr]]; + } else { NSImage *image = [[NSImage alloc] initWithData:o]; if (image) { @@ -2476,8 +2499,7 @@ for (i = 0; i < [rowFieldsToSave count]; i++) { if (i) [queryString appendString:@", "]; [queryString appendFormat:@"%@ = %@", - [NSArrayObjectAtIndex(rowFieldsToSave, i) backtickQuotedString], - NSArrayObjectAtIndex(rowValuesToSave, i)]; + [NSArrayObjectAtIndex(rowFieldsToSave, i) backtickQuotedString], NSArrayObjectAtIndex(rowValuesToSave, i)]; } [queryString appendFormat:@" WHERE %@", [self argumentForRow:-2]]; } -- cgit v1.2.3