From dc01911fd5987bb4a3213b2c6637326d9dd8c94d Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 17 Feb 2010 10:40:21 +0000 Subject: =?UTF-8?q?=E2=80=A2=20csv=20file=20import=20mapper=20-=20added=20?= =?UTF-8?q?button=20"Go=20Back"=20=E2=8C=A5=E2=86=90=20to=20go=20back=20to?= =?UTF-8?q?=20the=20file=20chooser=20(mainly=20for=20correcting=20delimite?= =?UTF-8?q?r=20etc.)=20-=20improved=20selecting=20csv=20file=20columns=20f?= =?UTF-8?q?or=20the=20case=20that=20column=20was=20set=20as=20'Do=20not=20?= =?UTF-8?q?import';=20now=20if=20set=20to=20'Do=20not=20import'=20the=20va?= =?UTF-8?q?lue=20is=20hidden,=20click=20the=20user=20on=20it=20the=20popup?= =?UTF-8?q?=20menu=20appears=20and=20the=20operator=20is=20set=20to=20'Do?= =?UTF-8?q?=20import'=20automatically=20=E2=80=A2=20TableDump=20now=20reme?= =?UTF-8?q?mbers=20the=20last=20chosen=20csv=20file=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableDump.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Source/TableDump.m') 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]; -- cgit v1.2.3