Fixed adding files in File Tree. Now adds when you press enter, and supports multiple selections.
parent
8bff745c38
commit
52f8c6f31f
|
@ -24,9 +24,44 @@
|
||||||
|
|
||||||
- (IBAction)addToPlaylist:(id)sender
|
- (IBAction)addToPlaylist:(id)sender
|
||||||
{
|
{
|
||||||
NSArray *urls = [NSArray arrayWithObject:[[outlineView itemAtRow:[outlineView clickedRow]] URL]];
|
unsigned int index;
|
||||||
|
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
|
||||||
|
NSMutableArray *urls = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
[playlistLoader addURLs:urls sort:NO];
|
for (index = [selectedIndexes firstIndex];
|
||||||
|
index != NSNotFound; index = [selectedIndexes indexGreaterThanIndex: index])
|
||||||
|
{
|
||||||
|
[urls addObject:[[outlineView itemAtRow:index] URL]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[playlistLoader addURLs:urls sort:NO];
|
||||||
|
[urls release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)keyDown:(NSEvent *)e
|
||||||
|
{
|
||||||
|
unsigned int modifiers = [e modifierFlags] & (NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask);
|
||||||
|
NSString *characters = [e characters];
|
||||||
|
unichar c;
|
||||||
|
|
||||||
|
if ([characters length] != 1)
|
||||||
|
{
|
||||||
|
[super keyDown:e];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = [characters characterAtIndex:0];
|
||||||
|
|
||||||
|
if (modifiers == 0 && (c == NSEnterCharacter || c == NSCarriageReturnCharacter))
|
||||||
|
{
|
||||||
|
[self addToPlaylist:self];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[super keyDown:e];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -569,16 +569,6 @@
|
||||||
[self updateIndexesFromRow:0];
|
[self updateIndexesFromRow:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSMutableArray *)queueList
|
|
||||||
{
|
|
||||||
return queueList;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (IBAction)emptyQueueList:(id)sender
|
|
||||||
{
|
|
||||||
[queueList removeAllObjects];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (IBAction)showEntryInFinder:(id)sender
|
- (IBAction)showEntryInFinder:(id)sender
|
||||||
{
|
{
|
||||||
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
|
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
|
||||||
|
@ -601,6 +591,17 @@
|
||||||
[spotlightWindowController searchForAlbum:[entry album]];
|
[spotlightWindowController searchForAlbum:[entry album]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSMutableArray *)queueList
|
||||||
|
{
|
||||||
|
return queueList;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)emptyQueueList:(id)sender
|
||||||
|
{
|
||||||
|
[queueList removeAllObjects];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)addToQueue:(id)sender
|
- (IBAction)addToQueue:(id)sender
|
||||||
{
|
{
|
||||||
for (PlaylistEntry *queueItem in [self selectedObjects])
|
for (PlaylistEntry *queueItem in [self selectedObjects])
|
||||||
|
|
Loading…
Reference in New Issue