X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/da05d51282a00722e05f2c777db5cc3d0623d348..b5dfd502c729e9535246a5bde4d9463696f0ed11:/MainController.m diff --git a/MainController.m b/MainController.m index 341eb8d..bd93fca 100755 --- a/MainController.m +++ b/MainController.m @@ -950,9 +950,9 @@ static MainController *sharedController; result = [networkController connectToHost:[df stringForKey:@"sharedPlayerHost"]]; //Connect if (result == 1) { + [[PreferencesController sharedPrefs] resetRemotePlayerTextFields]; currentRemote = [[[networkController networkObject] remote] retain]; [self timerUpdate]; - //[refreshTimer invalidate]; ITDebugLog(@"Connection successful."); return YES; } else if (result == 0) { @@ -999,6 +999,7 @@ static MainController *sharedController; if ([[exception name] isEqualToString:NSPortTimeoutException] && [networkController isConnectedToServer]) { NSRunCriticalAlertPanel(@"Remote MenuTunes Disconnected", @"The MenuTunes server you were connected to stopped responding or quit. MenuTunes will revert back to the local player.", @"OK", nil, nil); if ([self disconnectFromServer]) { + [[PreferencesController sharedPrefs] resetRemotePlayerTextFields]; [NSTimer scheduledTimerWithTimeInterval:45 target:self selector:@selector(checkForRemoteServer:) userInfo:nil repeats:YES]; } else { ITDebugLog(@"CRITICAL ERROR, DISCONNECTING!"); @@ -1075,8 +1076,8 @@ static MainController *sharedController; - (void)applicationWillTerminate:(NSNotification *)note { - [self clearHotKeys]; [networkController stopRemoteServerSearch]; + [self clearHotKeys]; [[NSStatusBar systemStatusBar] removeStatusItem:statusItem]; } @@ -1097,5 +1098,4 @@ static MainController *sharedController; [super dealloc]; } - @end \ No newline at end of file