From bd69a9eccea56335422d13b8eddbd2aec79c839f Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 5 Feb 2010 20:09:53 +0000 Subject: =?UTF-8?q?=E2=80=A2=20some=20further=20work=20at=20the=20new=20fi?= =?UTF-8?q?eld=20mapper=20sheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/DataMigrationDialog.xib | 279 ++++++++++++----------- Source/SPFieldMapperController.h | 2 +- Source/SPFieldMapperController.m | 35 ++- Source/TableDump.h | 2 + Source/TableDump.m | 11 +- 5 files changed, 183 insertions(+), 146 deletions(-) diff --git a/Interfaces/English.lproj/DataMigrationDialog.xib b/Interfaces/English.lproj/DataMigrationDialog.xib index 6cd0376a..cf6b044b 100644 --- a/Interfaces/English.lproj/DataMigrationDialog.xib +++ b/Interfaces/English.lproj/DataMigrationDialog.xib @@ -12,7 +12,7 @@ YES - + YES @@ -44,7 +44,7 @@ {{262, 452}, {465, 311}} 1886912512 CSV Field Mapping - NSPanel + NSWindow View @@ -704,6 +704,9 @@ {465, 333} {3.40282e+38, 3.40282e+38} + + TableDump + @@ -813,28 +816,28 @@ 72 - - closeSheet: - - + + window + + - 74 + 76 closeSheet: - - + + - 75 + 83 - - window + + closeSheet: - + - 76 + 84 @@ -1203,6 +1206,12 @@ + + 80 + + + TableDump + @@ -1277,13 +1286,14 @@ 52.IBPluginDependency 56.IBPluginDependency 57.IBPluginDependency + 80.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin - {{173, 307}, {465, 311}} + {{139, 173}, {465, 311}} com.apple.InterfaceBuilder.CocoaPlugin - {{173, 307}, {465, 311}} + {{139, 173}, {465, 311}} {{387, 725}, {432, 282}} @@ -1348,6 +1358,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -1366,7 +1377,7 @@ - 76 + 84 @@ -1392,44 +1403,20 @@ Source/SPWindowAdditions.h + + + YES - TableDocument - NSDocument + SPFieldMapperController + NSWindowController YES YES - addDatabase: - analyzeTable: - cancelConnectSheet: - checkTable: - checksumTable: - chooseDatabase: - chooseEncoding: - chooseFavorite: - closeDatabaseSheet: + changeImportMethod: + changeTableTarget: closeSheet: - connect: - connectSheetAddToFavorites: - connectToDB: - copyCreateTableSyntax: - export: - exportMultipleTables: - exportTable: - flushPrivileges: - flushTable: - import: - optimizeTable: - removeDatabase: - removeFavorite: - repairTable: - setDatabases: - showCreateTableSyntax: - showVariables: - viewContent: - viewQuery: - viewStatus: - viewStructure: + stepRow: YES @@ -1437,6 +1424,23 @@ id id id + + + + YES + + YES + fieldMapperTableView + fileSourcePath + importMethodPopup + recordCountLabel + rowDownButton + rowUpButton + tableTargetPopup + theDelegate + + + YES id id id @@ -1445,14 +1449,34 @@ id id id - id - id - id - id - id - id - id - id + + + + IBDocumentRelativeSource + ../../Source/SPFieldMapperController.h + + + + TableDump + NSObject + + YES + + YES + cancelProgressBar: + changeFormat: + changeTable: + closeFieldMapperSheet: + closeSheet: + panelSelectionDidChange: + reloadTables: + selectTables: + stepRow: + switchInput: + switchTab: + + + YES id id id @@ -1470,61 +1494,76 @@ YES YES - addDatabaseButton - chooseDatabaseButton - connectFavoritesTableView - connectProgressBar - connectProgressStatusText - connectSheet - createTableSyntaxWindow + addCreateTableSwitch + addDropTableSwitch + addErrorsSwitch + addTableContentSwitch + csvFullStreamingSwitch customQueryInstance - databaseEncodingButton - databaseField - databaseNameField - databaseSheet - dbTablesTableView - favoritesButton - favoritesController - hostField - keyChainInstance - passwordField - portField - queryConsoleInstance - queryProgressBar - sidebarGrabber - socketField - spExportControllerInstance - syntaxView - syntaxViewContent + errorsSheet + errorsView + exportCSVView + exportDumpTableView + exportDumpView + exportFieldNamesSwitch + exportFieldsEnclosedField + exportFieldsEscapedField + exportFieldsTerminatedField + exportLinesTerminatedField + exportMultipleCSVTableView + exportMultipleCSVView + exportMultipleFieldNamesSwitch + exportMultipleFieldsEnclosedField + exportMultipleFieldsEscapedField + exportMultipleFieldsTerminatedField + exportMultipleLinesTerminatedField + exportMultipleXMLTableView + exportMultipleXMLView + exportTabBar + exportTableList + exportToolbar + exportWindow + fieldMappingPopup + fieldMappingSheet + fieldMappingTableView + importCSVBox + importCSVView + importFieldNamesSwitch + importFieldsEnclosedField + importFieldsEscapedField + importFieldsTerminatedField + importFormatPopup + importLinesTerminatedField + multiCSVFullStreamingSwitch + multiXMLFullStreamingSwitch + recordCountLabel + rowDownButton + rowUpButton + singleProgressBar + singleProgressSheet + singleProgressText + singleProgressTitle + sqlFullStreamingSwitch tableContentInstance tableDataInstance - tableDumpInstance + tableDocumentInstance tableSourceInstance - tableStatusInstance - tableTabView tableWindow tablesListInstance - userField - variablesSheet - variablesTableView YES id id - NSTableView id id id - NSWindow id id id id id - NSTableView id - NSArrayController id id id @@ -1541,55 +1580,27 @@ id id id - NSTabView id id id id id - - - - IBProjectSource - Source/TableDocument.h - - - - - YES - - SPFieldMapperController - NSWindowController - - YES - - YES - changeImportMethod: - changeTableTarget: - stepRow: - - - YES id id id - - - - YES - - YES - fieldMapperTableView - fileSourcePath - importMethodPopup - recordCountLabel - rowDownButton - rowUpButton - tableTargetPopup - theDelegate - - - YES + id + id + id + NSPopUpButton + id + id + id + id + id + id + id + id + id id id id @@ -1602,7 +1613,7 @@ IBDocumentRelativeSource - ../../Source/SPFieldMapperController.h + ../../Source/TableDump.h diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h index 21a34f0e..67dc381d 100644 --- a/Source/SPFieldMapperController.h +++ b/Source/SPFieldMapperController.h @@ -29,7 +29,6 @@ @interface SPFieldMapperController : NSWindowController { - IBOutlet id fieldMapperView; IBOutlet id fieldMapperTableView; IBOutlet id tableTargetPopup; IBOutlet id fileSourcePath; @@ -58,5 +57,6 @@ - (IBAction)changeTableTarget:(id)sender; - (IBAction)changeImportMethod:(id)sender; - (IBAction)stepRow:(id)sender; +- (IBAction)closeSheet:(id)sender; @end diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 70a4b049..92d0c935 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -37,7 +37,7 @@ */ - (id)initWithDelegate:(id)managerDelegate { - if ((self = [super initWithWindowNibName:@"DataMigrationDialog"])) { + if (self = [super initWithWindowNibName:@"DataMigrationDialog"]) { fieldMappingCurrentRow = 0; if(managerDelegate == nil) { @@ -46,17 +46,11 @@ return nil; } theDelegate = managerDelegate; - } return self; } -- (void)awakeFromNib -{ - -} - /* * Set the connection for use. * Called by the connect sheet methods. @@ -76,6 +70,11 @@ #pragma mark - #pragma mark IBAction methods +- (IBAction)closeSheet:(id)sender +{ + [NSApp endSheet:[self window] returnCode:[sender tag]]; +} + - (IBAction)changeTableTarget:(id)sender { @@ -131,5 +130,27 @@ [rowUpButton setEnabled:(fieldMappingCurrentRow != ([fieldMappingImportArray count]-1))]; } +#pragma mark - +#pragma mark Table view datasource methods + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; +{ + return 0; +} + +- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +{ + +} + +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +{ + return nil; +} + +- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +{ +} + @end diff --git a/Source/TableDump.h b/Source/TableDump.h index ebc686b2..644057b6 100644 --- a/Source/TableDump.h +++ b/Source/TableDump.h @@ -25,6 +25,7 @@ // Or mail to #import +#import "SPFieldMapperController.h" #import typedef enum _SPExportModes { @@ -115,6 +116,7 @@ typedef enum _SPExportModes { BOOL progressCancelled; NSInteger fieldMapperSheetStatus; + SPFieldMapperController *fieldMapperController; } // IBAction methods diff --git a/Source/TableDump.m b/Source/TableDump.m index c835b526..04942462 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -38,6 +38,7 @@ #import "RegexKitLite.h" #import "SPConstants.h" #import "SPAlertSheets.h" +#import "SPFieldMapperController.h" @implementation TableDump @@ -109,11 +110,7 @@ - (IBAction)closeFieldMapperSheet:(id)sender { - [NSApp endSheet:fieldMappingSheet returnCode:[sender tag]]; - // [[self window] orderOut:self]; - // - // [NSApp endSheet:fieldMappingSheet]; } /** @@ -1216,7 +1213,11 @@ fieldMapperSheetStatus = 1; + // if(fieldMapperController) [fieldMapperController release]; + // fieldMapperController = [[SPFieldMapperController alloc] initWithDelegate:self]; + // Show fieldMapping sheet + // [NSApp beginSheet:[fieldMapperController window] [NSApp beginSheet:fieldMappingSheet modalForWindow:tableWindow modalDelegate:self @@ -1227,6 +1228,8 @@ while (fieldMapperSheetStatus == 1) usleep(100000); + // if(fieldMapperController) [fieldMapperController release]; + if(fieldMapperSheetStatus == 2) return YES; else -- cgit v1.2.3