Commit 2dfe7c35 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: add multi-selection support to the playlist's recursiveExpandNode (refs #6892)

(cherry picked from commit 0e5226e0eeee223fb5e8e7c33e1fa36f3c4f5e62)
parent e2769a9b
...@@ -1267,18 +1267,28 @@ ...@@ -1267,18 +1267,28 @@
- (IBAction)recursiveExpandNode:(id)sender - (IBAction)recursiveExpandNode:(id)sender
{ {
id o_item = [o_outline_view itemAtRow: [o_outline_view selectedRow]]; NSIndexSet * selectedRows = [o_outline_view selectedRowIndexes];
playlist_item_t *p_item = (playlist_item_t *)[o_item pointerValue]; NSUInteger count = [selectedRows count];
NSUInteger indexes[count];
[selectedRows getIndexes:indexes maxCount:count inIndexRange:nil];
id o_item;
playlist_item_t *p_item;
for (NSUInteger i = 0; i < count; i++) {
o_item = [o_outline_view itemAtRow: indexes[i]];
p_item = (playlist_item_t *)[o_item pointerValue];
if( ![[o_outline_view dataSource] outlineView: o_outline_view isItemExpandable: o_item] ) if( ![[o_outline_view dataSource] outlineView: o_outline_view isItemExpandable: o_item] )
{
o_item = [o_outline_dict objectForKey: [NSString stringWithFormat: @"%p", p_item->p_parent]]; o_item = [o_outline_dict objectForKey: [NSString stringWithFormat: @"%p", p_item->p_parent]];
}
/* We need to collapse the node first, since OSX refuses to recursively /* We need to collapse the node first, since OSX refuses to recursively
expand an already expanded node, even if children nodes are collapsed. */ expand an already expanded node, even if children nodes are collapsed. */
[o_outline_view collapseItem: o_item collapseChildren: YES]; [o_outline_view collapseItem: o_item collapseChildren: YES];
[o_outline_view expandItem: o_item expandChildren: YES]; [o_outline_view expandItem: o_item expandChildren: YES];
selectedRows = [o_outline_view selectedRowIndexes];
[selectedRows getIndexes:indexes maxCount:count inIndexRange:nil];
}
} }
- (NSMenu *)menuForEvent:(NSEvent *)o_event - (NSMenu *)menuForEvent:(NSEvent *)o_event
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment