diff options
author | rowanbeentje <rowan@beent.je> | 2012-06-03 18:45:48 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-06-03 18:45:48 +0000 |
commit | b5934d004ce7e73e45da1b4de823e8092843ef9b (patch) | |
tree | aad1effe3227cedeea01b23fd82aad195087c7a6 /Source/SPDatabaseDocument.m | |
parent | 74605c185982d0f1882b8acbdd2d1703aadc1c40 (diff) | |
download | sequelpro-b5934d004ce7e73e45da1b4de823e8092843ef9b.tar.gz sequelpro-b5934d004ce7e73e45da1b4de823e8092843ef9b.tar.bz2 sequelpro-b5934d004ce7e73e45da1b4de823e8092843ef9b.zip |
- Remove delayed favourite selection call on tab setup. This fixes detail reset issues causing Issue #1362 and Issue #1338, possibly others.
- Clean up duplicate code setting and resetting connection interface state, ensuring one code path used by all
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 90f9985a..f09a97da 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4109,7 +4109,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; #ifndef SP_REFACTOR [aWindow makeFirstResponder:(NSResponder *)[connectionController favoritesOutlineView]]; #endif - [connectionController performSelector:@selector(updateFavoriteSelection:) withObject:self afterDelay:0.0]; + [connectionController updateFavoriteSelection:self]; } parentWindow = aWindow; @@ -4393,7 +4393,8 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [self updateWindowTitle:self]; - // Deselect all favorites on the connection controller + // Deselect all favorites on the connection controller. This will automatically + // clear and reset the connection state. [[connectionController favoritesOutlineView] deselectAll:connectionController]; // Suppress the possibility to choose an other connection from the favorites @@ -4401,32 +4402,6 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; // that the SPF file runs out of sync. [[connectionController favoritesOutlineView] setEnabled:NO]; - // Ensure the connection controller is set to a blank slate - [connectionController setName:@""]; - [connectionController setUser:@""]; - [connectionController setHost:@""]; - [connectionController setPort:@""]; - [connectionController setSocket:@""]; - [connectionController setUseSSL:NSOffState]; - [connectionController setSslKeyFileLocationEnabled:NSOffState]; - [connectionController setSslKeyFileLocation:nil]; - [connectionController setSslCertificateFileLocationEnabled:NSOffState]; - [connectionController setSslCertificateFileLocation:nil]; - [connectionController setSslCACertFileLocationEnabled:NSOffState]; - [connectionController setSslCACertFileLocation:nil]; - [connectionController setSshHost:@""]; - [connectionController setSshUser:@""]; - [connectionController setSshKeyLocationEnabled:NSOffState]; - [connectionController setSshKeyLocation:nil]; - [connectionController setSshPort:@""]; - [connectionController setDatabase:@""]; - [connectionController setPassword:nil]; - [connectionController setConnectionKeychainItemName:nil]; - [connectionController setConnectionKeychainItemAccount:nil]; - [connectionController setSshPassword:nil]; - [connectionController setConnectionSSHKeychainItemName:nil]; - [connectionController setConnectionSSHKeychainItemAccount:nil]; - // Set the correct connection type if ([connection objectForKey:@"type"]) { if ([[connection objectForKey:@"type"] isEqualToString:@"SPTCPIPConnection"]) |