The hotkey for showing track info now calls a different method that will hide the...
authorKent Sutherland <ksuther@ithinksw.com>
Tue, 8 Nov 2005 04:02:24 +0000 (04:02 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Tue, 8 Nov 2005 04:02:24 +0000 (04:02 +0000)
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

index 548ca25..db0269f 100755 (executable)
@@ -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