diff options
author | sqlprodev <sqlprodev@northofthree.com> | 2012-07-05 19:02:47 +0000 |
---|---|---|
committer | sqlprodev <sqlprodev@northofthree.com> | 2012-07-05 19:02:47 +0000 |
commit | 2dc02505710b3980704637e7c7647057ef3c0e14 (patch) | |
tree | 2e0790f49cd908a949d1cf5284afd33b6f18a4e2 /Source | |
parent | d8a3650b1106fa8a4563e032e7ad66ca076da01b (diff) | |
download | sequelpro-2dc02505710b3980704637e7c7647057ef3c0e14.tar.gz sequelpro-2dc02505710b3980704637e7c7647057ef3c0e14.tar.bz2 sequelpro-2dc02505710b3980704637e7c7647057ef3c0e14.zip |
A few more tweaks for SP r3710 merge with Coda
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConnectionControllerDataSource.m | 4 | ||||
-rw-r--r-- | Source/SPConnectionControllerDelegate.h | 5 | ||||
-rw-r--r-- | Source/SPConnectionControllerDelegate.m | 38 | ||||
-rw-r--r-- | 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) <SPFavoritesImportProtocol, SPFavoritesExportProtocol> +@interface SPConnectionController (SPConnectionControllerDelegate) +#ifndef SP_REFACTOR + <SPFavoritesImportProtocol, SPFavoritesExportProtocol> +#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 <http://code.google.com/p/sequel-pro/> #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 |