From: Kent Sutherland Date: Mon, 10 Mar 2003 17:52:19 +0000 (+0000) Subject: (12:51) Kent: Shall I commit my l33tness/ X-Git-Tag: v1.0~206 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/a01e3db7219fd9c6401e3499551c80d2009135b5 (12:51) Kent: Shall I commit my l33tness/ (12:51) Joe: NO YOU SHOULDNT LAWL (12:51) Joe: yes, of course you should --- diff --git a/MenuTunes.m b/MenuTunes.m index 419a93a..54f5768 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -661,6 +661,41 @@ Things to do: [playPauseMenuItem setTitle:@"Play"]; } } + } else if ((lastPlaylistIndex > 0) && (playlist == 0)) { + NSMenuItem *menuItem; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + //Remote the now playing item and add no song item + [menu removeItemAtIndex:trackInfoIndex]; + + if ([defaults boolForKey:@"showName"] == YES) { + [menu removeItemAtIndex:trackInfoIndex]; + } + + if ([defaults boolForKey:@"showTime"] == YES) { + [menu removeItemAtIndex:trackInfoIndex]; + } + + if (didHaveArtistName && [defaults boolForKey:@"showArtist"]) { + [menu removeItemAtIndex:trackInfoIndex]; + } + + if (didHaveAlbumName && [defaults boolForKey:@"showAlbum"]) { + [menu removeItemAtIndex:trackInfoIndex]; + } + + [playPauseMenuItem setTitle:@"Play"]; + + didHaveArtistName = NO; + didHaveAlbumName = NO; + lastPlaylistIndex = -1; + lastSongIndex = -1; + + [upcomingSongsItem setSubmenu:nil]; + [upcomingSongsItem setEnabled:NO]; + + menuItem = [[NSMenuItem alloc] initWithTitle:@"No Song" action:nil keyEquivalent:@""]; + [menu insertItem:menuItem atIndex:trackInfoIndex]; + [menuItem release]; } }