aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/TableDocument.m6
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