X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/c17d6e218e09277277fa3d0b267407e229b2ad15..62c12e7f7c182a22969de8ebb233db31d9965454:/MenuController.m?ds=inline diff --git a/MenuController.m b/MenuController.m index c2970f6..4b4ee50 100755 --- a/MenuController.m +++ b/MenuController.m @@ -22,7 +22,7 @@ - (NSMenu *)eqMenu; - (void)setKeyEquivalentForCode:(short)code andModifiers:(long)modifiers onItem:(id )item; -//- (BOOL)iPodAtPathAutomaticallyUpdates:(NSString *)name; +- (BOOL)iPodWithNameAutomaticallyUpdates:(NSString *)name; @end @implementation MenuController @@ -438,6 +438,7 @@ NS_HANDLER [[MainController sharedController] networkError:localException]; NS_ENDHANDLER + ITDebugLog(@"Releasing old submenus."); [_ratingMenu release]; [_upcomingSongsMenu release]; [_playlistsMenu release]; @@ -497,7 +498,6 @@ if (_currentPlaylist && !_playingRadio) { if (numSongs > 0) { int i; - for (i = _currentTrack + 1; i <= _currentTrack + numSongsInAdvance; i++) { if (i <= numSongs) { NSString *curSong; @@ -525,7 +525,7 @@ return upcomingSongsMenu; } -- (NSMenu *)playlistsMenu +/*- (NSMenu *)playlistsMenu { NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""]; NSArray *playlists; @@ -563,14 +563,14 @@ } ITDebugLog(@"Done Building \"Playlists\" menu"); return playlistsMenu; -} +}*/ -/*- (NSMenu *)playlistsMenu +- (NSMenu *)playlistsMenu { NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""]; NSArray *playlists; - NSMenuItem *tempItem; + id tempItem; ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource]; int i, j; NS_DURING @@ -590,7 +590,6 @@ [tempItem setTarget:self]; } } - if ( (source == ITMTRemoteRadioSource) || ([playlists count] - 2 > 0) ) { [playlistsMenu addItem:[NSMenuItem separatorItem]]; } @@ -605,7 +604,14 @@ NSMenu *submenu = [[NSMenu alloc] init]; ITDebugLog(@"Adding source: %@", name); - if ( ([[curPlaylist objectAtIndex:i] intValue] == ITMTRemoteiPodSource) && (![self iPodAtPathAutomaticallyUpdates:[curPlaylist objectAtIndex:j]]) ) { + if ([[curPlaylist objectAtIndex:1] intValue] == ITMTRemoteiPodSource) { + NSLog(@"We have an iPod!"); + NSLog(@"This iPod is named %@!", name); + NSLog(@"Does it update automagically?"); + NSLog(@"Result: %i", [self iPodWithNameAutomaticallyUpdates:name]); + } + + if ( ([[curPlaylist objectAtIndex:1] intValue] == ITMTRemoteiPodSource) && [self iPodWithNameAutomaticallyUpdates:name] ) { ITDebugLog(@"Invalid iPod source."); } else { for (j = 2; j < [curPlaylist count]; j++) { @@ -627,7 +633,7 @@ } ITDebugLog(@"Done Building \"Playlists\" menu"); return playlistsMenu; -}*/ +} - (NSMenu *)eqMenu { @@ -980,7 +986,7 @@ ITDebugLog(@"Done setting key equivalent on menu item: %@", [item title]); } -/*- (BOOL)iPodAtPathAutomaticallyUpdates:(NSString *)name +- (BOOL)iPodWithNameAutomaticallyUpdates:(NSString *)name { NSArray *volumes = [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths]; NSEnumerator *volEnum = [volumes objectEnumerator]; @@ -1010,6 +1016,7 @@ } } } -}*/ + return NO; +} @end \ No newline at end of file