aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-08-03 00:01:13 +0000
committerrowanbeentje <rowan@beent.je>2012-08-03 00:01:13 +0000
commitb56622b7471907f6c0a09bc67a19c0ea031df23a (patch)
treeb073d729c8fe6d7ad9116badf67865b613d0ab62 /Source
parentf28bdfe2032a815743c52d103c7dfbd0adcc0c63 (diff)
downloadsequelpro-b56622b7471907f6c0a09bc67a19c0ea031df23a.tar.gz
sequelpro-b56622b7471907f6c0a09bc67a19c0ea031df23a.tar.bz2
sequelpro-b56622b7471907f6c0a09bc67a19c0ea031df23a.zip
- Remove all BWToolKit views from the QueryFavoriteManager and UserManagerView, replacing with SPSplitViews and standard equivalents
Diffstat (limited to 'Source')
-rw-r--r--Source/SPQueryFavoriteManager.h4
-rw-r--r--Source/SPQueryFavoriteManager.m33
-rw-r--r--Source/SPUserManager.h7
-rw-r--r--Source/SPUserManager.m10
-rw-r--r--Source/SPUserManagerDelegate.m19
5 files changed, 15 insertions, 58 deletions
diff --git a/Source/SPQueryFavoriteManager.h b/Source/SPQueryFavoriteManager.h
index 8b6d8561..a0a62bdd 100644
--- a/Source/SPQueryFavoriteManager.h
+++ b/Source/SPQueryFavoriteManager.h
@@ -31,8 +31,8 @@
// More info at <http://code.google.com/p/sequel-pro/>
@class SPTextView;
-@class BWAnchoredButtonBar;
@class SPDatabaseDocument;
+@class SPSplitView;
@interface NSObject (SPQueryFavoriteManagerDelegate)
@@ -56,8 +56,8 @@
IBOutlet NSTextField *favoriteNameTextField;
IBOutlet NSTextField *favoriteTabTriggerTextField;
IBOutlet SPTextView *favoriteQueryTextView;
+ IBOutlet SPSplitView *favoritesSplitView;
IBOutlet NSButton *removeButton;
- IBOutlet BWAnchoredButtonBar *splitViewButtonBar;
IBOutlet NSArrayController *favoritesArrayController;
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 136cd3b3..3d5a2e9a 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -38,10 +38,7 @@
#import "SPConnectionController.h"
#import "RegexKitLite.h"
#import "SPTextView.h"
-
-#ifndef SP_REFACTOR
-#import <BWToolkitFramework/BWAnchoredButtonBar.h>
-#endif
+#import "SPSplitView.h"
#define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]")
#define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]")
@@ -98,6 +95,10 @@
@"", @"query",
nil]];
+ // Set up the split view
+ [favoritesSplitView setMinSize:152.f ofSubviewAtIndex:0];
+ [favoritesSplitView setMinSize:385.f ofSubviewAtIndex:1];
+
#ifndef SP_REFACTOR
// Build data source for global queryFavorites (as mutable copy! otherwise each
// change will be stored in the prefs at once)
@@ -135,11 +136,6 @@
// Set Remove button state
[removeButton setEnabled:([favoritesTableView numberOfSelectedRows] > 0)];
-
-#ifndef SP_REFACTOR /* split view delegate */
- // Set the button bar delegate
- [splitViewButtonBar setSplitViewDelegate:self];
-#endif
}
#pragma mark -
@@ -476,25 +472,6 @@
}
#pragma mark -
-#pragma mark SplitView delegate methods
-
-/**
- * Return the maximum possible size of the splitview.
- */
-- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset
-{
- return (proposedMax - 240);
-}
-
-/**
- * Return the minimum possible size of the splitview.
- */
-- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset
-{
- return (proposedMin + 120);
-}
-
-#pragma mark -
#pragma mark TableView datasource methods
/**
diff --git a/Source/SPUserManager.h b/Source/SPUserManager.h
index 347a6602..b156cd4c 100644
--- a/Source/SPUserManager.h
+++ b/Source/SPUserManager.h
@@ -32,7 +32,7 @@
@class SPServerSupport;
@class SPMySQLConnection;
-@class BWAnchoredButtonBar;
+@class SPSplitView;
@interface SPUserManager : NSWindowController
{
@@ -43,7 +43,8 @@
SPMySQLConnection *connection;
SPServerSupport *serverSupport;
-
+
+ IBOutlet SPSplitView *splitView;
IBOutlet NSOutlineView *outlineView;
IBOutlet NSTabView *tabView;
IBOutlet NSTreeController *treeController;
@@ -68,8 +69,6 @@
IBOutlet NSWindow *errorsSheet;
IBOutlet NSTextView *errorsTextView;
- IBOutlet BWAnchoredButtonBar *splitViewButtonBar;
-
NSMutableArray *schemas;
NSMutableArray *grantedSchemaPrivs;
NSMutableArray *availablePrivs;
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index 8b9d66d2..655aa460 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -37,10 +37,10 @@
#import "SPConnectionController.h"
#import "SPServerSupport.h"
#import "SPAlertSheets.h"
+#import "SPSplitView.h"
#import <SPMySQL/SPMySQL.h>
#import <QueryKit/QueryKit.h>
-#import <BWToolkitFramework/BWAnchoredButtonBar.h>
static const NSString *SPTableViewNameColumnID = @"NameColumn";
@@ -117,15 +117,15 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
- (void)windowDidLoad
{
[tabView selectTabViewItemAtIndex:0];
-
+
+ [splitView setMinSize:120.f ofSubviewAtIndex:0];
+ [splitView setMinSize:620.f ofSubviewAtIndex:1];
+
NSTableColumn *tableColumn = [outlineView tableColumnWithIdentifier:SPTableViewNameColumnID];
ImageAndTextCell *imageAndTextCell = [[[ImageAndTextCell alloc] init] autorelease];
[imageAndTextCell setEditable:NO];
[tableColumn setDataCell:imageAndTextCell];
-
- // Set the button delegate
- [splitViewButtonBar setSplitViewDelegate:self];
// Set schema table double-click actions
[grantedTableView setDoubleAction:@selector(doubleClickSchemaPriv:)];
diff --git a/Source/SPUserManagerDelegate.m b/Source/SPUserManagerDelegate.m
index 1d52d2be..fde0e69f 100644
--- a/Source/SPUserManagerDelegate.m
+++ b/Source/SPUserManagerDelegate.m
@@ -56,25 +56,6 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges";
@implementation SPUserManager (SPUserManagerDelegate)
#pragma mark -
-#pragma mark SplitView delegate methods
-
-/**
- * Return the maximum possible size of the splitview.
- */
-- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset
-{
- return proposedMax - 620;
-}
-
-/**
- * Return the minimum possible size of the splitview.
- */
-- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset
-{
- return proposedMin + 120;
-}
-
-#pragma mark -
#pragma mark TableView Delegate Methods
- (void)tableViewSelectionDidChange:(NSNotification *)notification