X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/62c12e7f7c182a22969de8ebb233db31d9965454..68dfd7431d482d1958c5d8371c4fd494b1356d84:/MainController.m diff --git a/MainController.m b/MainController.m index 6f14518..e0230ff 100755 --- a/MainController.m +++ b/MainController.m @@ -348,9 +348,11 @@ static MainController *sharedController; NSArray *scripts = [[NSFileManager defaultManager] directoryContentsAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"]]; NSEnumerator *scriptsEnum = [scripts objectEnumerator]; NSString *nextScript; + ITDebugLog(@"Running AppleScripts for song change."); while ( (nextScript = [scriptsEnum nextObject]) ) { NSDictionary *error; NSAppleScript *currentScript = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"] stringByAppendingPathComponent:nextScript]] error:&error]; + NSLog(@"Running script: %@", nextScript); if (!currentScript || ![currentScript executeAndReturnError:nil]) { ITDebugLog(@"Error running script %@.", nextScript); } @@ -370,17 +372,23 @@ static MainController *sharedController; [self setLatestSongIdentifier:[[self currentRemote] playerStateUniqueIdentifier]]; - NSString *artist = [[self currentRemote] currentSongArtist]; - NSString *title = [[self currentRemote] currentSongTitle]; - NSString *toolTip; - if (artist) { - toolTip = [NSString stringWithFormat:@"%@ - %@", artist, title]; - } else if (title) { - toolTip = title; + //Create the tooltip for the status item + if ( [df boolForKey:@"showToolTip"] ) { + NSString *artist = [[self currentRemote] currentSongArtist]; + NSString *title = [[self currentRemote] currentSongTitle]; + NSString *toolTip; + ITDebugLog(@"Creating status item tooltip."); + if (artist) { + toolTip = [NSString stringWithFormat:@"%@ - %@", artist, title]; + } else if (title) { + toolTip = title; + } else { + toolTip = @"No Song Playing"; + } + [statusItem setToolTip:toolTip]; } else { - toolTip = @"No Song Playing"; + [statusItem setToolTip:nil]; } - [statusItem setToolTip:toolTip]; NS_HANDLER [self networkError:localException]; NS_ENDHANDLER @@ -1230,4 +1238,4 @@ static MainController *sharedController; [super dealloc]; } -@end \ No newline at end of file +@end