diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-08-19 20:28:39 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-08-19 20:28:39 +0000 |
commit | fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1 (patch) | |
tree | f3029d320bf887a3bf360cb7ae8163f447fb26e8 /Source/SPDatabaseDocument.m | |
parent | 692e6e7330d9a6fd0227f74c1665ddc0b19cc4c6 (diff) | |
download | sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.tar.gz sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.tar.bz2 sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.zip |
• made usage of SPBeginWaitingAlertSheet while closing a spf file for readability of that spf file
• suppress if a window with one tab will be closed that [... parentTabShouldClose] method will be called twice via closeTab:
- this issue could be the reason for recent crashes/exception esp. of the NSNavigator (should be investigated further)
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index a31a9ac7..e99bc702 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1077,6 +1077,11 @@ - (void)sheetDidEnd:(id)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo { + if([contextInfo isEqualToString:@"saveDocPrefSheetStatus"]) { + saveDocPrefSheetStatus = returnCode; + return; + } + // Order out current sheet to suppress overlapping of sheets if ([sheet respondsToSelector:@selector(orderOut:)]) [sheet orderOut:nil]; @@ -3202,16 +3207,19 @@ mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&convError]]; if(!spf || ![spf count] || readError != nil || [convError length] || !(format == NSPropertyListXMLFormat_v1_0 || format == NSPropertyListBinaryFormat_v1_0)) { - NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while reading connection data file", @"error while reading connection data file")] - defaultButton:NSLocalizedString(@"OK", @"OK button") - alternateButton:NSLocalizedString(@"Ignore", @"ignore button") - otherButton:nil - informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"Connection data file “%@” couldn't be read. Please try to save the document under a different name.", @"message error while reading connection data file and suggesting to save it under a differnet name"), [fileName lastPathComponent]]]; - [alert setAlertStyle:NSCriticalAlertStyle]; - NSInteger returnCode = [alert runModal]; + SPBeginWaitingAlertSheet(@"title", + NSLocalizedString(@"OK", @"OK button"), NSLocalizedString(@"Ignore", @"ignore button"), nil, + NSCriticalAlertStyle, parentWindow, self, + @selector(sheetDidEnd:returnCode:contextInfo:), + @"saveDocPrefSheetStatus", + [NSString stringWithFormat:NSLocalizedString(@"Error while reading connection data file", @"error while reading connection data file")], + [NSString stringWithFormat:NSLocalizedString(@"Connection data file “%@” couldn't be read. Please try to save the document under a different name.", @"message error while reading connection data file and suggesting to save it under a differnet name"), [fileName lastPathComponent]], + saveDocPrefSheetStatus + ); + if (spf) [spf release]; - if(returnCode == NSAlertAlternateReturn) + if(saveDocPrefSheetStatus == NSAlertAlternateReturn) return YES; return NO; |