X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/775df65cfdd7c0d32917a5b9b1ffb5923b1297d7..9cebb1f7452afe422cb940e970c9f30b5180a239:/MenuController.m diff --git a/MenuController.m b/MenuController.m index 2bd03d1..7cc59fb 100755 --- a/MenuController.m +++ b/MenuController.m @@ -403,7 +403,6 @@ NS_DURING [[_eqMenu itemAtIndex:0] setState:[mtr equalizerEnabled] ? NSOnState : NSOffState]; [[_eqMenu itemAtIndex:([mtr currentEQPresetIndex] + 1)] setState:NSOnState]; - [[_eqMenu itemAtIndex:([mtr currentEQPresetIndex] - 1)] setState:NSOnState]; NS_HANDLER [[MainController sharedController] networkError:localException]; NS_ENDHANDLER @@ -748,11 +747,6 @@ tempItem = [eqMenu addItemWithTitle:@"Enabled" action:@selector(performEqualizerMenuAction:) keyEquivalent:@""]; [tempItem setTag:-1]; [tempItem setTarget:self]; - NS_DURING - [tempItem setState:[[[MainController sharedController] currentRemote] equalizerEnabled] ? NSOnState : NSOffState]; - NS_HANDLER - [[MainController sharedController] networkError:localException]; - NS_ENDHANDLER [eqMenu addItem:[NSMenuItem separatorItem]]; for (i = 0; i < [eqPresets count]; i++) { @@ -772,7 +766,7 @@ - (NSMenu *)artistsMenu { - NSMenu *artistsMenu = [[NSMenu alloc] initWithTitle:@""]; + NSMenu *artistsMenu = [[NSMenu alloc] initWithTitle:@"Artists"]; NSEnumerator *artistsEnumerator; NSString *nextArtist; id tempItem; @@ -781,8 +775,6 @@ artistsEnumerator = [[[[MainController sharedController] currentRemote] artists] objectEnumerator]; while ( (nextArtist = [artistsEnumerator nextObject]) ) { tempItem = [artistsMenu addItemWithTitle:nextArtist action:@selector(performBrowseMenuAction:) keyEquivalent:@""]; - [tempItem setRepresentedObject:nextArtist]; - [tempItem setTag:1]; [tempItem setTarget:self]; } NS_HANDLER @@ -794,7 +786,7 @@ - (NSMenu *)albumsMenu { - NSMenu *albumsMenu = [[NSMenu alloc] initWithTitle:@""]; + NSMenu *albumsMenu = [[NSMenu alloc] initWithTitle:@"Albums"]; NSEnumerator *albumsEnumerator; NSString *nextAlbum; id tempItem; @@ -803,8 +795,6 @@ albumsEnumerator = [[[[MainController sharedController] currentRemote] albums] objectEnumerator]; while ( (nextAlbum = [albumsEnumerator nextObject]) ) { tempItem = [albumsMenu addItemWithTitle:nextAlbum action:@selector(performBrowseMenuAction:) keyEquivalent:@""]; - [tempItem setRepresentedObject:nextAlbum]; - [tempItem setTag:2]; [tempItem setTarget:self]; } NS_HANDLER @@ -886,13 +876,13 @@ - (void)performBrowseMenuAction:(id)sender { - ITDebugLog(@"Browse action selected on item with object %@ and tag %i", [sender representedObject], [sender tag]); + ITDebugLog(@"Browse action selected on item named %@", [sender title]); /* ** 1 - Artist ** 2 - Album ** 3 - Genre? */ - [[MainController sharedController] makePlaylistWithTerm:[sender representedObject] ofType:[sender tag]]; + [[MainController sharedController] makePlaylistWithTerm:[sender title] ofType:(([[[sender menu] title] isEqualToString:@"Artists"]) ? 1 : 2)]; } - (void)updateMenu