From: Justin Anderson Date: Wed, 8 Oct 2008 22:14:27 +0000 (+0000) Subject: Ignore user interaction while busy. Done by toggling ignoresMouseEvents on auth dialogs X-Git-Tag: krb5-1.7-alpha1~331 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f889d2615889dc055da699c70e3b06f6ad30baca;p=krb5.git Ignore user interaction while busy. Done by toggling ignoresMouseEvents on auth dialogs ticket:6144 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20845 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kim/agent/mac/AuthenticationController.h b/src/kim/agent/mac/AuthenticationController.h index 3d382c117..489fd20e5 100644 --- a/src/kim/agent/mac/AuthenticationController.h +++ b/src/kim/agent/mac/AuthenticationController.h @@ -105,5 +105,7 @@ - (IBAction) changePasswordGearAction: (id) sender; - (void) swapView: (NSView *) aView; +- (void) showSpinny; +- (void) hideSpinny; @end diff --git a/src/kim/agent/mac/AuthenticationController.m b/src/kim/agent/mac/AuthenticationController.m index 1b9117594..20c971796 100644 --- a/src/kim/agent/mac/AuthenticationController.m +++ b/src/kim/agent/mac/AuthenticationController.m @@ -218,7 +218,7 @@ [glueController setValue:message forKeyPath:message_keypath]; - [enterSpinny stopAnimation:nil]; + [self hideSpinny]; [self swapView:identityView]; @@ -231,8 +231,7 @@ { uint32_t type = [[glueController valueForKeyPath:@"content.prompt_type"] unsignedIntegerValue]; - [passwordSpinny stopAnimation:nil]; - [samSpinny stopAnimation:nil]; + [self hideSpinny]; switch (type) { case kim_prompt_type_password : @@ -307,6 +306,24 @@ } +- (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 @@ -358,7 +375,7 @@ // set badge [changePasswordBadge setBadgePath:associatedClient.path]; - [changePasswordSpinny stopAnimation:nil]; + [self hideSpinny]; [self swapView:changePasswordView]; @@ -515,7 +532,7 @@ 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]; @@ -535,7 +552,7 @@ 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]; @@ -549,8 +566,8 @@ if (!saveResponse) { saveResponse = [NSNumber numberWithBool:NO]; } - [passwordSpinny startAnimation:nil]; - [samSpinny startAnimation:nil]; + + [self showSpinny]; [associatedClient didPromptForAuth:responseString saveResponse:saveResponse]; } @@ -561,7 +578,7 @@ NSString *newString = [glueController valueForKeyPath:new_password_keypath]; NSString *verifyString = [glueController valueForKeyPath:verify_password_keypath]; - [changePasswordSpinny startAnimation:nil]; + [self showSpinny]; [associatedClient didChangePassword:oldString newPassword:newString