diff options
author | stuconnolly <stuart02@gmail.com> | 2011-02-01 20:05:16 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-02-01 20:05:16 +0000 |
commit | f1f5e84d38e29f2258aa958f55382ef70085843b (patch) | |
tree | f0cc9213a936b3ed2cfade91d641a93a22c0ca17 /Source/SPTableContent.m | |
parent | 83ce97aca74326ea431add878ccf7f4252aca9a6 (diff) | |
download | sequelpro-f1f5e84d38e29f2258aa958f55382ef70085843b.tar.gz sequelpro-f1f5e84d38e29f2258aa958f55382ef70085843b.tar.bz2 sequelpro-f1f5e84d38e29f2258aa958f55382ef70085843b.zip |
Bring outline view branch up to date with trunk (r3165:r3177).
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r-- | Source/SPTableContent.m | 34 |
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]]; } |