aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-16 13:24:04 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-16 13:24:04 +0000
commit1d5c422881b6ad63266bd5875c3472d6b5f84a5f (patch)
treec6930f7864b38b1b21f629b05ac0f7c8eabf5f2b /Source
parent22ae0fa8c302d22071116abca27d2add3a0af991 (diff)
downloadsequelpro-1d5c422881b6ad63266bd5875c3472d6b5f84a5f.tar.gz
sequelpro-1d5c422881b6ad63266bd5875c3472d6b5f84a5f.tar.bz2
sequelpro-1d5c422881b6ad63266bd5875c3472d6b5f84a5f.zip
• field mapper controller
- fixed precocious releasing of mapper settings - fixed boolean binding for displaying "1 of first 100 records" - added further gui elements (not yet activated) - sheet dimensions are now auto-saved - bound keystroke ⇢ and ⇠ to row stepper - renamed some stuff - added clarification notes
Diffstat (limited to 'Source')
-rw-r--r--Source/SPFieldMapperController.h4
-rw-r--r--Source/SPFieldMapperController.m13
-rw-r--r--Source/TableDump.m11
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