X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/359d3b6d29d4e3518e7a805465b2e48065161a91..28b26b0acce681c25cd8bf5ac7fc8881794afb36:/MainController.m diff --git a/MainController.m b/MainController.m index 9d2e3cc..c235a8f 100755 --- a/MainController.m +++ b/MainController.m @@ -334,10 +334,6 @@ static MainController *sharedController; - (void)timerUpdate { - if ([networkController isConnectedToServer]) { - [statusItem setMenu:[menuController menu]]; - } - if ( [self songChanged] && (timerUpdating != YES) && (playerRunningState == ITMTRemotePlayerRunning) ) { ITDebugLog(@"The song changed."); @@ -358,6 +354,7 @@ static MainController *sharedController; } timerUpdating = YES; + [statusItem setEnabled:NO]; NS_DURING latestPlaylistClass = [[self currentRemote] currentPlaylistClass]; @@ -391,6 +388,11 @@ static MainController *sharedController; NS_ENDHANDLER timerUpdating = NO; + [statusItem setEnabled:YES]; + } + + if ([networkController isConnectedToServer]) { + [statusItem setMenu:[menuController menu]]; } } @@ -1117,6 +1119,12 @@ static MainController *sharedController; [currentRemote release]; currentRemote = [remoteArray objectAtIndex:0]; [networkController disconnect]; + + if ([[self currentRemote] playerRunningState] == ITMTRemotePlayerRunning) { + [self applicationLaunched:nil]; + } else { + [self applicationTerminated:nil]; + } [self timerUpdate]; return YES; }