From b56622b7471907f6c0a09bc67a19c0ea031df23a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Fri, 3 Aug 2012 00:01:13 +0000 Subject: - Remove all BWToolKit views from the QueryFavoriteManager and UserManagerView, replacing with SPSplitViews and standard equivalents --- Source/SPQueryFavoriteManager.h | 4 ++-- Source/SPQueryFavoriteManager.m | 33 +++++---------------------------- Source/SPUserManager.h | 7 +++---- Source/SPUserManager.m | 10 +++++----- Source/SPUserManagerDelegate.m | 19 ------------------- 5 files changed, 15 insertions(+), 58 deletions(-) (limited to 'Source') 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 @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 -#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 - @@ -475,25 +471,6 @@ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:NSLocalizedString(@"http://www.sequelpro.com/docs/Query_Favorites", @"Localized help page for query favourites - do not localize if no translated webpage is available")]]; } -#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 #import -#import 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 @@ -55,25 +55,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 -- cgit v1.2.3