aboutsummaryrefslogtreecommitdiffstats
path: root/TableDocument.m
diff options
context:
space:
mode:
authorabhibeckert <abhi@abhibeckert.com>2008-05-03 02:55:53 +0000
committerabhibeckert <abhi@abhibeckert.com>2008-05-03 02:55:53 +0000
commitfc7036b606b253c4759d0d0bcfa35c30fceeccb4 (patch)
tree9ce245ba00b7b766f52bc03f550a80378f059a3e /TableDocument.m
parentc75a1ba3339825c6b98aa0a2e9f07b9caf8ece7f (diff)
downloadsequelpro-fc7036b606b253c4759d0d0bcfa35c30fceeccb4.tar.gz
sequelpro-fc7036b606b253c4759d0d0bcfa35c30fceeccb4.tar.bz2
sequelpro-fc7036b606b253c4759d0d0bcfa35c30fceeccb4.zip
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
Diffstat (limited to 'TableDocument.m')
-rw-r--r--TableDocument.m8
1 files changed, 7 insertions, 1 deletions
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:@""]) {