diff options
author | stuconnolly <stuart02@gmail.com> | 2009-04-18 20:05:38 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-04-18 20:05:38 +0000 |
commit | 74dc396081a0a721105f3e95bd9b6f1f036d575a (patch) | |
tree | 2fc9bfb9cd502bf50a84d439127e0bd8fe75997d | |
parent | a91db057f3d376002184ee737198932f40ee57e1 (diff) | |
download | sequelpro-74dc396081a0a721105f3e95bd9b6f1f036d575a.tar.gz sequelpro-74dc396081a0a721105f3e95bd9b6f1f036d575a.tar.bz2 sequelpro-74dc396081a0a721105f3e95bd9b6f1f036d575a.zip |
Make SPPreferenceController the delegate of the favorites manager splitview and implement maximum and minimum split view sizes.
-rw-r--r-- | Interfaces/English.lproj/Preferences.xib | 64 | ||||
-rw-r--r-- | Source/SPPreferenceController.m | 60 |
2 files changed, 51 insertions, 73 deletions
diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 6649e164..c89e4312 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -8,6 +8,7 @@ <string key="IBDocument.HIToolboxVersion">353.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="403"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -52,7 +53,7 @@ <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> </object> <object class="NSCustomView" id="594324362"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -61,7 +62,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{151, 105}, {254, 26}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="562129977"> <int key="NSCellFlags">-2076049856</int> @@ -389,7 +389,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 152}, {209, 18}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="964808674"> <int key="NSCellFlags">67239424</int> @@ -417,7 +416,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{40, 180}, {108, 17}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="996600667"> <int key="NSCellFlags">67239488</int> @@ -450,7 +448,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{151, 174}, {254, 26}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="406329678"> <int key="NSCellFlags">-2076049856</int> @@ -483,7 +480,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{33, 111}, {116, 17}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="163779676"> <int key="NSCellFlags">67239424</int> @@ -500,7 +496,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 66}, {166, 18}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="530413242"> <int key="NSCellFlags">67239424</int> @@ -523,7 +518,6 @@ <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 140}, {326, 5}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -554,7 +548,6 @@ <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 92}, {326, 5}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -577,7 +570,6 @@ <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 53}, {326, 5}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -600,7 +592,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{38, 23}, {110, 17}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="899935643"> <int key="NSCellFlags">68288064</int> @@ -617,7 +608,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{153, 20}, {38, 22}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="875775803"> <int key="NSCellFlags">-1804468671</int> @@ -696,7 +686,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{197, 23}, {162, 17}}</string> <reference key="NSSuperview" ref="594324362"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="710086132"> <int key="NSCellFlags">68288064</int> @@ -710,12 +699,10 @@ </object> </object> <string key="NSFrameSize">{500, 218}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="395894064"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -724,7 +711,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 166}, {123, 18}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="7693853"> <int key="NSCellFlags">67239424</int> @@ -747,7 +733,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{29, 207}, {120, 17}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="524603578"> <int key="NSCellFlags">67239488</int> @@ -764,7 +749,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{374, 67}, {38, 17}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="596167553"> <int key="NSCellFlags">67239488</int> @@ -781,7 +765,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 206}, {106, 18}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="29938940"> <int key="NSCellFlags">-2080244224</int> @@ -804,7 +787,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 66}, {115, 18}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="920748663"> <int key="NSCellFlags">67239424</int> @@ -827,7 +809,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 186}, {105, 18}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="516443326"> <int key="NSCellFlags">-2080244224</int> @@ -850,7 +831,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{353, 61}, {19, 27}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSStepperCell" key="NSCell" id="1061407286"> <int key="NSCellFlags">917024</int> @@ -869,7 +849,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{273, 64}, {75, 22}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="585678618"> <int key="NSCellFlags">-1804468672</int> @@ -938,7 +917,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 22}, {131, 17}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="609090823"> <int key="NSCellFlags">68288064</int> @@ -955,7 +933,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{154, 20}, {75, 22}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="82744709"> <int key="NSCellFlags">-1804468671</int> @@ -974,7 +951,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 126}, {297, 18}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="441275"> <int key="NSCellFlags">67239424</int> @@ -997,7 +973,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 106}, {225, 18}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="561991963"> <int key="NSCellFlags">67239424</int> @@ -1020,7 +995,6 @@ <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 152}, {326, 5}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -1043,7 +1017,6 @@ <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 92}, {326, 5}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -1066,7 +1039,6 @@ <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 53}, {326, 5}}</string> <reference key="NSSuperview" ref="395894064"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -1086,12 +1058,10 @@ </object> </object> <string key="NSFrameSize">{500, 244}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="593732956"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1751,6 +1721,7 @@ </object> </object> <string key="NSFrameSize">{500, 381}</string> + <reference key="NSSuperview"/> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="1041614321"> @@ -1974,7 +1945,7 @@ AQAAAAA</bytes> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="769132533"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1983,7 +1954,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{12, 56}, {137, 17}}</string> <reference key="NSSuperview" ref="769132533"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="1057393276"> <int key="NSCellFlags">67239488</int> @@ -2000,7 +1970,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{152, 18}, {166, 18}}</string> <reference key="NSSuperview" ref="769132533"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="151662644"> <int key="NSCellFlags">-2080244224</int> @@ -2023,7 +1992,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{154, 53}, {50, 22}}</string> <reference key="NSSuperview" ref="769132533"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="170658213"> <int key="NSCellFlags">-1804468671</int> @@ -2088,7 +2056,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{209, 56}, {56, 17}}</string> <reference key="NSSuperview" ref="769132533"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="619604330"> <int key="NSCellFlags">67239488</int> @@ -2105,7 +2072,6 @@ AQAAAAA</bytes> <int key="NSvFlags">12</int> <string key="NSFrame">{{154, 42}, {326, 5}}</string> <reference key="NSSuperview" ref="769132533"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2125,15 +2091,9 @@ AQAAAAA</bytes> </object> </object> <string key="NSFrameSize">{500, 93}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> <string key="NSClassName">NSView</string> </object> <object class="NSUserDefaultsController" id="151174232"> - <object class="NSMutableArray" key="NSDeclaredKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>CustomQueryMaxHistoryItems</string> - </object> <bool key="NSSharedInstance">YES</bool> </object> <object class="NSArrayController" id="937123943"> @@ -3202,6 +3162,14 @@ AQAAAAA</bytes> </object> <int key="connectionID">800</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="141072039"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">801</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -4894,7 +4862,7 @@ AQAAAAA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> - <string>{{424, 424}, {500, 381}}</string> + <string>{{499, 188}, {500, 381}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5175,7 +5143,7 @@ AQAAAAA</bytes> </object> </object> <nil key="sourceID"/> - <int key="maxID">800</int> + <int key="maxID">801</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 8ea4e7f0..0d44a373 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -217,7 +217,6 @@ [prefs setObject:[NSNumber numberWithInt:currentVersionNumber] forKey:@"LastUsedVersion"]; } - #pragma mark - #pragma mark IBAction methods @@ -319,7 +318,6 @@ } - // ------------------------------------------------------------------------------- // updateDefaultFavorite: // ------------------------------------------------------------------------------- @@ -335,7 +333,6 @@ } } - #pragma mark - #pragma mark Toolbar item IBAction methods @@ -505,7 +502,6 @@ return YES; } - #pragma mark - #pragma mark TableView delegate methods @@ -599,16 +595,24 @@ return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, nil]; } +#pragma mark - +#pragma mark SplitView delegate methods + // ------------------------------------------------------------------------------- -// dealloc +// splitView:constrainMaxCoordinate:ofSubviewAt: // ------------------------------------------------------------------------------- -- (void)dealloc +- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset { - [keychain release], keychain = nil; - - [super dealloc]; + return (proposedMax - 220); } +// ------------------------------------------------------------------------------- +// splitView:constrainMinCoordinate:ofSubviewAt: +// ------------------------------------------------------------------------------- +- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset +{ + return (proposedMin + 100); +} #pragma mark - #pragma mark TextField delegate methods @@ -667,7 +671,6 @@ return YES; } - #pragma mark - #pragma mark Window delegate methods @@ -677,17 +680,14 @@ // ------------------------------------------------------------------------------- - (void)windowWillClose:(NSNotification *)notification { - // Mark the currently selected field in the window as having finished editing, to trigger saves. if ([preferencesWindow firstResponder]) [preferencesWindow endEditingFor:[preferencesWindow firstResponder]]; } - #pragma mark - #pragma mark Other - // ------------------------------------------------------------------------------- // updateDefaultFavoritePopup: // @@ -728,9 +728,17 @@ [favoritesController setSelectedObjects:favorites]; } -@end - +// ------------------------------------------------------------------------------- +// dealloc +// ------------------------------------------------------------------------------- +- (void)dealloc +{ + [keychain release], keychain = nil; + + [super dealloc]; +} +@end #pragma mark - @@ -811,18 +819,20 @@ - (void)_resizeWindowForContentView:(NSView *)view { // remove all current views - NSEnumerator *en = [[[preferencesWindow contentView] subviews] objectEnumerator]; - NSView *subview; - while (subview = [en nextObject]) { - [subview removeFromSuperview]; - } + NSEnumerator *en = [[[preferencesWindow contentView] subviews] objectEnumerator]; + NSView *subview; + + while (subview = [en nextObject]) + { + [subview removeFromSuperview]; + } - // resize window - [preferencesWindow resizeForContentView:view titleBarVisible:YES]; + // resize window + [preferencesWindow resizeForContentView:view titleBarVisible:YES]; - // add view - [[preferencesWindow contentView] addSubview:view]; - [view setFrameOrigin:NSMakePoint(0, 0)]; + // add view + [[preferencesWindow contentView] addSubview:view]; + [view setFrameOrigin:NSMakePoint(0, 0)]; } @end |