From: Kent Sutherland Date: Tue, 8 Nov 2005 04:02:24 +0000 (+0000) Subject: The hotkey for showing track info now calls a different method that will hide the... X-Git-Tag: v1.6.5~23 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/95bfc9d0fa830da8615ed00808ff347df2f50eb5?ds=sidebyside;hp=46b610a25dea1e26f1348dac4024d72514130bb3 The hotkey for showing track info now calls a different method that will hide the track info window if it is visible already. This change was made because the track info window is called automatically when the song changes, and we don't want it hiding if it is visible already, in that case. --- diff --git a/MainController.m b/MainController.m index 548ca25..db0269f 100755 --- a/MainController.m +++ b/MainController.m @@ -950,7 +950,7 @@ static MainController *sharedController; [hotKey setName:@"TrackInfo"]; [hotKey setKeyCombo:[ITKeyCombo keyComboWithPlistRepresentation:[df objectForKey:@"TrackInfo"]]]; [hotKey setTarget:self]; - [hotKey setAction:@selector(showCurrentTrackInfo)]; + [hotKey setAction:@selector(showCurrentTrackInfoHotKey)]; [[ITHotKeyCenter sharedCenter] registerHotKey:[hotKey autorelease]]; } @@ -1060,6 +1060,18 @@ static MainController *sharedController; ITDebugLog(@"Finished setting up hot keys."); } +- (void)showCurrentTrackInfoHotKey +{ + //If we're already visible and the setting says so, vanish instead of displaying again. + if ([df boolForKey:@"ToggleTrackInfoWithHotKey"] && [statusWindowController currentStatusWindowType] == StatusWindowTrackInfoType && [[StatusWindow sharedWindow] visibilityState] == ITWindowVisibleState) { + ITDebugLog(@"Track window is already visible, hiding track window."); + [self invalidateStatusWindowUpdateTimer]; + [[StatusWindow sharedWindow] vanish:nil]; + return; + } + [self showCurrentTrackInfo]; +} + - (void)showCurrentTrackInfo { ITMTRemotePlayerSource source = 0; @@ -1073,14 +1085,6 @@ static MainController *sharedController; int rating = -1; int playCount = -1; - //If we're already visible and the setting says so, vanish instead of displaying again. - if ([df boolForKey:@"ToggleTrackInfoWithHotKey"] && [statusWindowController currentStatusWindowType] == StatusWindowTrackInfoType && [[StatusWindow sharedWindow] visibilityState] == ITWindowVisibleState) { - ITDebugLog(@"Track window is already visible, hiding track window."); - [self invalidateStatusWindowUpdateTimer]; - [[StatusWindow sharedWindow] vanish:nil]; - return; - } - ITDebugLog(@"Showing track info status window."); NS_DURING