diff options
-rw-r--r-- | Source/SPFieldMapperController.m | 15 |
1 files changed, 15 insertions, 0 deletions
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 |