Fixed adding files in File Tree. Now adds when you press enter, and supports multiple selections.

CQTexperiment
areff 2008-02-21 09:05:06 +00:00
parent 8bff745c38
commit 52f8c6f31f
2 changed files with 47 additions and 11 deletions

View File

@ -24,9 +24,44 @@
- (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];
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

View File

@ -569,16 +569,6 @@
[self updateIndexesFromRow:0];
}
- (NSMutableArray *)queueList
{
return queueList;
}
- (IBAction)emptyQueueList:(id)sender
{
[queueList removeAllObjects];
}
- (IBAction)showEntryInFinder:(id)sender
{
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
@ -601,6 +591,17 @@
[spotlightWindowController searchForAlbum:[entry album]];
}
- (NSMutableArray *)queueList
{
return queueList;
}
- (IBAction)emptyQueueList:(id)sender
{
[queueList removeAllObjects];
}
- (IBAction)addToQueue:(id)sender
{
for (PlaylistEntry *queueItem in [self selectedObjects])