Skip to content

Commit

Permalink
Give safari bookmarks the custom icons for the top-level bookmarks ba…
Browse files Browse the repository at this point in the history
…r and bookmarks menu. Also, use a localized string since these special nodes have nonlocalized names, and the client app needs to localize them.
  • Loading branch information
Dan Wood committed Mar 13, 2010
1 parent 3e8293e commit 2ec8d25
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions IMBSafariBookmarkParser.m
Expand Up @@ -391,6 +391,42 @@ - (void) populateNode:(IMBNode*)inNode plist:(NSDictionary*)inPlist

if (subnode)
{
if ([inNode isRootNode])
{
NSImage *newImage = nil;
if ([subnode.name isEqualToString:@"BookmarksMenu"])
{
// Localize and get special icon
subnode.name = NSLocalizedStringWithDefaultValue(
@"Safari.BookmarksMenu",
nil,IMBBundle(),
@"Bookmarks Menu",
@"top-level bookmark name");
newImage = [NSImage imageResourceNamed:@"tiny_menu.tiff"
fromApplication:@"com.apple.Safari"
fallbackTo:nil];

}
else if ([subnode.name isEqualToString:@"BookmarksBar"])
{
// Localize and get special icon
subnode.name = NSLocalizedStringWithDefaultValue(
@"Safari.BookmarksBar",
nil,IMBBundle(),
@"Bookmarks Bar",
@"top-level bookmark name");

newImage = [NSImage imageResourceNamed:@"FavoritesBar.tif"
fromApplication:@"com.apple.Safari"
fallbackTo:nil];
}
if (newImage)
{
subnode.icon = newImage;
}

}

subnode.parentNode = inNode;
[self populateNode:subnode plist:childPlist];
[(NSMutableArray*)inNode.subNodes addObject:subnode];
Expand Down

0 comments on commit 2ec8d25

Please sign in to comment.