From abfba8d070eca98f602a25722b27eff44a613a40 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 5 Jun 2010 23:51:54 +0000 Subject: - Tweak initial window load to select the correct favourite, also applying focus correctly --- Source/SPDatabaseDocument.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index c91a5c08..d5ebb24c 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3972,6 +3972,12 @@ */ - (void)setParentWindow:(NSWindow *)aWindow { + // If the window is being set for the first time - connection controller is visible - update focus + if (!parentWindow && !mySQLConnection) { + [aWindow makeFirstResponder:[connectionController valueForKey:@"favoritesTable"]]; + [connectionController performSelector:@selector(updateFavoriteSelection:) withObject:self afterDelay:0.0]; + } + parentWindow = aWindow; SPSSHTunnel *currentTunnel = [connectionController valueForKeyPath:@"sshTunnel"]; if (currentTunnel) [currentTunnel setParentWindow:parentWindow]; -- cgit v1.2.3