- (IBAction) showWindow: (id) sender
{
- [[self window] center];
+
[super showWindow:sender];
}
[glueController setValue:message
forKeyPath:message_keypath];
- [[containerView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [theWindow setFrame:[theWindow frameRectForContentRect:[identityView frame]] display:NO];
- [containerView addSubview:identityView];
-
[enterSpinny stopAnimation:nil];
-
+
+ [self swapView:identityView];
+
[theWindow makeFirstResponder:identityField];
- [self showWindow:nil];
+
+ [[self window] makeKeyAndOrderFront:nil];
}
- (void) showAuthPrompt
// set badge
[passwordBadge setBadgePath:associatedClient.path];
-
- frame = [passwordView frame];
- [[containerView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [theWindow setFrame:[theWindow frameRectForContentRect:frame] display:NO];
- [containerView addSubview:passwordView];
-
+
// adjust for checkbox visibility
- if (![[glueController valueForKeyPath:allow_save_password_keypath] boolValue]) {
- frame = [theWindow frame];
+ if (![[glueController valueForKeyPath:allow_save_password_keypath] boolValue] &&
+ ![rememberPasswordInKeychainCheckBox isHidden]) {
+ [rememberPasswordInKeychainCheckBox setHidden:YES];
+ frame = [passwordView frame];
shrinkBy = ([passwordField frame].origin.y -
[rememberPasswordInKeychainCheckBox frame].origin.y);
- frame.origin.y += shrinkBy;
frame.size.height -= shrinkBy;
- [theWindow setFrame:frame display:NO];
+ [passwordView setFrame:frame];
}
+ [self swapView:passwordView];
+
[theWindow makeFirstResponder:passwordField];
[self showWindow:nil];
}
-- (void) showSAM
+- (void) swapView: (NSView *) aView
{
NSWindow *theWindow = [self window];
+ NSRect windowFrame;
+ NSRect viewFrame;
+
+ [[containerView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
+
+ windowFrame = [theWindow frame];
+ viewFrame = [theWindow frameRectForContentRect:[aView frame]];
+ windowFrame.origin.y -= viewFrame.size.height - windowFrame.size.height;
+
+ windowFrame.size.width = viewFrame.size.width;
+ windowFrame.size.height = viewFrame.size.height;
+
+ [theWindow setFrame:windowFrame display:YES animate:YES];
+
+ [containerView addSubview:aView];
+
+}
+- (void) showSAM
+{
// set badge
[samBadge setBadgePath:associatedClient.path];
[glueController setValue:[NSNumber numberWithBool:NO]
forKeyPath:allow_save_password_keypath];
- [[containerView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [theWindow setFrame:[theWindow frameRectForContentRect:[samView frame]] display:NO];
- [containerView addSubview:samView];
+ [self swapView:samView];
[self showWindow:nil];
[[self window] makeFirstResponder:samPromptField];
// Your password has expired, would you like to change it?
}
[glueController setValue:message forKeyPath:message_keypath];
-
- // wake up the nib connections and adjust window size
- [[containerView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [theWindow setFrame:[theWindow frameRectForContentRect:[changePasswordView frame]] display:NO];
- // set up controls with info from associatedClient
- [containerView addSubview:changePasswordView];
+
// set badge
[changePasswordBadge setBadgePath:associatedClient.path];
[changePasswordSpinny stopAnimation:nil];
+ [self swapView:changePasswordView];
+
[self showWindow:nil];
[theWindow makeFirstResponder:oldPasswordField];
}
{
// wake up the nib connections and adjust window size
[self window];
- // set up controls with info from associatedClient
- [[containerView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [containerView addSubview:errorView];
// set badge
[errorBadge setBadgePath:associatedClient.path];
+
+ [self swapView:errorView];
[self showWindow:nil];
}
- (IBAction) cancel: (id) sender
{
[associatedClient didCancel];
- [self close];
}
- (IBAction) enterIdentity: (id) sender
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="300288"/>
<integer value="19"/>
+ <integer value="300175"/>
<integer value="300420"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="866582848">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<string key="NSFrameSize">{500, 208}</string>
+ <reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="898191415">
</object>
<int key="connectionID">300416</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">hidden: selection.allow_save</string>
- <reference key="source" ref="645528597"/>
- <reference key="destination" ref="57033499"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="645528597"/>
- <reference key="NSDestination" ref="57033499"/>
- <string key="NSLabel">hidden: selection.allow_save</string>
- <string key="NSBinding">hidden</string>
- <string key="NSKeyPath">selection.allow_save</string>
- <object class="NSDictionary" key="NSOptions">
- <string key="NS.key.0">NSValueTransformerName</string>
- <string key="NS.object.0">NSNegateBoolean</string>
- </object>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">300417</int>
- </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">ticketOptionsSheet</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{628, 646}, {500, 210}}</string>
<reference ref="9"/>
- <reference ref="9"/>
+ <integer value="0"/>
<string>{{932, 664}, {484, 199}}</string>
<reference ref="9"/>
<reference ref="9"/>