Skip to content
Snippets Groups Projects
Commit 9feb7ca8 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx/playlist: allow multi-select and multi-delete

parent 0c331833
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@
<rect key="frame" x="0.0" y="0.0" width="237" height="235"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="Fr1-af-8gb" customClass="VLCPlaylistTableView">
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="Fr1-af-8gb" customClass="VLCPlaylistTableView">
<rect key="frame" x="0.0" y="0.0" width="237" height="235"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
......
......@@ -61,14 +61,24 @@
}
size_t indexOfSelectedItem = self.selectedRow;
NSIndexSet *selectedIndexes = [self selectedRowIndexes];
switch(key) {
case NSDeleteCharacter:
case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey:
case NSBackspaceCharacter:
[[[VLCMain sharedInstance] playlistController] removeItemAtIndex:indexOfSelectedItem];
{
if (selectedIndexes.count == 1) {
[[[VLCMain sharedInstance] playlistController] removeItemAtIndex:indexOfSelectedItem];
} else {
VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController];
[selectedIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) {
[playlistController removeItemAtIndex:idx];
}];
}
break;
}
case NSEnterCharacter:
case NSCarriageReturnCharacter:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment