From e4afd6305a2e4a5f57987c4aa7938d2ba20f5676 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 10 Jun 2012 09:25:14 +0000 Subject: Add the default encoding and storage engine to the default menu items on the new table sheet. Implements issue #1245. --- Source/SPTablesList.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/SPTablesList.m') diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 844505a8..cfb367e9 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -388,7 +388,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; NSArray *engines = [databaseDataInstance getDatabaseStorageEngines]; // Add default menu item - [tableTypeButton addItemWithTitle:NSLocalizedString(@"Default",@"New Table Sheet : Table Engine Dropdown : Default")]; + [tableTypeButton addItemWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Default (%@)", @"New Table Sheet : Table Engine Dropdown : Default"), [databaseDataInstance getDatabaseDefaultStorageEngine]]]; [[tableTypeButton menu] addItem:[NSMenuItem separatorItem]]; for (NSDictionary *engine in engines) @@ -398,7 +398,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // Populate the table encoding popup button with a default menu item [tableEncodingButton removeAllItems]; - [tableEncodingButton addItemWithTitle:NSLocalizedString(@"Default",@"New Table Sheet : Table Encoding Dropdown : Default")]; + [tableEncodingButton addItemWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Default (%@)", @"New Table Sheet : Table Encoding Dropdown : Default"), [tableDocumentInstance databaseEncoding]]]; // Retrieve the server-supported encodings and add them to the menu NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings]; @@ -413,6 +413,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; for (NSDictionary *encoding in encodings) { NSString *menuItemTitle = (![encoding objectForKey:@"DESCRIPTION"]) ? [encoding objectForKey:@"CHARACTER_SET_NAME"] : [NSString stringWithFormat:@"%@ (%@)", [encoding objectForKey:@"DESCRIPTION"], [encoding objectForKey:@"CHARACTER_SET_NAME"]]; + [tableEncodingButton addItemWithTitle:menuItemTitle]; // If the UTF8 entry has been encountered, store the menu title -- cgit v1.2.3