From fbdd43314fb401f3c563fab3a37e24799d31ef56 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 11 Jun 2009 22:40:42 +0000 Subject: - Fix saving of SSH tunnel passwords entered in preferences - Select favourites added in preferences - Scroll to newly added or duplicated favourites in both preferences and connection sheet --- Source/SPPreferenceController.m | 7 +++++-- Source/TableDocument.m | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 808e863c..10d58862 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -240,8 +240,10 @@ forKeys:[NSArray arrayWithObjects:@"name", @"host", @"socket", @"user", @"port", @"database", @"id", nil]]; [favoritesController addObject:favorite]; - + [favoritesController setSelectionIndex:[[favoritesController arrangedObjects] count]-1]; + [favoritesTableView reloadData]; + [favoritesTableView scrollRowToVisible:[favoritesTableView selectedRow]]; [self updateDefaultFavoritePopup]; } @@ -323,6 +325,7 @@ [favoritesController setSelectionIndex:[[favoritesController arrangedObjects] count]-1]; [favoritesTableView reloadData]; + [favoritesTableView scrollRowToVisible:[favoritesTableView selectedRow]]; [self updateDefaultFavoritePopup]; } } @@ -705,7 +708,7 @@ oldKeychainAccount = [keychain accountForSSHUser:[favoritesController valueForKeyPath:@"selection.sshUser"] sshHost:[favoritesController valueForKeyPath:@"selection.sshHost"]]; // Set up the new keychain name and account strings - newKeychainName = [keychain nameForFavoriteName:[nameField stringValue] id:[favoritesController valueForKeyPath:@"selection.id"]]; + newKeychainName = [keychain nameForSSHForFavoriteName:[nameField stringValue] id:[favoritesController valueForKeyPath:@"selection.id"]]; newKeychainAccount = [keychain accountForSSHUser:[sshUserField stringValue] sshHost:[sshHostField stringValue]]; // Delete the old keychain item diff --git a/Source/TableDocument.m b/Source/TableDocument.m index ef0958ab..d2a24fd3 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -641,6 +641,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum - (void)connectSheetAddToFavorites:(id)sender { [self addToFavoritesName:[nameField stringValue] host:[hostField stringValue] socket:[socketField stringValue] user:[userField stringValue] password:[passwordField stringValue] port:[portField stringValue] database:[databaseField stringValue] useSSH:([sshCheckbox state] == NSOnState) sshHost:[sshHostField stringValue] sshUser:[sshUserField stringValue] sshPassword:[sshPasswordField stringValue] sshPort:[sshPortField stringValue]]; + [connectFavoritesTableView scrollRowToVisible:[connectFavoritesTableView selectedRow]]; } /** -- cgit v1.2.3