From 95bfc9d0fa830da8615ed00808ff347df2f50eb5 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Tue, 8 Nov 2005 04:02:24 +0000 Subject: [PATCH] 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. --- MainController.m | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) 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 -- 2.20.1