diff options
author | rowanbeentje <rowan@beent.je> | 2009-04-10 15:34:14 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-04-10 15:34:14 +0000 |
commit | 06a412a95e9882c71d40272999f65a89e3447564 (patch) | |
tree | 9d48b50c6d322ef3787aec3d394940cafa976628 /Source/TableDocument.m | |
parent | a199e73f7acf177cf197fea3e4dc0abe2ab4789b (diff) | |
download | sequelpro-06a412a95e9882c71d40272999f65a89e3447564.tar.gz sequelpro-06a412a95e9882c71d40272999f65a89e3447564.tar.bz2 sequelpro-06a412a95e9882c71d40272999f65a89e3447564.zip |
- Make MainController the application delegate, and override standard automatic creation methods to only trigger automatic connection (if enabled in prefs) for automatically created windows
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]; } - } |