From fc7036b606b253c4759d0d0bcfa35c30fceeccb4 Mon Sep 17 00:00:00 2001 From: abhibeckert Date: Sat, 3 May 2008 02:55:53 +0000 Subject: double clicking a favorite in the connect sheet will now connect to it default name for new favorites has been changed to 'database user@host' to make 'type-ahead' more effective in the connect sheet when selecting a favorite --- TableDocument.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'TableDocument.m') diff --git a/TableDocument.m b/TableDocument.m index ad7644df..35aa550e 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -53,6 +53,10 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum // register selection did change handler for favorites controller (used in connect sheet) [favoritesController addObserver:self forKeyPath:@"selectionIndex" options:NSKeyValueChangeInsertion context:TableDocumentFavoritesControllerSelectionIndexDidChange]; + // register double click for the favorites view (double click favorite to connect) + [connectFavoritesTableView setTarget:self]; + [connectFavoritesTableView setDoubleAction:@selector(connect:)]; + // find the Database -> Database Encoding menu (it's not in our nib, so we can't use interface builder) selectEncodingMenu = [[[[[NSApp mainMenu] itemWithTag:1] submenu] itemWithTag:1] submenu]; @@ -311,7 +315,9 @@ reused when user hits the close button of the variablseSheet or of the createTab { NSEnumerator *enumerator = [favorites objectEnumerator]; id favorite; - NSString *favoriteName = [NSString stringWithFormat:@"%@@%@/%@", user, host, database]; + NSString *favoriteName = [NSString stringWithFormat:@"%@@%@", user, host]; + if (![database isEqualToString:@""]) + favoriteName = [NSString stringWithFormat:@"%@ %@", database, favoriteName]; // test if host and socket are not nil if ([host isEqualToString:@""] && [socket isEqualToString:@""]) { -- cgit v1.2.3