Fixed the state for the playlists menu item to show the currently playing playlist.
[MenuTunes.git] / MenuController.m
index 382e6f2..50ffb98 100755 (executable)
             if (source == ITMTRemoteRadioSource) {
                 [playlistsMenu addItem:[NSMenuItem separatorItem]];
                 [[playlistsMenu addItemWithTitle:NSLocalizedString(@"radio", @"Radio") action:@selector(performPlaylistMenuAction:) keyEquivalent:@""] setState:NSOnState];
-            }
-        } else {
-            [playlistsMenu addItem:[NSMenuItem separatorItem]];
+            } else if ([playlists count] > 2) {
+                               [playlistsMenu addItem:[NSMenuItem separatorItem]];
+                       }
         }
                
                //Add other sources as needed (shared music, iPods, CDs)
                        [tempItem setState:NSOnState];
                        [[[tempItem submenu] itemAtIndex:_currentPlaylist - 1] setState:NSOnState];
                } else if (source == ITMTRemoteLibrarySource && _currentPlaylist) {
-                       [[playlistsMenu itemAtIndex:_currentPlaylist - 1] setState:NSOnState];
+                       [[playlistsMenu itemAtIndex:_currentPlaylist - 2] setState:NSOnState];
                }
        }
        NS_HANDLER