From 0f686109377b858a3a22987727f71d9f92ac3410 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sun, 14 Mar 2010 16:19:03 +0000 Subject: =?UTF-8?q?=E2=80=A2=20CSV=20Import=20Field=20Mapper=20-=20added?= =?UTF-8?q?=20to=20table=20target=20popup=20menu=20"Refresh=20List"=20menu?= =?UTF-8?q?=20item,=20since=20the=20user=20can=20add/change=20a=20=20table?= =?UTF-8?q?=20in=20an=20other=20connection=20window?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPFieldMapperController.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index a33d6300..9483161b 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -90,6 +90,8 @@ [tableTargetPopup removeAllItems]; if([[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]) { [tableTargetPopup addItemsWithTitles:[[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]]; + [[tableTargetPopup menu] addItem:[NSMenuItem separatorItem]]; + [tableTargetPopup addItemWithTitle:NSLocalizedString(@"Refresh List", @"refresh list menu item")]; // Select either the currently selected table, or the first item in the list if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil && ![[[theDelegate valueForKeyPath:@"tablesListInstance"] tableName] isEqualToString:@""]) { @@ -275,6 +277,19 @@ - (IBAction)changeTableTarget:(id)sender { + // Is Refresh List chosen? + if([tableTargetPopup selectedItem] == [tableTargetPopup lastItem]) { + [tableTargetPopup removeAllItems]; + // Update tables list + [[theDelegate valueForKeyPath:@"tablesListInstance"] updateTables:nil]; + if([[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]) { + [tableTargetPopup addItemsWithTitles:[[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]]; + [[tableTargetPopup menu] addItem:[NSMenuItem separatorItem]]; + [tableTargetPopup addItemWithTitle:NSLocalizedString(@"Refresh List", @"refresh list menu item")]; + } + return; + } + NSInteger i; // Remove all the current columns -- cgit v1.2.3