diff options
author | rowanbeentje <rowan@beent.je> | 2013-04-28 12:33:02 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-04-28 12:33:02 +0000 |
commit | 0a7ac2792eafc65b59bf156defb322526adf79d7 (patch) | |
tree | 1f4b06c0f7001d13ef1e66769dbf91bd36bf2e91 /Source/SPConnectionControllerDelegate.m | |
parent | 3a440aa512f3524545dc0b1ec39362d052ed4806 (diff) | |
download | sequelpro-0a7ac2792eafc65b59bf156defb322526adf79d7.tar.gz sequelpro-0a7ac2792eafc65b59bf156defb322526adf79d7.tar.bz2 sequelpro-0a7ac2792eafc65b59bf156defb322526adf79d7.zip |
Merge a number of revisions from trunk back to the 1.0.x release branch:
- r4021: Add a check for SPNotLoaded values when automatically generating new tables when importing CSVs, fixing Issue #1621 (SPNotLoaded values are generated when rows shorter than the header row are seen)
- r4022: Fix crashes when importing favorites on the connection view, addressing Issue #1556; Select and scroll to newly created favorites after import
- r4023: Default to disabling SSH multiplexing to avoid connection issues as per Issue #1457; leave multiplexing code present, but behind a preference. Run `defaults write com.sequelpro.SequelPro SSHMultiplexingEnabled -boolean YES` to re-enable
- r4024: Fix handling of double-dash style comments within field names, addressing Issue #1554
- r4025: When favorites in the connection view gave no password, no longer set the focus to the password field as soon as they're selected; instead, make the password field the next responder for tab keys. This addresses Issue #1555
- r4028: Fix escaping of backlsashes in non-LIKE clauses, addressing string matching with the = and RegExp operators - addresses Issue #1563
- r4029: Fix handling of primary keys listing multiple fields of which an early field has a specified length, addressing Issue #1641
- r4030: Alter the database creation sheet to correctly use the selected new database encoding; Clean up the database creation logic and remove redundant selection logic; Correctly reset and detect the database encoding when creating and switching databases
- r4031: Fix blurry text in a number of text views in 1.0.x (Possibly caused by IB mangling; recreated new text views with the same settings to address). This fixes Issue #1560
- r4032: Detect deleted or non-writable folders for export targets and give appropriate errors (particularly for saved paths), addressing Issue #1566
- r4033: Add support for export path tokens containing non-alphanumeric characters, automatically grouping and tokenising as required for both dragged and typed tokens. This addresses Issue #1567
Diffstat (limited to 'Source/SPConnectionControllerDelegate.m')
-rw-r--r-- | Source/SPConnectionControllerDelegate.m | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index ac9ef296..4733b03b 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -40,6 +40,7 @@ #import "SPFavoriteNode.h" #import "SPGroupNode.h" #import "SPTreeNode.h" +#import "SPFavoritesOutlineView.h" #endif static NSString *SPDatabaseImage = @"database-small"; @@ -55,6 +56,7 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; - (void)_sortFavorites; - (void)_favoriteTypeDidChange; - (void)_reloadFavoritesViewData; +- (void)_scrollToSelectedNode; - (NSString *)_stripInvalidCharactersFromString:(NSString *)subject; @@ -257,6 +259,13 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item { + NSEvent *event = [NSApp currentEvent]; + BOOL shiftTabbedIn = ([event type] == NSKeyDown && [[event characters] length] && [[event characters] characterAtIndex:0] == NSBackTabCharacter); + + if (shiftTabbedIn && [(SPFavoritesOutlineView *)outlineView justGainedFocus]) { + return NO; + } + return (item != quickConnectItem); } @@ -663,17 +672,29 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; */ - (void)favoritesImportData:(NSArray *)data { + SPTreeNode *newNode; + NSMutableArray *importedNodes = [NSMutableArray array]; + NSMutableIndexSet *importedIndexSet = [NSMutableIndexSet indexSet]; + // Add each of the imported favorites to the root node for (NSMutableDictionary *favorite in data) { - [favoritesController addFavoriteNodeWithData:favorite asChildOfNode:nil]; + newNode = [favoritesController addFavoriteNodeWithData:favorite asChildOfNode:nil]; + [importedNodes addObject:newNode]; } if (currentSortItem > SPFavoritesSortUnsorted) { [self _sortFavorites]; } - + [self _reloadFavoritesViewData]; + + // Select the new nodes and scroll into view + for (SPTreeNode *eachNode in importedNodes) { + [importedIndexSet addIndex:[favoritesOutlineView rowForItem:eachNode]]; + } + [favoritesOutlineView selectRowIndexes:importedIndexSet byExtendingSelection:NO]; + [self _scrollToSelectedNode]; } /** |