Ignore user interaction while busy. Done by toggling ignoresMouseEvents on auth dialogs
authorJustin Anderson <jander@mit.edu>
Wed, 8 Oct 2008 22:14:27 +0000 (22:14 +0000)
committerJustin Anderson <jander@mit.edu>
Wed, 8 Oct 2008 22:14:27 +0000 (22:14 +0000)
ticket:6144

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20845 dc483132-0cff-0310-8789-dd5450dbe970

src/kim/agent/mac/AuthenticationController.h
src/kim/agent/mac/AuthenticationController.m

index 3d382c117b2e4cd3da865bc8ed2df5c82036c5d3..489fd20e543611afa502d60ece3bf7104f4324e1 100644 (file)
 - (IBAction) changePasswordGearAction: (id) sender;
 
 - (void) swapView: (NSView *) aView;
+- (void) showSpinny;
+- (void) hideSpinny;
 
 @end
index 1b911759466a7d57c5a7a1212ca912bee4c8be53..20c971796281d5a2059e91c2d33e4f708f0ab411 100644 (file)
     [glueController setValue:message
                   forKeyPath:message_keypath];
 
-    [enterSpinny stopAnimation:nil];
+    [self hideSpinny];
 
     [self swapView:identityView];
 
 {
     uint32_t type = [[glueController valueForKeyPath:@"content.prompt_type"] unsignedIntegerValue];
     
-    [passwordSpinny stopAnimation:nil];
-    [samSpinny stopAnimation:nil];
+    [self hideSpinny];
 
     switch (type) {
         case kim_prompt_type_password :
     
 }
 
+- (void) showSpinny
+{
+    [enterSpinny          startAnimation: nil];
+    [passwordSpinny       startAnimation: nil];
+    [samSpinny            startAnimation: nil];
+    [changePasswordSpinny startAnimation: nil];
+    [[self window] setIgnoresMouseEvents:YES];
+}
+
+- (void) hideSpinny
+{
+    [enterSpinny          stopAnimation: nil];
+    [passwordSpinny       stopAnimation: nil];
+    [samSpinny            stopAnimation: nil];
+    [changePasswordSpinny stopAnimation: nil];    
+    [[self window] setIgnoresMouseEvents:NO];
+}
+
 - (void) showSAM
 {
     // set badge
     // set badge
     [changePasswordBadge setBadgePath:associatedClient.path];
     
-    [changePasswordSpinny stopAnimation:nil];
+    [self hideSpinny];
     
     [self swapView:changePasswordView];
     
         options = [glueController valueForKeyPath:options_keypath];
     }
     
-    [enterSpinny startAnimation:nil];
+    [self showSpinny];
     
     // the principal must already be valid to get this far
     [associatedClient didEnterIdentity:expandedString options:options wantsChangePassword:YES];
         options = [glueController valueForKeyPath:options_keypath];
     }
     
-    [enterSpinny startAnimation:nil];
+    [self showSpinny];
 
     // the principal must already be valid to get this far
     [associatedClient didEnterIdentity:expandedString options:options wantsChangePassword:NO];
     if (!saveResponse) {
         saveResponse = [NSNumber numberWithBool:NO];
     }
-    [passwordSpinny startAnimation:nil];
-    [samSpinny startAnimation:nil];
+
+    [self showSpinny];
     [associatedClient didPromptForAuth:responseString
                           saveResponse:saveResponse];
 }
     NSString *newString = [glueController valueForKeyPath:new_password_keypath];
     NSString *verifyString = [glueController valueForKeyPath:verify_password_keypath];
     
-    [changePasswordSpinny startAnimation:nil];
+    [self showSpinny];
     
     [associatedClient didChangePassword:oldString
                             newPassword:newString