diff --git a/Sparkle/SPUBasicUpdateDriver.m b/Sparkle/SPUBasicUpdateDriver.m index 9d8c8ffe..122fc420 100644 --- a/Sparkle/SPUBasicUpdateDriver.m +++ b/Sparkle/SPUBasicUpdateDriver.m @@ -169,7 +169,8 @@ errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", "'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI)"), self.host.name] + NSLocalizedDescriptionKey: SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates."), + NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]] } ]; [self.delegate basicDriverIsRequestingAbortUpdateWithError:notFoundError]; diff --git a/Sparkle/SPUStandardUserDriver.m b/Sparkle/SPUStandardUserDriver.m index 3aacde95..a5f17914 100644 --- a/Sparkle/SPUStandardUserDriver.m +++ b/Sparkle/SPUStandardUserDriver.m @@ -272,16 +272,15 @@ [self.coreComponent acceptAcknowledgement]; } -- (void)showUpdateNotFoundWithAcknowledgement:(void (^)(void))acknowledgement +//- (void)showUpdateNotFoundWithAcknowledgement:(void (^)(void))acknowledgement +- (void)showUpdateNotFoundWithError:(NSError *)error acknowledgement:(void (^)(void))acknowledgement { assert(NSThread.isMainThread); [self.coreComponent registerAcknowledgement:acknowledgement]; - NSAlert *alert = [[NSAlert alloc] init]; - alert.messageText = SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates."); - alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]]; - [alert addButtonWithTitle:SULocalizedString(@"OK", nil)]; + NSAlert *alert = [NSAlert alertWithError:error]; + alert.alertStyle = NSAlertStyleInformational; [self showAlert:alert]; [self.coreComponent acceptAcknowledgement]; diff --git a/Sparkle/SPUUIBasedUpdateDriver.m b/Sparkle/SPUUIBasedUpdateDriver.m index c1aae0ab..a3e23e5b 100644 --- a/Sparkle/SPUUIBasedUpdateDriver.m +++ b/Sparkle/SPUUIBasedUpdateDriver.m @@ -274,7 +274,7 @@ NSError *nonNullError = error; if (error.code == SUNoUpdateError) { - [self.userDriver showUpdateNotFoundWithAcknowledgement:^{ + [self.userDriver showUpdateNotFoundWithError:(NSError * _Nonnull)error acknowledgement:^{ dispatch_async(dispatch_get_main_queue(), ^{ abortUpdate(); }); diff --git a/Sparkle/SPUUserDriver.h b/Sparkle/SPUUserDriver.h index 58ab78cc..8baa935a 100644 --- a/Sparkle/SPUUserDriver.h +++ b/Sparkle/SPUUserDriver.h @@ -171,9 +171,10 @@ SU_EXPORT @protocol SPUUserDriver * * Let the user know a new update was not found after they tried initiating an update check. * - * @param acknowledgement Acknowledge to the updater that no update found was shown. + * @param error The error associated with why a new update was not found. + * @param acknowledgement Acknowledge to the updater that no update found error was shown. */ -- (void)showUpdateNotFoundWithAcknowledgement:(void (^)(void))acknowledgement; +- (void)showUpdateNotFoundWithError:(NSError *)error acknowledgement:(void (^)(void))acknowledgement; /*! * Show the user an update error occurred @@ -181,6 +182,7 @@ SU_EXPORT @protocol SPUUserDriver * Let the user know that the updater failed with an error. This will not be invoked without the user having been * aware that an update was in progress. * + * @param error The error associated with what update error occurred.. * @param acknowledgement Acknowledge to the updater that the error was shown. */ - (void)showUpdaterError:(NSError *)error acknowledgement:(void (^)(void))acknowledgement;