-
- if (numSongs > 0) {
- int curTrack = [[self runScriptAndReturnResult:@"return index of current track"] intValue];
- int i;
-
- [upcomingSongsMenu release];
- upcomingSongsMenu = [[NSMenu alloc] initWithTitle:@""];
-
- for (i = curTrack + 1; i <= curTrack + numSongsInAdvance; i++) {
- if (i <= numSongs) {
- NSString *curSong = [self runScriptAndReturnResult:[NSString stringWithFormat:@"return name of track %i of current playlist", i]];
- NSMenuItem *songItem;
- songItem = [[NSMenuItem alloc] initWithTitle:curSong action:@selector(playTrack:) keyEquivalent:@""];
- [songItem setTarget:self];
- [songItem setRepresentedObject:[NSNumber numberWithInt:i]];
- [upcomingSongsMenu addItem:songItem];
- [songItem release];
- } else {
- [upcomingSongsMenu addItemWithTitle:@"End of playlist." action:nil keyEquivalent:@""];
- break;
+ if (!isPlayingRadio) {
+ if (numSongs > 0) {
+ int curTrack = [[self runScriptAndReturnResult:@"return index of current track"] intValue];
+ int i;
+
+ [upcomingSongsMenu release];
+ upcomingSongsMenu = [[NSMenu alloc] initWithTitle:@""];
+ [upcomingSongsItem setSubmenu:upcomingSongsMenu];
+ [upcomingSongsItem setEnabled:YES];
+
+ for (i = curTrack + 1; i <= curTrack + numSongsInAdvance; i++) {
+ if (i <= numSongs) {
+ NSString *curSong = [self runScriptAndReturnResult:[NSString stringWithFormat:@"return name of track %i of current playlist", i]];
+ NSMenuItem *songItem;
+ songItem = [[NSMenuItem alloc] initWithTitle:curSong action:@selector(playTrack:) keyEquivalent:@""];
+ [songItem setTarget:self];
+ [songItem setRepresentedObject:[NSNumber numberWithInt:i]];
+ [upcomingSongsMenu addItem:songItem];
+ [songItem release];
+ } else {
+ break;
+ }