From: Kent Sutherland Date: Fri, 31 Oct 2003 06:05:12 +0000 (+0000) Subject: Added new password panel. MORE conformity/bugfixes. X-Git-Tag: v1.2~40 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/b5dfd502c729e9535246a5bde4d9463696f0ed11 Added new password panel. MORE conformity/bugfixes. --- diff --git a/English.lproj/Preferences.nib/classes.nib b/English.lproj/Preferences.nib/classes.nib index a407ae6..86838f8 100755 --- a/English.lproj/Preferences.nib/classes.nib +++ b/English.lproj/Preferences.nib/classes.nib @@ -34,6 +34,7 @@ passwordPanelMessage = NSTextField; passwordPanelOKButton = NSButton; passwordPanelTextField = NSTextField; + passwordPanelTitle = NSTextField; passwordTextField = NSTextField; ratingCheckbox = NSButton; selectPlayerBox = NSBox; diff --git a/English.lproj/Preferences.nib/info.nib b/English.lproj/Preferences.nib/info.nib index 1bf11ab..eb7b7a5 100755 --- a/English.lproj/Preferences.nib/info.nib +++ b/English.lproj/Preferences.nib/info.nib @@ -20,7 +20,7 @@ IBOpenObjects 6 - 699 + 719 IBSystem Version 7B85 diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib index 04a312d..7cdebdb 100755 Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ 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 diff --git a/PreferencesController.h b/PreferencesController.h index c2cc388..f423317 100755 --- a/PreferencesController.h +++ b/PreferencesController.h @@ -37,6 +37,7 @@ IBOutlet NSTextField *passwordPanelMessage; IBOutlet NSButton *passwordPanelOKButton; IBOutlet NSTextField *passwordPanelTextField; + IBOutlet NSTextField *passwordPanelTitle; IBOutlet NSTextField *passwordTextField; IBOutlet NSButton *ratingCheckbox; IBOutlet NSTextField *selectedPlayerTextField; @@ -78,6 +79,8 @@ - (IBAction)changeGeneralSetting:(id)sender; - (IBAction)changeSharingSetting:(id)sender; - (IBAction)changeStatusWindowSetting:(id)sender; +- (void)resetRemotePlayerTextFields; + - (IBAction)clearHotKey:(id)sender; - (IBAction)editHotKey:(id)sender; - (IBAction)showPrefsWindow:(id)sender; diff --git a/PreferencesController.m b/PreferencesController.m index 4141086..0ee689d 100755 --- a/PreferencesController.m +++ b/PreferencesController.m @@ -130,8 +130,11 @@ static PreferencesController *prefs = nil; - (BOOL)showPasswordPanel { [passwordPanel setLevel:NSStatusWindowLevel]; - [passwordPanelOKButton setTitle:@"OK"]; + [passwordPanelOKButton setTitle:@"Connect"]; + [passwordPanelTitle setStringValue:@"Password Required"]; [passwordPanelMessage setStringValue:[NSString stringWithFormat:@"Please enter a password for access to the MenuTunes player named %@ at %@.", [[[NetworkController sharedController] networkObject] serverName], [[NetworkController sharedController] remoteHost]]]; + [passwordPanel center]; + [passwordPanel setLevel:NSStatusWindowLevel]; [passwordPanel makeKeyAndOrderFront:nil]; if ([NSApp runModalForWindow:passwordPanel]) { return YES; @@ -144,7 +147,10 @@ static PreferencesController *prefs = nil; { [passwordPanel setLevel:NSStatusWindowLevel]; [passwordPanelOKButton setTitle:@"Retry"]; + [passwordPanelTitle setStringValue:@"Invalid Password"]; [passwordPanelMessage setStringValue:[NSString stringWithFormat:@"The password entered for access to the MenuTunes player named %@ at %@ is invalid. Please provide a new password.", [[[NetworkController sharedController] networkObject] serverName], [[NetworkController sharedController] remoteHost]]]; + [passwordPanel center]; + [passwordPanel setLevel:NSStatusWindowLevel]; [passwordPanel makeKeyAndOrderFront:nil]; if ([NSApp runModalForWindow:passwordPanel]) { return YES; @@ -491,6 +497,17 @@ static PreferencesController *prefs = nil; } } +- (void)resetRemotePlayerTextFields +{ + if ([[NetworkController sharedController] isConnectedToServer]) { + [selectedPlayerTextField setStringValue:[[[NetworkController sharedController] networkObject] serverName]]; + [locationTextField setStringValue:[[NetworkController sharedController] remoteHost]]; + } else { + [selectedPlayerTextField setStringValue:@"No shared player selected."]; + [locationTextField setStringValue:@"-"]; + } +} + /*************************************************************************/ #pragma mark - #pragma mark HOTKEY SUPPORT METHODS diff --git a/libValidate.a b/libValidate.a index bba70d4..485158e 100755 Binary files a/libValidate.a and b/libValidate.a differ