Revision: 15494
http://sourceforge.net/p/skim-app/code/15494
Author: hofman
Date: 2025-06-18 15:25:25 +0000 (Wed, 18 Jun 2025)
Log Message:
-----------
alert messages are always the same
Modified Paths:
--------------
trunk/SKMainDocument.m
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2025-06-18 14:59:49 UTC (rev 15493)
+++ trunk/SKMainDocument.m 2025-06-18 15:25:25 UTC (rev 15494)
@@ -299,10 +299,10 @@
return option;
}
-- (BOOL)confirmNotToContinueUsingMessageText:(NSString *)messageText
informativeText:(NSString *)informativeText {
+- (BOOL)discontinueAfterFailureToReadNotesFromURL:(NSURL *)aURL error:(NSError
*)error {
NSAlert *alert = [[NSAlert alloc] init];
- [alert setMessageText:messageText];
- [alert setInformativeText:informativeText];
+ [alert setMessageText:NSLocalizedString(@"Unable to Read Notes", @"Message
in alert dialog")];
+ [alert setInformativeText:[NSString
stringWithFormat:NSLocalizedString(@"Skim was not able to read the notes at %@.
%@ Do you want to continue to open the PDF document anyway?", @"Informative
text in alert dialog"), [[aURL path] stringByAbbreviatingWithTildeInPath],
[error localizedDescription]]];
[alert addButtonWithTitle:NSLocalizedString(@"No", @"Button title")];
[alert addButtonWithTitle:NSLocalizedString(@"Yes", @"Button title")];
return [alert runModal] == NSAlertFirstButtonReturn;
@@ -912,7 +912,7 @@
NSArray *array = [[NSFileManager defaultManager]
readSkimNotesFromPDFBundleAtURL:absoluteURL error:&error];
if ([array count]) {
[tmpData setNoteDicts:array];
- } else if (array == nil && [self
confirmNotToContinueUsingMessageText:NSLocalizedString(@"Unable to Read Notes",
@"Message in alert dialog") informativeText:[NSString
stringWithFormat:NSLocalizedString(@"Skim was not able to read the notes at %@.
%@ Do you want to continue to open the PDF document anyway?", @"Informative
text in alert dialog"), [[pdfURL path] stringByAbbreviatingWithTildeInPath],
[error localizedDescription]]]) {
+ } else if (array == nil && [self
discontinueAfterFailureToReadNotesFromURL:absoluteURL error:error]) {
data = nil;
pdfDoc = nil;
error = [NSError
userCancelledErrorWithUnderlyingError:error];
@@ -933,7 +933,7 @@
// if we found no notes, see if we had an error finding notes. If
EAs were not supported we ignore the error, as we may assume there won't be any
notes
if (foundEANotes) {
[tmpData setNoteDicts:array];
- } else if (array == nil && isIgnorablePOSIXError(error) == NO &&
[self confirmNotToContinueUsingMessageText:NSLocalizedString(@"Unable to Read
Notes", @"Message in alert dialog") informativeText:[NSString
stringWithFormat:NSLocalizedString(@"Skim was not able to read the notes at %@.
%@ Do you want to continue to open the PDF document anyway?", @"Informative
text in alert dialog"), [[absoluteURL path]
stringByAbbreviatingWithTildeInPath], [error localizedDescription]]]) {
+ } else if (array == nil && isIgnorablePOSIXError(error) == NO &&
[self discontinueAfterFailureToReadNotesFromURL:absoluteURL error:error]) {
fileData = nil;
data = nil;
pdfDoc = nil;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit