From 22ae0fa8c302d22071116abca27d2add3a0af991 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 16 Feb 2010 11:23:45 +0000 Subject: =?UTF-8?q?=E2=80=A2=20re-factored=20and=20outsourced=20the=20enti?= =?UTF-8?q?re=20CSV=20import=20field=20mapper=20sheet=20-=20changed=20the?= =?UTF-8?q?=20way=20to=20choose=20whether=20a=20source=20field=20should=20?= =?UTF-8?q?be=20imported=20or=20not=20by=20introducing=20a=20new=20table?= =?UTF-8?q?=20column=20'operators'=20-=20clicking=20at=20the=20'operator's?= =?UTF-8?q?=20header=20toggles=20all=20operators=20to=20'Import'=20or=20'D?= =?UTF-8?q?o=20not=20import'=20-=20added=20tooltips=20for=20each=20table?= =?UTF-8?q?=20cell;=20if=20file's=20first=20line=20are=20the=20headers=20s?= =?UTF-8?q?how=20them=20in=20the=20tooltips=20as=20well=20-=20added=20chec?= =?UTF-8?q?kbox=20"First=20line=20contains=20fields=20names"=20since=20it'?= =?UTF-8?q?ll=20be=20clear=20in=20this=20pane=20whether=20a=20file=20has?= =?UTF-8?q?=20a=20header=20line=20or=20not=20(will=20be=20sync=20with=20pr?= =?UTF-8?q?efs)=20-=20added=20the=20possibility=20to=20choose=20the=20impo?= =?UTF-8?q?rt=20method:=20INSERT=20INTO=20or=20REPLACE=20INTO=20=E2=80=A2?= =?UTF-8?q?=20deleted=20all=20old=20field=20mapper=20stuff=20from=20TableD?= =?UTF-8?q?ump=20and=20DBView.xib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notes: - tests are needed to be sure that this change does not cause mismatches while importing - symbols for Do (not) import are tendative - maybe use images - a further import method UPDATE plus an operator '=' will be added soon - chance to add a new global source variable will come soon - displaying of source field types will come soon - semi-automatically matching of source field names and header names will come soon - the GUI needs some improvements afterwards --- Source/SPFieldMapperController.h | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'Source/SPFieldMapperController.h') diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h index d48585e0..19cf316a 100644 --- a/Source/SPFieldMapperController.h +++ b/Source/SPFieldMapperController.h @@ -1,7 +1,7 @@ // // $Id$ // -// SPQueryFavoriteManager.h +// SPFieldMapperController.h // sequel-pro // // Created by Hans-Jörg Bibiko on February 01, 2010 @@ -25,8 +25,6 @@ #import #import - - @interface SPFieldMapperController : NSWindowController { IBOutlet id fieldMapperTableView; @@ -36,19 +34,33 @@ IBOutlet id rowUpButton; IBOutlet id rowDownButton; IBOutlet id recordCountLabel; + IBOutlet id importFieldNamesHeaderSwitch; id theDelegate; + id fieldMappingImportArray; NSInteger fieldMappingCurrentRow; - NSArray *fieldMappingImportArray; - NSArray *fieldMappingArray; + NSMutableArray *fieldMappingArray; NSMutableArray *fieldMappingTableColumnNames; + NSMutableArray *fieldMappingButtonOptions; + NSMutableArray *fieldMappingOperatorOptions; + NSMutableArray *fieldMappingOperatorArray; + + NSNumber *doImport; + NSNumber *doNotImport; + NSNumber *isEqual; + NSString *doImportString; + NSString *doNotImportString; + NSString *isEqualString; BOOL fieldMappingImportArrayIsPreview; + BOOL importFieldNamesHeader; MCPConnection *mySQLConnection; NSString *sourcePath; + + NSUserDefaults *prefs; } @property(retain) NSString* sourcePath; @@ -56,6 +68,15 @@ - (id)initWithDelegate:(id)managerDelegate; - (void)setConnection:(MCPConnection *)theConnection; +- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader; + +// Getter methods +- (NSString*)selectedTableTarget; +- (NSArray*)fieldMapperOperator; +- (NSString*)selectedImportMethod; +- (NSArray*)fieldMappingArray; +- (NSArray*)fieldMappingTableColumnNames; +- (BOOL)importFieldNamesHeader; // IBAction methods - (IBAction)changeTableTarget:(id)sender; @@ -63,4 +84,9 @@ - (IBAction)stepRow:(id)sender; - (IBAction)closeSheet:(id)sender; +// Others +- (void)setupFieldMappingArray; +- (void)updateFieldMappingButtonCell; +- (void)updateFieldMappingOperatorOptions; + @end -- cgit v1.2.3