+
+ if (!clientProxy) {
+ ITDebugLog(@"Null proxy! Couldn't connect!");
+ [self disconnect];
+ return NO;
+ }
+
+ if ([clientProxy requiresPassword]) {
+ ITDebugLog(@"Sending password.");
+ if (![clientProxy sendPassword:[[NSUserDefaults standardUserDefaults] dataForKey:@"connectPassword"]]) {
+ ITDebugLog(@"Invalid password!");
+ [self disconnect];
+ if ( NSRunCriticalAlertPanel(@"Invalid Password", @"The MenuTunes server you attempted to connect to rejected your password. Would you like to try to reconnect?.", @"Yes", @"No", nil) == NSOKButton ) {
+ return [self connectToHost:host];
+ } else {
+ return NO;
+ }
+ }
+ }
+