aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m34
1 files changed, 28 insertions, 6 deletions
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:
+ @"<BR><IMG %@='%ld' SRC=\"data:image/auto;base64,%@\">",
+ 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]];
}