diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPFieldMapperController.h | 4 | ||||
-rw-r--r-- | Source/SPFieldMapperController.m | 13 | ||||
-rw-r--r-- | Source/TableDump.m | 11 |
3 files changed, 19 insertions, 9 deletions
diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h index 19cf316a..6fc58c60 100644 --- a/Source/SPFieldMapperController.h +++ b/Source/SPFieldMapperController.h @@ -27,7 +27,7 @@ @interface SPFieldMapperController : NSWindowController { - IBOutlet id fieldMapperTableView; + IBOutlet NSTableView *fieldMapperTableView; IBOutlet id tableTargetPopup; IBOutlet NSPathControl *fileSourcePath; IBOutlet id importMethodPopup; @@ -68,7 +68,7 @@ - (id)initWithDelegate:(id)managerDelegate; - (void)setConnection:(MCPConnection *)theConnection; -- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader; +- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader isPreview:(BOOL)isPreview; // Getter methods - (NSString*)selectedTableTarget; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 8dc06d87..f7a2e068 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -119,10 +119,11 @@ [mySQLConnection retain]; } -- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader +- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader isPreview:(BOOL)isPreview { fieldMappingImportArray = theFieldMappingImportArray; importFieldNamesHeader = hasHeader; + fieldMappingImportArrayIsPreview = isPreview; } #pragma mark - @@ -327,8 +328,16 @@ && [fieldMappingTableColumnNames count]) { NSInteger i; NSNumber *globalValue = doImport; - if([fieldMappingOperatorArray objectAtIndex:0] == doImport) + if([fieldMappingOperatorArray objectAtIndex:0] == doImport) { globalValue = doNotImport; + // NSTextFieldCell *c = [[[NSTextFieldCell alloc] init] autorelease]; + // [c setStringValue:doNotImportString]; + // [aTableColumn setHeaderCell:c]; + } else { + // NSTextFieldCell *c = [[[NSTextFieldCell alloc] init] autorelease]; + // [c setStringValue:doImportString]; + // [aTableColumn setHeaderCell:c]; + } [fieldMappingOperatorArray removeAllObjects]; for(i=0; i < [fieldMappingTableColumnNames count]; i++) [fieldMappingOperatorArray addObject:globalValue]; diff --git a/Source/TableDump.m b/Source/TableDump.m index 33118738..9e42e105 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -1041,7 +1041,8 @@ [csvDataBuffer release]; [parsedRows release]; [parsePositions release]; - fieldMappingArray = nil; + if(fieldMappingArray) [fieldMappingArray release]; fieldMappingArray = nil; + if(fieldMapperOperator) [fieldMapperOperator release]; fieldMapperOperator = nil; [importPool drain]; [tableDocumentInstance setQueryMode:SPInterfaceQueryMode]; @@ -1157,7 +1158,7 @@ fieldMapperController = [[SPFieldMapperController alloc] initWithDelegate:self]; [fieldMapperController setConnection:mySQLConnection]; [fieldMapperController setSourcePath:filename]; - [fieldMapperController setImportDataArray:fieldMappingImportArray hasHeader:[importFieldNamesSwitch state]]; + [fieldMapperController setImportDataArray:fieldMappingImportArray hasHeader:[importFieldNamesSwitch state] isPreview:fieldMappingImportArrayIsPreview]; // Show field mapper sheet and set the focus to it [NSApp beginSheet:[fieldMapperController window] @@ -1173,8 +1174,8 @@ usleep(100000); // Get mapping settings - fieldMapperOperator = [NSArray arrayWithArray:[fieldMapperController fieldMapperOperator]]; - fieldMappingArray = [NSArray arrayWithArray:[fieldMapperController fieldMappingArray]]; + fieldMapperOperator = [[NSArray arrayWithArray:[fieldMapperController fieldMapperOperator]] retain]; + fieldMappingArray = [[NSArray arrayWithArray:[fieldMapperController fieldMappingArray]] retain]; selectedTableTarget = [NSString stringWithString:[fieldMapperController selectedTableTarget]]; selectedImportMethod = [NSString stringWithString:[fieldMapperController selectedImportMethod]]; fieldMappingTableColumnNames = [NSArray arrayWithArray:[fieldMapperController fieldMappingTableColumnNames]]; @@ -2811,7 +2812,7 @@ - (IBAction)cancelProgressBar:(id)sender { - progressCancelled = YES; + progressCancelled = YES; } - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar |