From 2dc02505710b3980704637e7c7647057ef3c0e14 Mon Sep 17 00:00:00 2001 From: sqlprodev Date: Thu, 5 Jul 2012 19:02:47 +0000 Subject: A few more tweaks for SP r3710 merge with Coda --- Source/SPConnectionControllerDataSource.m | 4 ++++ Source/SPConnectionControllerDelegate.h | 5 +++- Source/SPConnectionControllerDelegate.m | 38 ++++++++++++++++++++++++++++++ Source/SPConnectionControllerInitializer.m | 11 ++++++++- 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/Source/SPConnectionControllerDataSource.m b/Source/SPConnectionControllerDataSource.m index e7fea0c6..9deacedc 100644 --- a/Source/SPConnectionControllerDataSource.m +++ b/Source/SPConnectionControllerDataSource.m @@ -38,6 +38,8 @@ @implementation SPConnectionController (SPConnectionControllerDataSource) +#ifndef SP_REFACTOR + - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { SPTreeNode *node = (item == nil ? favoritesRoot : (SPTreeNode *)item); @@ -90,4 +92,6 @@ } } +#endif + @end diff --git a/Source/SPConnectionControllerDelegate.h b/Source/SPConnectionControllerDelegate.h index 23d29b9b..ea814fbd 100644 --- a/Source/SPConnectionControllerDelegate.h +++ b/Source/SPConnectionControllerDelegate.h @@ -34,6 +34,9 @@ * * Connection controller delegate category. */ -@interface SPConnectionController (SPConnectionControllerDelegate) +@interface SPConnectionController (SPConnectionControllerDelegate) +#ifndef SP_REFACTOR + +#endif @end diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 905e1a56..91d8ce3f 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -24,6 +24,7 @@ // More info at #import "SPConnectionControllerDelegate.h" +#ifndef SP_REFACTOR #import "SPFavoritesController.h" #import "SPTableTextFieldCell.h" #import "SPPreferenceController.h" @@ -32,6 +33,7 @@ #import "SPFavoriteNode.h" #import "SPGroupNode.h" #import "SPTreeNode.h" +#endif static NSString *SPDatabaseImage = @"database-small"; @@ -54,6 +56,8 @@ static NSString *SPDatabaseImage = @"database-small"; #pragma mark - #pragma mark SplitView delegate methods +#ifndef SP_REFACTOR + - (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex { return [connectionSplitViewButtonBar splitView:splitView additionalEffectiveRectOfDividerAtIndex:dividerIndex]; @@ -68,9 +72,13 @@ static NSString *SPDatabaseImage = @"database-small"; [databaseConnectionView setPosition:[[[connectionSplitView subviews] objectAtIndex:0] frame].size.width ofDividerAtIndex:0]; } +#endif + #pragma mark - #pragma mark Outline view delegate methods +#ifndef SP_REFACTOR + - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item { return ([[(SPTreeNode *)item parentNode] parentNode] == nil); @@ -182,9 +190,13 @@ static NSString *SPDatabaseImage = @"database-small"; [self _setNodeIsExpanded:YES fromNotification:notification]; } +#endif + #pragma mark - #pragma mark Outline view drag & drop +#ifndef SP_REFACTOR + - (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard { @@ -324,9 +336,13 @@ static NSString *SPDatabaseImage = @"database-small"; return acceptedDrop; } +#endif + #pragma mark - #pragma mark Textfield delegate methods +#ifndef SP_REFACTOR + /** * Trap and control the 'name' field of the selected favorite. If the user pressed * 'Add Favorite' the 'name' field is set to 'New Favorite'. If the user did not @@ -423,9 +439,13 @@ static NSString *SPDatabaseImage = @"database-small"; return YES; } +#endif + #pragma mark - #pragma mark Tab bar delegate methods +#ifndef SP_REFACTOR + /** * Trigger a resize action whenever the tab view changes. The connection * detail forms are held within container views, which are of a fixed width; @@ -454,9 +474,13 @@ static NSString *SPDatabaseImage = @"database-small"; [self _favoriteTypeDidChange]; } +#endif + #pragma mark - #pragma mark Scroll view notifications +#ifndef SP_REFACTOR + /** * As the scrollview resizes, keep the details centered within it if * the detail frame is larger than the scrollview size; otherwise, pin @@ -486,9 +510,13 @@ static NSString *SPDatabaseImage = @"database-small"; } } +#endif + #pragma mark - #pragma mark Menu Validation +#ifndef SP_REFACTOR + /** * Menu item validation. */ @@ -549,9 +577,13 @@ static NSString *SPDatabaseImage = @"database-small"; return YES; } +#endif + #pragma mark - #pragma mark Favorites import/export delegate methods +#ifndef SP_REFACTOR + /** * Called by the favorites exporter when the export completes. */ @@ -608,9 +640,13 @@ static NSString *SPDatabaseImage = @"database-small"; } } +#endif + #pragma mark - #pragma mark Private API +#ifndef SP_REFACTOR + /** * Sets the expanded state of the node from the supplied outline view notification. * @@ -624,4 +660,6 @@ static NSString *SPDatabaseImage = @"database-small"; [node setNodeIsExpanded:expanded]; } +#endif + @end diff --git a/Source/SPConnectionControllerInitializer.m b/Source/SPConnectionControllerInitializer.m index 675c8f62..8a30bf40 100644 --- a/Source/SPConnectionControllerInitializer.m +++ b/Source/SPConnectionControllerInitializer.m @@ -57,8 +57,10 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; // Weak reference dbDocument = document; +#ifndef SP_REFACTOR databaseConnectionSuperview = [dbDocument databaseView]; databaseConnectionView = [dbDocument valueForKey:@"contentViewSplitter"]; +#endif // Keychain references connectionKeychainID = nil; @@ -79,6 +81,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; [self loadNib]; [self registerForNotifications]; +#ifndef SP_REFACTOR // Hide the main view and position and display the connection view [databaseConnectionView setHidden:YES]; [connectionView setFrame:[databaseConnectionView frame]]; @@ -117,6 +120,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; // Set sort items currentSortItem = (SPFavoritesSortItem)[prefs integerForKey:SPFavoritesSortedBy]; reverseFavoritesSort = [prefs boolForKey:SPFavoritesSortedInReverse]; +#endif initComplete = YES; } @@ -270,6 +274,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; */ - (void)setUpSelectedConnectionFavorite { +#ifndef SP_REFACTOR SPTreeNode *favorite = [self _favoriteNodeForFavoriteID:[prefs integerForKey:[prefs boolForKey:SPSelectLastFavoriteUsed] ? SPLastFavoriteID : SPDefaultFavorite]]; if (favorite) { @@ -288,6 +293,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; [self resizeTabViewToConnectionType:SPTCPIPConnection animating:NO]; } +#endif } #pragma mark - @@ -299,7 +305,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; */ - (void)_processFavoritesDataChange:(NSNotification *)aNotification { - +#ifndef SP_REFACTOR // Check the supplied notification for the sender; if the sender // was this object, ignore it if ([aNotification object] == self) return; @@ -315,6 +321,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; [selectionIndexes addIndex:anIndex]; } [favoritesOutlineView selectRowIndexes:selectionIndexes byExtendingSelection:NO]; +#endif } /** @@ -322,6 +329,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; * * @param node The node to traverse */ +#ifndef SP_REFACTOR - (void)_restoreOutlineViewStateNode:(SPTreeNode *)node { if ([node isGroup]) { @@ -340,5 +348,6 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; } } } +#endif @end -- cgit v1.2.3