Added ITFoundation launch at login, but it doesn'ty work. Other small fixes for netwo...
[MenuTunes.git] / MainController.m
index c235a8f..ad6f2e1 100755 (executable)
@@ -1091,6 +1091,11 @@ static MainController *sharedController;
     if (result == 1) {
         [[PreferencesController sharedPrefs] resetRemotePlayerTextFields];
         currentRemote = [[[networkController networkObject] remote] retain];
+        
+        [self setupHotKeys];
+        //playerRunningState = ITMTRemotePlayerRunning;
+        playerRunningState = [[self currentRemote] playerRunningState];
+        
         [refreshTimer invalidate];
         refreshTimer = [[NSTimer scheduledTimerWithTimeInterval:([networkController isConnectedToServer] ? 10.0 : 0.5)
                                 target:self
@@ -1182,7 +1187,7 @@ static MainController *sharedController;
 - (void)applicationLaunched:(NSNotification *)note
 {
     NS_DURING
-        if (!note || [[[note userInfo] objectForKey:@"NSApplicationName"] isEqualToString:[[self currentRemote] playerFullName]]) {
+        if (!note || ([[[note userInfo] objectForKey:@"NSApplicationName"] isEqualToString:[[self currentRemote] playerFullName]] && ![[NetworkController sharedController] isConnectedToServer])) {
             ITDebugLog(@"Remote application launched.");
             playerRunningState = ITMTRemotePlayerRunning;
             [[self currentRemote] begin];