From efaf41faf367c778185545f0d47b02dee5424c4e Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 23 Jun 2012 13:37:16 +0000 Subject: - Fix issues opening new windows when Sequel Pro is opened in the background, eg as a result of an application quarantine dialog. This addresses Issue #1375. - Fix exceptions and multiple errors when opening locked or encrypted session files where opening is cancelled. --- Source/SPDatabaseDocument.m | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 7c7d2a39..a6d7bfd8 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4509,8 +4509,9 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; /** * Initialise the document with the connection file at the supplied path. + * Returns whether the document was initialised successfully. */ -- (void)setStateFromConnectionFile:(NSString *)path +- (BOOL)setStateFromConnectionFile:(NSString *)path { NSError *readError = nil; NSString *convError = nil; @@ -4538,7 +4539,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [alert runModal]; if (spf) [spf release]; [self closeAndDisconnect]; - return; + return NO; } // If the .spf format is unhandled, error. @@ -4553,7 +4554,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [spf release]; [self closeAndDisconnect]; [alert runModal]; - return; + return NO; } // Error if the expected data source wasn't present in the file @@ -4568,7 +4569,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [alert runModal]; [spf release]; [self closeAndDisconnect]; - return; + return NO; } // Ask for a password if SPF file passwords were encrypted, via a sheet @@ -4616,7 +4617,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; } else { [self closeAndDisconnect]; [spf release]; - return; + return NO; } } } @@ -4642,7 +4643,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [alert runModal]; [self closeAndDisconnect]; [spf release]; - return; + return NO; } } @@ -4664,7 +4665,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [alert runModal]; [self closeAndDisconnect]; [spf release]; - return; + return NO; } // Move favourites and history into the data dictionary to pass to setState: @@ -4702,6 +4703,8 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [self setState:data]; [spf release]; + + return YES; } /** -- cgit v1.2.3