Added new password panel. MORE conformity/bugfixes.
authorKent Sutherland <ksuther@ithinksw.com>
Fri, 31 Oct 2003 06:05:12 +0000 (06:05 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Fri, 31 Oct 2003 06:05:12 +0000 (06:05 +0000)
English.lproj/Preferences.nib/classes.nib
English.lproj/Preferences.nib/info.nib
English.lproj/Preferences.nib/keyedobjects.nib
MainController.m
PreferencesController.h
PreferencesController.m
libValidate.a

index a407ae6..86838f8 100755 (executable)
@@ -34,6 +34,7 @@
                 passwordPanelMessage = NSTextField; 
                 passwordPanelOKButton = NSButton; 
                 passwordPanelTextField = NSTextField; 
+                passwordPanelTitle = NSTextField; 
                 passwordTextField = NSTextField; 
                 ratingCheckbox = NSButton; 
                 selectPlayerBox = NSBox; 
index 1bf11ab..eb7b7a5 100755 (executable)
@@ -20,7 +20,7 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>6</integer>
-               <integer>699</integer>
+               <integer>719</integer>
        </array>
        <key>IBSystem Version</key>
        <string>7B85</string>
index 04a312d..7cdebdb 100755 (executable)
Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ
index 341eb8d..bd93fca 100755 (executable)
@@ -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
index c2cc388..f423317 100755 (executable)
@@ -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;
index 4141086..0ee689d 100755 (executable)
@@ -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
index bba70d4..485158e 100755 (executable)
Binary files a/libValidate.a and b/libValidate.a differ