add "open in tabs" to folders in menu (bug 174822)

This commit is contained in:
pinkerton%aol.net 2004-11-24 15:00:16 +00:00
Родитель 917ba5cead
Коммит 94794728bc
1 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -131,9 +131,21 @@
- (void)constructMenu:(NSMenu *)menu forBookmarkFolder:(BookmarkFolder *)aFolder - (void)constructMenu:(NSMenu *)menu forBookmarkFolder:(BookmarkFolder *)aFolder
{ {
unsigned i, childCount = [aFolder count]; unsigned long childCount = [aFolder count];
for (i = 0; i < childCount; i++) for (unsigned long i = 0; i < childCount; i++)
[self addItem:[aFolder objectAtIndex:i] toMenu:menu atIndex:i]; [self addItem:[aFolder objectAtIndex:i] toMenu:menu atIndex:i];
// add the "Open In Tabs" option to open all items in this subfolder (not the main bookmark
// folder) as a tabgroup.
if (aFolder != [[BookmarkManager sharedBookmarkManager] bookmarkMenuFolder] && childCount > 0) {
[menu addItem:[NSMenuItem separatorItem]];
NSMenuItem *menuItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Open in Tabs", nil) action:nil keyEquivalent:@""] autorelease];
[menu addItem:menuItem];
[menuItem setTarget:[NSApp delegate]];
[menuItem setAction:@selector(openMenuBookmark:)];
[menuItem setRepresentedObject:aFolder];
}
} }
- (void)addItem:(BookmarkItem *)anItem toMenu:(NSMenu *)aMenu atIndex:(int)aIndex - (void)addItem:(BookmarkItem *)anItem toMenu:(NSMenu *)aMenu atIndex:(int)aIndex