aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-05 20:09:53 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-05 20:09:53 +0000
commitbd69a9eccea56335422d13b8eddbd2aec79c839f (patch)
tree867a026df5833fd4b67c086c05071ac70995ba91
parent543e9593ff7878af9836df11c3eee3f6fce7101e (diff)
downloadsequelpro-bd69a9eccea56335422d13b8eddbd2aec79c839f.tar.gz
sequelpro-bd69a9eccea56335422d13b8eddbd2aec79c839f.tar.bz2
sequelpro-bd69a9eccea56335422d13b8eddbd2aec79c839f.zip
• some further work at the new field mapper sheet
-rw-r--r--Interfaces/English.lproj/DataMigrationDialog.xib279
-rw-r--r--Source/SPFieldMapperController.h2
-rw-r--r--Source/SPFieldMapperController.m35
-rw-r--r--Source/TableDump.h2
-rw-r--r--Source/TableDump.m11
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 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="11"/>
+ <integer value="12"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -44,7 +44,7 @@
<string key="NSWindowRect">{{262, 452}, {465, 311}}</string>
<int key="NSWTFlags">1886912512</int>
<string key="NSWindowTitle">CSV Field Mapping</string>
- <string key="NSWindowClass">NSPanel</string>
+ <string key="NSWindowClass">NSWindow</string>
<object class="NSMutableString" key="NSViewClass">
<characters key="NS.bytes">View</characters>
</object>
@@ -704,6 +704,9 @@
<string key="NSMinSize">{465, 333}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
+ <object class="NSCustomObject" id="914102730">
+ <string key="NSClassName">TableDump</string>
+ </object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -813,28 +816,28 @@
<int key="connectionID">72</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">closeSheet:</string>
- <reference key="source" ref="1003"/>
- <reference key="destination" ref="341819846"/>
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="420604405"/>
</object>
- <int key="connectionID">74</int>
+ <int key="connectionID">76</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">closeSheet:</string>
- <reference key="source" ref="1003"/>
- <reference key="destination" ref="920273776"/>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="341819846"/>
</object>
- <int key="connectionID">75</int>
+ <int key="connectionID">83</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">window</string>
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closeSheet:</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="420604405"/>
+ <reference key="destination" ref="920273776"/>
</object>
- <int key="connectionID">76</int>
+ <int key="connectionID">84</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -1203,6 +1206,12 @@
<reference key="object" ref="922239869"/>
<reference key="parent" ref="1052916804"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">80</int>
+ <reference key="object" ref="914102730"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">TableDump</string>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -1277,13 +1286,14 @@
<string>52.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>57.IBPluginDependency</string>
+ <string>80.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{173, 307}, {465, 311}}</string>
+ <string>{{139, 173}, {465, 311}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{173, 307}, {465, 311}}</string>
+ <string>{{139, 173}, {465, 311}}</string>
<integer value="1"/>
<string>{{387, 725}, {432, 282}}</string>
<integer value="0"/>
@@ -1348,6 +1358,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -1366,7 +1377,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">76</int>
+ <int key="maxID">84</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1392,44 +1403,20 @@
<string key="minorKey">Source/SPWindowAdditions.h</string>
</object>
</object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">TableDocument</string>
- <string key="superclassName">NSDocument</string>
+ <string key="className">SPFieldMapperController</string>
+ <string key="superclassName">NSWindowController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>addDatabase:</string>
- <string>analyzeTable:</string>
- <string>cancelConnectSheet:</string>
- <string>checkTable:</string>
- <string>checksumTable:</string>
- <string>chooseDatabase:</string>
- <string>chooseEncoding:</string>
- <string>chooseFavorite:</string>
- <string>closeDatabaseSheet:</string>
+ <string>changeImportMethod:</string>
+ <string>changeTableTarget:</string>
<string>closeSheet:</string>
- <string>connect:</string>
- <string>connectSheetAddToFavorites:</string>
- <string>connectToDB:</string>
- <string>copyCreateTableSyntax:</string>
- <string>export:</string>
- <string>exportMultipleTables:</string>
- <string>exportTable:</string>
- <string>flushPrivileges:</string>
- <string>flushTable:</string>
- <string>import:</string>
- <string>optimizeTable:</string>
- <string>removeDatabase:</string>
- <string>removeFavorite:</string>
- <string>repairTable:</string>
- <string>setDatabases:</string>
- <string>showCreateTableSyntax:</string>
- <string>showVariables:</string>
- <string>viewContent:</string>
- <string>viewQuery:</string>
- <string>viewStatus:</string>
- <string>viewStructure:</string>
+ <string>stepRow:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1437,6 +1424,23 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>fieldMapperTableView</string>
+ <string>fileSourcePath</string>
+ <string>importMethodPopup</string>
+ <string>recordCountLabel</string>
+ <string>rowDownButton</string>
+ <string>rowUpButton</string>
+ <string>tableTargetPopup</string>
+ <string>theDelegate</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
@@ -1445,14 +1449,34 @@
<string>id</string>
<string>id</string>
<string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBDocumentRelativeSource</string>
+ <string key="minorKey">../../Source/SPFieldMapperController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">TableDump</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancelProgressBar:</string>
+ <string>changeFormat:</string>
+ <string>changeTable:</string>
+ <string>closeFieldMapperSheet:</string>
+ <string>closeSheet:</string>
+ <string>panelSelectionDidChange:</string>
+ <string>reloadTables:</string>
+ <string>selectTables:</string>
+ <string>stepRow:</string>
+ <string>switchInput:</string>
+ <string>switchTab:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
@@ -1470,61 +1494,76 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>addDatabaseButton</string>
- <string>chooseDatabaseButton</string>
- <string>connectFavoritesTableView</string>
- <string>connectProgressBar</string>
- <string>connectProgressStatusText</string>
- <string>connectSheet</string>
- <string>createTableSyntaxWindow</string>
+ <string>addCreateTableSwitch</string>
+ <string>addDropTableSwitch</string>
+ <string>addErrorsSwitch</string>
+ <string>addTableContentSwitch</string>
+ <string>csvFullStreamingSwitch</string>
<string>customQueryInstance</string>
- <string>databaseEncodingButton</string>
- <string>databaseField</string>
- <string>databaseNameField</string>
- <string>databaseSheet</string>
- <string>dbTablesTableView</string>
- <string>favoritesButton</string>
- <string>favoritesController</string>
- <string>hostField</string>
- <string>keyChainInstance</string>
- <string>passwordField</string>
- <string>portField</string>
- <string>queryConsoleInstance</string>
- <string>queryProgressBar</string>
- <string>sidebarGrabber</string>
- <string>socketField</string>
- <string>spExportControllerInstance</string>
- <string>syntaxView</string>
- <string>syntaxViewContent</string>
+ <string>errorsSheet</string>
+ <string>errorsView</string>
+ <string>exportCSVView</string>
+ <string>exportDumpTableView</string>
+ <string>exportDumpView</string>
+ <string>exportFieldNamesSwitch</string>
+ <string>exportFieldsEnclosedField</string>
+ <string>exportFieldsEscapedField</string>
+ <string>exportFieldsTerminatedField</string>
+ <string>exportLinesTerminatedField</string>
+ <string>exportMultipleCSVTableView</string>
+ <string>exportMultipleCSVView</string>
+ <string>exportMultipleFieldNamesSwitch</string>
+ <string>exportMultipleFieldsEnclosedField</string>
+ <string>exportMultipleFieldsEscapedField</string>
+ <string>exportMultipleFieldsTerminatedField</string>
+ <string>exportMultipleLinesTerminatedField</string>
+ <string>exportMultipleXMLTableView</string>
+ <string>exportMultipleXMLView</string>
+ <string>exportTabBar</string>
+ <string>exportTableList</string>
+ <string>exportToolbar</string>
+ <string>exportWindow</string>
+ <string>fieldMappingPopup</string>
+ <string>fieldMappingSheet</string>
+ <string>fieldMappingTableView</string>
+ <string>importCSVBox</string>
+ <string>importCSVView</string>
+ <string>importFieldNamesSwitch</string>
+ <string>importFieldsEnclosedField</string>
+ <string>importFieldsEscapedField</string>
+ <string>importFieldsTerminatedField</string>
+ <string>importFormatPopup</string>
+ <string>importLinesTerminatedField</string>
+ <string>multiCSVFullStreamingSwitch</string>
+ <string>multiXMLFullStreamingSwitch</string>
+ <string>recordCountLabel</string>
+ <string>rowDownButton</string>
+ <string>rowUpButton</string>
+ <string>singleProgressBar</string>
+ <string>singleProgressSheet</string>
+ <string>singleProgressText</string>
+ <string>singleProgressTitle</string>
+ <string>sqlFullStreamingSwitch</string>
<string>tableContentInstance</string>
<string>tableDataInstance</string>
- <string>tableDumpInstance</string>
+ <string>tableDocumentInstance</string>
<string>tableSourceInstance</string>
- <string>tableStatusInstance</string>
- <string>tableTabView</string>
<string>tableWindow</string>
<string>tablesListInstance</string>
- <string>userField</string>
- <string>variablesSheet</string>
- <string>variablesTableView</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
- <string>NSTableView</string>
<string>id</string>
<string>id</string>
<string>id</string>
- <string>NSWindow</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
- <string>NSTableView</string>
<string>id</string>
- <string>NSArrayController</string>
<string>id</string>
<string>id</string>
<string>id</string>
@@ -1541,55 +1580,27 @@
<string>id</string>
<string>id</string>
<string>id</string>
- <string>NSTabView</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Source/TableDocument.h</string>
- </object>
- </object>
- </object>
- <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">SPFieldMapperController</string>
- <string key="superclassName">NSWindowController</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>changeImportMethod:</string>
- <string>changeTableTarget:</string>
- <string>stepRow:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>fieldMapperTableView</string>
- <string>fileSourcePath</string>
- <string>importMethodPopup</string>
- <string>recordCountLabel</string>
- <string>rowDownButton</string>
- <string>rowUpButton</string>
- <string>tableTargetPopup</string>
- <string>theDelegate</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>NSPopUpButton</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
@@ -1602,7 +1613,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBDocumentRelativeSource</string>
- <string key="minorKey">../../Source/SPFieldMapperController.h</string>
+ <string key="minorKey">../../Source/TableDump.h</string>
</object>
</object>
</object>
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 <lorenz@textor.ch>
#import <Cocoa/Cocoa.h>
+#import "SPFieldMapperController.h"
#import <MCPKit/MCPKit.h>
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