diff options
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 7f674341..19825570 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -115,6 +115,14 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocum //start sheet /** + * Set whether the connection sheet should automaticall start connecting + */ +- (void)setShouldAutomaticallyConnect:(BOOL)shouldAutomaticallyConnect +{ + _shouldOpenConnectionAutomatically = shouldAutomaticallyConnect; +} + +/** * tries to connect to a database server, shows connect sheet prompting user to * enter details/select favorite and shoows alert sheets on failure. */ @@ -133,11 +141,9 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocum // Connect automatically to the last used or default favourite // connectSheet must open first. - // TODO: Auto connect on startup only. New connections should NOT automatically connect. - if ([prefs boolForKey:@"AutoConnectToDefault"]) { + if (_shouldOpenConnectionAutomatically) { [self connect:self]; } - } |