X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/3aa646fcc087ac10c7e1f646a114a28519c47830..635a5437a4d35597ac0fce8c5f7bcb3dd406d5e3:/MainController.m diff --git a/MainController.m b/MainController.m index c889234..ca0d38d 100755 --- a/MainController.m +++ b/MainController.m @@ -352,7 +352,7 @@ static MainController *sharedController; 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); + ITDebugLog(@"Running script: %@", nextScript); if (!currentScript || ![currentScript executeAndReturnError:nil]) { ITDebugLog(@"Error running script %@.", nextScript); } @@ -372,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 @@ -582,6 +588,11 @@ static MainController *sharedController; // // +- (MenuController *)menuController +{ + return menuController; +} + - (void)closePreferences { ITDebugLog(@"Preferences closed."); @@ -753,6 +764,7 @@ static MainController *sharedController; NSString *title = nil; NSString *album = nil; NSString *artist = nil; + NSString *composer = nil; NSString *time = nil; NSString *track = nil; NSImage *art = nil; @@ -785,6 +797,14 @@ static MainController *sharedController; NS_ENDHANDLER } + if ( [df boolForKey:@"showComposer"] ) { + NS_DURING + composer = [[self currentRemote] currentSongComposer]; + NS_HANDLER + [self networkError:localException]; + NS_ENDHANDLER + } + if ( [df boolForKey:@"showTime"] ) { NS_DURING time = [NSString stringWithFormat:@"%@: %@ / %@", @@ -847,6 +867,7 @@ static MainController *sharedController; title:title album:album artist:artist + composer:composer time:time track:track rating:rating