aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-18 00:44:03 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-18 00:44:03 +0000
commit1c7cf0aa49e68714dbfc4d7ca01fccd519e22aee (patch)
tree151136a6f76aa3cf431dc19a2971894462edec90
parentd916e1e1514cd60bd9228ceab4c3cf27398a8b05 (diff)
downloadsequelpro-1c7cf0aa49e68714dbfc4d7ca01fccd519e22aee.tar.gz
sequelpro-1c7cf0aa49e68714dbfc4d7ca01fccd519e22aee.tar.bz2
sequelpro-1c7cf0aa49e68714dbfc4d7ca01fccd519e22aee.zip
Manually set the delegate of the anchored button bars in the content filter editor and query favorites editor as you can't do it in IB.
-rw-r--r--Interfaces/English.lproj/ContentFilterManager.xib22
-rw-r--r--Interfaces/English.lproj/QueryFavoriteManager.xib21
-rw-r--r--Source/SPContentFilterManager.h4
-rw-r--r--Source/SPContentFilterManager.m6
-rw-r--r--Source/SPQueryFavoriteManager.h5
-rw-r--r--Source/SPQueryFavoriteManager.m19
6 files changed, 53 insertions, 24 deletions
diff --git a/Interfaces/English.lproj/ContentFilterManager.xib b/Interfaces/English.lproj/ContentFilterManager.xib
index 7228ee55..6605c651 100644
--- a/Interfaces/English.lproj/ContentFilterManager.xib
+++ b/Interfaces/English.lproj/ContentFilterManager.xib
@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">10B504</string>
+ <string key="IBDocument.SystemVersion">10C540</string>
<string key="IBDocument.InterfaceBuilderVersion">740</string>
- <string key="IBDocument.AppKitVersion">1038.2</string>
- <string key="IBDocument.HIToolboxVersion">437.00</string>
+ <string key="IBDocument.AppKitVersion">1038.25</string>
+ <string key="IBDocument.HIToolboxVersion">458.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
@@ -1322,6 +1322,14 @@
</object>
<int key="connectionID">367</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">splitViewButtonBar</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="12172024"/>
+ </object>
+ <int key="connectionID">368</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -1925,9 +1933,9 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{627, 417}, {500, 371}}</string>
+ <string>{{571, 417}, {500, 371}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{627, 417}, {500, 371}}</string>
+ <string>{{571, 417}, {500, 371}}</string>
<boolean value="NO"/>
<string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string>
@@ -2114,7 +2122,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">367</int>
+ <int key="maxID">368</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -2294,6 +2302,7 @@
<string>removeButton</string>
<string>resultingClauseContentLabel</string>
<string>resultingClauseLabel</string>
+ <string>splitViewButtonBar</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2309,6 +2318,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>BWAnchoredButtonBar</string>
</object>
</object>
<reference key="sourceIdentifier" ref="559035321"/>
diff --git a/Interfaces/English.lproj/QueryFavoriteManager.xib b/Interfaces/English.lproj/QueryFavoriteManager.xib
index bfa36ff3..f45e707e 100644
--- a/Interfaces/English.lproj/QueryFavoriteManager.xib
+++ b/Interfaces/English.lproj/QueryFavoriteManager.xib
@@ -21,7 +21,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="14"/>
+ <integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -573,7 +573,6 @@
<string>Apple PNG pasteboard type</string>
<string>Apple URL pasteboard type</string>
<string>CorePasteboardFlavorType 0x6D6F6F76</string>
- <string>CorePasteboardFlavorType 0x75726C20</string>
<string>NSColor pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NSStringPboardType</string>
@@ -1195,6 +1194,14 @@
</object>
<int key="connectionID">300</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">splitViewButtonBar</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="12172024"/>
+ </object>
+ <int key="connectionID">301</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -1669,9 +1676,9 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{418, 306}, {500, 371}}</string>
+ <string>{{417, 428}, {500, 371}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{418, 306}, {500, 371}}</string>
+ <string>{{417, 428}, {500, 371}}</string>
<boolean value="NO"/>
<string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string>
@@ -1819,7 +1826,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">300</int>
+ <int key="maxID">301</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1997,6 +2004,7 @@
<string>favoritesArrayController</string>
<string>favoritesTableView</string>
<string>removeButton</string>
+ <string>splitViewButtonBar</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2005,7 +2013,8 @@
<string>NSTextView</string>
<string>NSArrayController</string>
<string>NSTableView</string>
- <string>id</string>
+ <string>NSButton</string>
+ <string>BWAnchoredButtonBar</string>
</object>
</object>
<reference key="sourceIdentifier" ref="110708609"/>
diff --git a/Source/SPContentFilterManager.h b/Source/SPContentFilterManager.h
index 441e8b43..f8ffe16e 100644
--- a/Source/SPContentFilterManager.h
+++ b/Source/SPContentFilterManager.h
@@ -25,6 +25,8 @@
#import <Cocoa/Cocoa.h>
+@class BWAnchoredButtonBar;
+
@interface NSObject (SPContentFilterManagerDelegate)
- (void)contentFiltersHaveBeenUpdated:(id)manager;
@@ -47,6 +49,8 @@
IBOutlet id resultingClauseLabel;
IBOutlet id resultingClauseContentLabel;
IBOutlet id insertPlaceholderButton;
+
+ IBOutlet BWAnchoredButtonBar *splitViewButtonBar;
IBOutlet id contentFilterArrayController;
diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m
index 2fd22dfd..33be5048 100644
--- a/Source/SPContentFilterManager.m
+++ b/Source/SPContentFilterManager.m
@@ -29,6 +29,7 @@
#import "SPQueryController.h"
#import "TableContent.h"
#import "SPConstants.h"
+#import "SPConnectionController.h"
#define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]")
#define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]")
@@ -75,7 +76,6 @@
*/
- (void)awakeFromNib
{
-
[contentFilterTextView setAllowsDocumentBackgroundColorChange:YES];
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
@@ -141,6 +141,8 @@
// Set column header
[[[contentFilterTableView tableColumnWithIdentifier:@"MenuLabel"] headerCell] setStringValue:[NSString stringWithFormat:NSLocalizedString(@"‘%@’ Fields Content Filters", @"content filter for field type ‘%@’"), filterType]];
+ // Set the button delegate
+ [splitViewButtonBar setSplitViewDelegate:self];
}
#pragma mark -
@@ -384,7 +386,7 @@
*/
- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset
{
- return (proposedMax - 220);
+ return (proposedMax - 245);
}
/**
diff --git a/Source/SPQueryFavoriteManager.h b/Source/SPQueryFavoriteManager.h
index 1546186e..9318ed22 100644
--- a/Source/SPQueryFavoriteManager.h
+++ b/Source/SPQueryFavoriteManager.h
@@ -25,6 +25,8 @@
#import <Cocoa/Cocoa.h>
+@class BWAnchoredButtonBar;
+
@interface NSObject (SPQueryFavoriteManagerDelegate)
- (void)queryFavoritesHaveBeenUpdated:(id)manager;
@@ -40,7 +42,8 @@
IBOutlet NSTableView *favoritesTableView;
IBOutlet NSTextField *favoriteNameTextField;
IBOutlet NSTextView *favoriteQueryTextView;
- IBOutlet id removeButton;
+ IBOutlet NSButton *removeButton;
+ IBOutlet BWAnchoredButtonBar *splitViewButtonBar;
IBOutlet NSArrayController *favoritesArrayController;
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 8acf2f0a..dc1cfdcf 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -28,6 +28,7 @@
#import "SPEncodingPopupAccessory.h"
#import "SPQueryController.h"
#import "SPConstants.h"
+#import "SPConnectionController.h"
#define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]")
#define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]")
@@ -73,7 +74,6 @@
*/
- (void)awakeFromNib
{
-
[favoriteQueryTextView setAllowsDocumentBackgroundColorChange:YES];
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
@@ -110,12 +110,11 @@
[favorites addObject:[[fav mutableCopy] autorelease]];
}
-
- // Select the first query if any
- NSUInteger i = 0;
- for(i=0; i < [favorites count]; i++ )
- if(![[favorites objectAtIndex:i] objectForKey:@"headerOfFileURL"])
- break;
+ // Select the first query if any
+ for (NSDictionary *favorite in favorites)
+ {
+ if (![favorite objectForKey:@"headerOfFileURL"]) break;
+ }
[[self window] makeFirstResponder:favoritesTableView];
[self _initWithNoSelection];
@@ -128,7 +127,9 @@
// Set Remove button state
[removeButton setEnabled:([favoritesTableView numberOfSelectedRows] > 0)];
-
+
+ // Set the button delegate
+ [splitViewButtonBar setSplitViewDelegate:self];
}
#pragma mark -
@@ -388,7 +389,7 @@
*/
- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset
{
- return (proposedMax - 220);
+ return (proposedMax - 240);
}
/**