Search by artist and album works from context menu.

CQTexperiment
matthewleon 2008-02-16 16:38:44 +00:00
parent 6a915b458b
commit 3c8b325a00
3 changed files with 433 additions and 404 deletions

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@
IBOutlet PlaylistLoader *playlistLoader; IBOutlet PlaylistLoader *playlistLoader;
IBOutlet NSArrayController *playlistController; IBOutlet NSArrayController *playlistController;
IBOutlet NSPathControl *pathControl; IBOutlet NSPathControl *pathControl;
IBOutlet NSSearchField *searchField;
NSMetadataQuery *query; NSMetadataQuery *query;
NSString *searchString; NSString *searchString;
NSString *spotlightSearchPath; NSString *spotlightSearchPath;

View File

@ -230,11 +230,15 @@ static NSPredicate * musicOnlyPredicate = nil;
- (void)searchForArtist:(NSString *)artist - (void)searchForArtist:(NSString *)artist
{ {
NSLog(@"When Matthew gets less lazy I will search for songs by %@", artist); [self showWindow:self];
searchField.stringValue = [NSString stringWithFormat:@"%%a\"%@\"", artist];
self.searchString = searchField.stringValue;
} }
- (void)searchForAlbum:(NSString *)album - (void)searchForAlbum:(NSString *)album
{ {
NSLog(@"When Matthew gets less lazy I will search for songs from %@", album); [self showWindow:self];
searchField.stringValue = [NSString stringWithFormat:@"%%l\"%@\"", album];
self.searchString = searchField.stringValue;
} }
// Don't update the track list until some results have been gathered // Don't update the track list until some results have been gathered