mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Add updater:userDidSkipThisVersion: delegate method
This commit is contained in:
1 parent
c822f88cf1
commit
2d666b4d84
4 files changed
+33
-1
No files matched your search
Vendored
+10
-1
@@ -107,6 +107,8 @@
|
||||
|
||||
- (void)basicDriverDidFindUpdateWithAppcastItem:(SUAppcastItem *)updateItem preventsAutoupdate:(BOOL)preventsAutoupdate
|
||||
{
|
||||
id <SPUUpdaterDelegate> updaterDelegate = self.updaterDelegate;
|
||||
|
||||
if (updateItem.isInformationOnlyUpdate) {
|
||||
assert(!self.resumingDownloadedUpdate);
|
||||
assert(!self.resumingInstallingUpdate);
|
||||
@@ -134,6 +136,10 @@
|
||||
case SPUSkipThisVersionChoice:
|
||||
[self.coreDriver clearDownloadedUpdate];
|
||||
[self.host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
|
||||
|
||||
if ([self.updaterDelegate respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) {
|
||||
[self.updaterDelegate updater:self.updater userDidSkipThisVersion:updateItem];
|
||||
}
|
||||
// Fall through
|
||||
case SPUInstallLaterChoice:
|
||||
[self.delegate uiDriverIsRequestingAbortUpdateWithError:nil];
|
||||
@@ -151,6 +157,10 @@
|
||||
break;
|
||||
case SPUSkipThisVersionChoice:
|
||||
[self.host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
|
||||
|
||||
if ([self.updaterDelegate respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) {
|
||||
[self.updaterDelegate updater:self.updater userDidSkipThisVersion:updateItem];
|
||||
}
|
||||
// Fall through
|
||||
case SPUInstallLaterChoice:
|
||||
[self.delegate uiDriverIsRequestingAbortUpdateWithError:nil];
|
||||
@@ -171,7 +181,6 @@
|
||||
[self.delegate uiDriverDidShowUpdate];
|
||||
}
|
||||
|
||||
id <SPUUpdaterDelegate> updaterDelegate = self.updaterDelegate;
|
||||
if (updateItem.releaseNotesURL != nil && (![updaterDelegate respondsToSelector:@selector(updaterShouldDownloadReleaseNotes:)] || [updaterDelegate updaterShouldDownloadReleaseNotes:self.updater])) {
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:updateItem.releaseNotesURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];
|
||||
|
||||
|
||||
Vendored
+8
@@ -188,6 +188,14 @@ typedef NS_ENUM(NSInteger, SPUUpdateCheck)
|
||||
*/
|
||||
- (void)updaterDidNotFindUpdate:(SPUUpdater *)updater;
|
||||
|
||||
/*!
|
||||
Called when an update is skipped by the user.
|
||||
|
||||
\param updater The updater instance.
|
||||
\param item The appcast item corresponding to the update that the user skipped.
|
||||
*/
|
||||
- (void)updater:(SPUUpdater *)updater userDidSkipThisVersion:(SUAppcastItem *)item;
|
||||
|
||||
/*!
|
||||
Returns whether the release notes (if available) should be downloaded after an update is found and shown.
|
||||
|
||||
|
||||
Vendored
+7
@@ -326,6 +326,13 @@ static NSMutableDictionary *sharedUpdaters = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updater:(SPUUpdater *)__unused updater userDidSkipThisVersion:(nonnull SUAppcastItem *)item
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) {
|
||||
[self.delegate updater:self userDidSkipThisVersion:item];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updater:(SPUUpdater *)__unused updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(updater:willDownloadUpdate:withRequest:)]) {
|
||||
|
||||
Vendored
+8
@@ -160,6 +160,14 @@ __deprecated_msg("See SPUUpdaterDelegate instead")
|
||||
*/
|
||||
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item;
|
||||
|
||||
/*!
|
||||
Called when an update is skipped by the user.
|
||||
|
||||
\param updater The updater instance.
|
||||
\param item The appcast item corresponding to the update that the user skipped.
|
||||
*/
|
||||
- (void)updater:(SUUpdater *)updater userDidSkipThisVersion:(SUAppcastItem *)item;
|
||||
|
||||
/*!
|
||||
Returns whether the relaunch should be delayed in order to perform other tasks.
|
||||
|
||||
|
||||
Reference in new issue
Block a user