From 42aa1c06dd802bfadc0f77f6b5a05f7f6fa2c067 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 9 Sep 2009 21:00:41 +0000 Subject: [Author: thomasvl] Support the toolbar item's view in state logging. Add table columns to ui localizer (tests will come in a following cl). Add a toolbar item that doesn't localize to help catch bugs in the future like we had on first impl. Add a tooltip to the toolbar item in the unittest for ui localizer. Add a note about the limits to ui localizer and toolbars due to the NSToolbar api's limits. R=dmaclach DELTA=746 (90 added, 599 deleted, 57 changed) --- AppKit/GTMUILocalizer.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'AppKit/GTMUILocalizer.m') diff --git a/AppKit/GTMUILocalizer.m b/AppKit/GTMUILocalizer.m index efdfb92..72c0b9d 100644 --- a/AppKit/GTMUILocalizer.m +++ b/AppKit/GTMUILocalizer.m @@ -119,6 +119,9 @@ } - (void)localizeToolbar:(NSToolbar *)toolbar { + // NOTE: Like the header says, -items only gives us what is in the toolbar + // which is usually the default items, if the toolbar supports customization + // there is no way to fetch those possible items to tweak their contents. NSToolbarItem *item; GTM_FOREACH_OBJECT(item, [toolbar items]) { NSString *label = [item label]; @@ -267,6 +270,16 @@ } } } + + // Do NSTableView column headers. + if ([view isKindOfClass:[NSTableView class]]) { + NSTableView *tableView = (NSTableView *)view; + NSArray *columns = [tableView tableColumns]; + NSTableColumn *column = nil; + GTM_FOREACH_OBJECT(column, columns) { + [self localizeCell:[column headerCell] recursively:recursive]; + } + } } - (void)localizeMenu:(NSMenu *)menu recursively:(BOOL)recursive { -- cgit v1.2.3