aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldMapperController.h
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-16 11:23:45 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-16 11:23:45 +0000
commit22ae0fa8c302d22071116abca27d2add3a0af991 (patch)
tree0110aebd405f15296badd823157eaac500e6a18d /Source/SPFieldMapperController.h
parentc64877be105019508234b9ee867d710de3b8160c (diff)
downloadsequelpro-22ae0fa8c302d22071116abca27d2add3a0af991.tar.gz
sequelpro-22ae0fa8c302d22071116abca27d2add3a0af991.tar.bz2
sequelpro-22ae0fa8c302d22071116abca27d2add3a0af991.zip
• re-factored and outsourced the entire CSV import field mapper sheet
- changed the way to choose whether a source field should be imported or not by introducing a new table column 'operators' - clicking at the 'operator's header toggles all operators to 'Import' or 'Do not import' - added tooltips for each table cell; if file's first line are the headers show them in the tooltips as well - added checkbox "First line contains fields names" since it'll be clear in this pane whether a file has a header line or not (will be sync with prefs) - added the possibility to choose the import method: INSERT INTO or REPLACE INTO • deleted all old field mapper stuff from TableDump and DBView.xib 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
Diffstat (limited to 'Source/SPFieldMapperController.h')
-rw-r--r--Source/SPFieldMapperController.h36
1 files changed, 31 insertions, 5 deletions
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 <Cocoa/Cocoa.h>
#import <MCPKit/MCPKit.h>
-
-
@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