KerberosAgent should handle zoom button better
authorJustin Anderson <jander@mit.edu>
Wed, 8 Oct 2008 02:01:06 +0000 (02:01 +0000)
committerJustin Anderson <jander@mit.edu>
Wed, 8 Oct 2008 02:01:06 +0000 (02:01 +0000)
The Select Identity dialog should resize to fit the available identities in its table when the zoom button is clicked.

ticket: new
status: open

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

src/kim/agent/mac/SelectIdentityController.h
src/kim/agent/mac/SelectIdentityController.m
src/kim/agent/mac/resources/English.lproj/SelectIdentity.xib

index 29b3c0dd4c7c16be1cc001c0fcd567c2acd3c9ed..ece2de9e9eee625d4214a00d933185fe6da8e884 100644 (file)
@@ -42,6 +42,7 @@
     IBOutlet NSTextField *headerTextField;
     IBOutlet NSTextField *explanationTextField;
     
+    IBOutlet NSScrollView *identityTableScrollView;
     IBOutlet NSTableView *identityTableView;
     IBOutlet NSButton *addIdentityButton;
     IBOutlet NSPopUpButton *actionPopupButton;
index 4ad47c93ecb604f9a3e76a28ea2425266a8dac2e..44fc30bc88b16bde8bc19faf2290e57367130826 100644 (file)
 
 // ---------------------------------------------------------------------------
 
+- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
+{
+    NSRect newFrame = [window frame];
+    CGFloat oldHeight = [[identityTableScrollView contentView] frame].size.height;
+    CGFloat newHeight = [identityTableView numberOfRows] * 
+                        ([identityTableView rowHeight] + [identityTableView intercellSpacing].height);
+    CGFloat yDelta = newHeight - oldHeight;
+    
+    newFrame.origin.y -= yDelta;
+    newFrame.size.height += yDelta;
+    
+    return newFrame;
+}
+
+// ---------------------------------------------------------------------------
+
 - (void) setContent: (NSMutableDictionary *) newContent
 {
     [self window]; // wake up the nib connections
index 0bc766914415a2e3a748de2d5ecccffc45f12d23..c588d9157ad145bf3c49620c9901a4b8fa9f1a10 100644 (file)
                                                                                </object>
                                                                        </object>
                                                                </object>
-                                                               <int key="NSSelectedIndex">3</int>
                                                                <bool key="NSPullDown">YES</bool>
                                                                <int key="NSPreferredEdge">2</int>
                                                                <bool key="NSUsesItemFromMenu">YES</bool>
                                <nil key="NSViewClass"/>
                                <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
                                <object class="NSView" key="NSWindowView" id="1019868804">
-                                       <reference key="NSNextResponder"/>
+                                       <nil key="NSNextResponder"/>
                                        <int key="NSvFlags">258</int>
                                        <object class="NSMutableArray" key="NSSubviews">
                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <int key="NSvFlags">266</int>
                                                        <string key="NSFrame">{{78, 306}, {329, 22}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="1047482753">
                                                                <int key="NSCellFlags">-1804468671</int>
                                                        <int key="NSvFlags">268</int>
                                                        <string key="NSFrame">{{17, 308}, {60, 17}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="775341038">
                                                                <int key="NSCellFlags">68288064</int>
                                                                                        <int key="NSvFlags">266</int>
                                                                                        <string key="NSFrame">{{24, 179}, {337, 25}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSSliderCell" key="NSCell" id="629844970">
                                                                                                <int key="NSCellFlags">67501824</int>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{13, 211}, {185, 17}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSTextFieldCell" key="NSCell" id="380679549">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">266</int>
                                                                                        <string key="NSFrame">{{23, 157}, {339, 14}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSTextFieldCell" key="NSCell" id="584202005">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{13, 132}, {133, 17}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSTextFieldCell" key="NSCell" id="638526338">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">266</int>
                                                                                        <string key="NSFrame">{{42, 34}, {301, 25}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSSliderCell" key="NSCell" id="84127609">
                                                                                                <int key="NSCellFlags">67501824</int>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{24, 86}, {303, 18}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSButtonCell" key="NSCell" id="878349972">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{24, 108}, {351, 18}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSButtonCell" key="NSCell" id="77611886">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{24, 64}, {248, 18}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSButtonCell" key="NSCell" id="583273626">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">266</int>
                                                                                        <string key="NSFrame">{{41, 12}, {303, 14}}</string>
                                                                                        <reference key="NSSuperview" ref="929379"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSTextFieldCell" key="NSCell" id="596249502">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                        </object>
                                                                        <string key="NSFrame">{{3, 3}, {387, 238}}</string>
                                                                        <reference key="NSSuperview" ref="282101470"/>
-                                                                       <reference key="NSWindow"/>
                                                                </object>
                                                        </object>
                                                        <string key="NSFrame">{{17, 56}, {393, 244}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <string key="NSOffsets">{0, 0}</string>
                                                        <object class="NSTextFieldCell" key="NSTitleCell">
                                                                <int key="NSCellFlags">67239424</int>
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{331, 12}, {82, 32}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSButtonCell" key="NSCell" id="870649207">
                                                                <int key="NSCellFlags">67239424</int>
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{249, 12}, {82, 32}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSButtonCell" key="NSCell" id="754483226">
                                                                <int key="NSCellFlags">67239424</int>
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{129, 12}, {120, 32}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSButtonCell" key="NSCell" id="362266618">
                                                                <int key="NSCellFlags">67239424</int>
                                                        <int key="NSvFlags">-2147483380</int>
                                                        <string key="NSFrame">{{75, 308}, {335, 17}}</string>
                                                        <reference key="NSSuperview" ref="1019868804"/>
-                                                       <reference key="NSWindow"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="196100637">
                                                                <int key="NSCellFlags">68288064</int>
                                                </object>
                                        </object>
                                        <string key="NSFrameSize">{427, 348}</string>
-                                       <reference key="NSSuperview"/>
-                                       <reference key="NSWindow"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
                                <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
                                                        <string key="NSKeyPath">arrangedObjects.identity</string>
                                                        <object class="NSDictionary" key="NSOptions">
                                                                <string key="NS.key.0">NSConditionallySetsEditable</string>
-                                                               <integer value="1" key="NS.object.0" id="5"/>
+                                                               <reference key="NS.object.0" ref="9"/>
                                                        </object>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                                        <string key="NSKeyPath">selection.identity_string</string>
                                                        <object class="NSDictionary" key="NSOptions">
                                                                <string key="NS.key.0">NSContinuouslyUpdatesValue</string>
-                                                               <reference key="NS.object.0" ref="5"/>
+                                                               <reference key="NS.object.0" ref="9"/>
                                                        </object>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
                                        <int key="connectionID">300510</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">identityTableScrollView</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="616284695"/>
+                                       </object>
+                                       <int key="connectionID">300511</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                        <reference ref="9"/>
                                        <string>{{503, 256}, {419, 465}}</string>
                                        <reference ref="9"/>
-                                       <reference ref="5"/>
+                                       <reference ref="9"/>
                                        <string>{800, 800}</string>
                                        <string>{400, 273}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">300510</int>
+                       <int key="maxID">300511</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
                                                        <string>identityField</string>
                                                        <string>identityOptionsController</string>
                                                        <string>identityOptionsWindow</string>
+                                                       <string>identityTableScrollView</string>
                                                        <string>identityTableView</string>
                                                        <string>kerberosIconImageView</string>
                                                        <string>longTimeFormatter</string>
                                                        <string>NSTextField</string>
                                                        <string>NSObjectController</string>
                                                        <string>NSWindow</string>
+                                                       <string>NSScrollView</string>
                                                        <string>NSTableView</string>
                                                        <string>BadgedImageView</string>
                                                        <string>KerberosTimeFormatter</string>