diff options
| author | Justin Anderson <jander@mit.edu> | 2008-10-16 21:41:38 +0000 |
|---|---|---|
| committer | Justin Anderson <jander@mit.edu> | 2008-10-16 21:41:38 +0000 |
| commit | 077ccbfee3d205fe354bb1a7504fe8408d81c890 (patch) | |
| tree | a7ad7f30ebeff34922098e4474ee85785814cdf4 /src/kim/agent/mac/AuthenticationController.m | |
| parent | 5332906c28aa8871845c033b64dcc94e04389c60 (diff) | |
When change password is called from the Select Identity dialog, it appears as a sheet on that dialog instead of popping up as a separate window
ticket:6145
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20880 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kim/agent/mac/AuthenticationController.m')
| -rw-r--r-- | src/kim/agent/mac/AuthenticationController.m | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/src/kim/agent/mac/AuthenticationController.m b/src/kim/agent/mac/AuthenticationController.m index eeae53c8fb..0887ab5cec 100644 --- a/src/kim/agent/mac/AuthenticationController.m +++ b/src/kim/agent/mac/AuthenticationController.m @@ -338,7 +338,7 @@ [[self window] makeFirstResponder:samPromptField]; } -- (void) showChangePassword +- (void) showChangePassword: (NSWindow *) parentWindow { NSString *key = ([glueController valueForKeyPath:password_expired_keypath]) ? ACAppPrincReqKey : ACPrincReqKey; NSString *message = [NSString stringWithFormat: @@ -378,8 +378,19 @@ [self hideSpinny]; [self swapView:changePasswordView]; - - [self showWindow:nil]; + + // attach as sheet if given a parentWindow + if (parentWindow) { + [NSApp beginSheet:theWindow + modalForWindow:parentWindow + modalDelegate:self + didEndSelector:@selector(changePasswordSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; + } + // else, display as normal + else { + [self showWindow:nil]; + } [theWindow makeFirstResponder:oldPasswordField]; } @@ -468,7 +479,7 @@ [NSApp beginSheet:ticketOptionsSheet modalForWindow:[self window] modalDelegate:self - didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) + didEndSelector:@selector(ticketOptionsSheetDidEnd:returnCode:contextInfo:) contextInfo:NULL]; } @@ -482,9 +493,17 @@ [NSApp endSheet:ticketOptionsSheet]; } -- (void) sheetDidEnd: (NSWindow *) sheet - returnCode: (int) returnCode - contextInfo: (void *) contextInfo +- (void) changePasswordSheetDidEnd: (NSWindow *) sheet + returnCode: (int) returnCode + contextInfo: (void *) contextInfo +{ + [sheet orderOut:nil]; +} + + +- (void) ticketOptionsSheetDidEnd: (NSWindow *) sheet + returnCode: (int) returnCode + contextInfo: (void *) contextInfo { if (returnCode == NSUserCancelledError) { // discard new options @@ -551,6 +570,7 @@ - (IBAction) cancel: (id) sender { + [NSApp endSheet:[self window]]; [associatedClient didCancel]; } @@ -594,6 +614,7 @@ [associatedClient didChangePassword:oldString newPassword:newString verifyPassword:verifyString]; + [NSApp endSheet:[self window]]; } - (IBAction) showedError: (id) sender |
