diff options
author | bamse16 <marius@marius.me.uk> | 2009-03-24 20:04:54 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2009-03-24 20:04:54 +0000 |
commit | 6679e5cef1ffb3f5376e78c9c518123137a99413 (patch) | |
tree | 4df762d8cef7b12421ba0f6b47155b7182dbe950 /Source/TableDocument.m | |
parent | a23bb9169015b21191bf072a7da6c668991907df (diff) | |
download | sequelpro-6679e5cef1ffb3f5376e78c9c518123137a99413.tar.gz sequelpro-6679e5cef1ffb3f5376e78c9c518123137a99413.tar.bz2 sequelpro-6679e5cef1ffb3f5376e78c9c518123137a99413.zip |
Added hidden preference to automatically select the last favorite you used.
To enable this feature write in Terminal:
bash $ defaults write com.google.code.sequel-pro selectLastFavoriteUsed YES
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index c4179fb4..d4a0426c 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -275,6 +275,8 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa [portField setStringValue:[self valueForKeyPath:@"selectedFavorite.port"]]; [databaseField setStringValue:[self valueForKeyPath:@"selectedFavorite.database"]]; [passwordField setStringValue:[self selectedFavoritePassword]]; + + [prefs setInteger:[favoritesController selectionIndex] forKey:@"lastFavoriteIndex"]; } /** @@ -1488,6 +1490,10 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa [self setupToolbar]; // [self connectToDB:nil]; [self performSelector:@selector(connectToDB:) withObject:tableWindow afterDelay:0.0f]; + + if([prefs boolForKey:@"selectLastFavoriteUsed"] == YES){ + [favoritesController setSelectionIndexes:[NSIndexSet indexSetWithIndex:[prefs integerForKey:@"lastFavoriteIndex"]]]; + } } - (void)windowWillClose:(NSNotification *)aNotification |