aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDump.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-17 10:40:21 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-17 10:40:21 +0000
commitdc01911fd5987bb4a3213b2c6637326d9dd8c94d (patch)
tree47107a0f02a5320701e48e64ed684761b43c143d /Source/TableDump.m
parent72c4522db57b9699e1dc324f62dbeb036405f2c6 (diff)
downloadsequelpro-dc01911fd5987bb4a3213b2c6637326d9dd8c94d.tar.gz
sequelpro-dc01911fd5987bb4a3213b2c6637326d9dd8c94d.tar.bz2
sequelpro-dc01911fd5987bb4a3213b2c6637326d9dd8c94d.zip
• csv file import mapper
- added button "Go Back" ⌥← to go back to the file chooser (mainly for correcting delimiter etc.) - improved selecting csv file columns for the case that column was set as 'Do not import'; now if set to 'Do not import' the value is hidden, click the user on it the popup menu appears and the operator is set to 'Do import' automatically • TableDump now remembers the last chosen csv file name
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r--Source/TableDump.m14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 9e42e105..4854aad3 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -496,7 +496,7 @@
// Show openPanel
[openPanel beginSheetForDirectory:[prefs objectForKey:@"openPath"]
- file:nil
+ file:[lastFilename lastPathComponent]
modalForWindow:tableWindow
modalDelegate:self
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
@@ -1089,8 +1089,16 @@
// Reset progress cancelled from any previous runs
progressCancelled = NO;
+ if(lastFilename) [lastFilename release]; lastFilename = nil;
+ lastFilename = [[NSString stringWithString:[sheet filename]] retain];
+
+ if(lastFilename == nil || ![lastFilename length]) {
+ NSBeep();
+ return;
+ }
+
// begin import process
- [NSThread detachNewThreadSelector:@selector(importBackgroundProcess:) toTarget:self withObject:[sheet filename]];
+ [NSThread detachNewThreadSelector:@selector(importBackgroundProcess:) toTarget:self withObject:lastFilename];
}
- (void)startSQLImportProcessWithFile:(NSString *)filename
@@ -2797,6 +2805,7 @@
fieldMappingImportArray = nil;
fieldMappingImportArrayIsPreview = NO;
prefs = nil;
+ lastFilename = nil;
return self;
}
@@ -2805,6 +2814,7 @@
{
[tables release];
if (fieldMappingImportArray) [fieldMappingImportArray release];
+ if (lastFilename) [lastFilename release];
if (prefs) [prefs release];
[super dealloc];