mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method
This commit is contained in:
1 parent
9f01fd303c
commit
9b6346516e
4 files changed
+9
-9
No files matched your search
Vendored
+4
-4
@@ -47,15 +47,15 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)shouldShowUpdateAlert {
|
||||
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)item {
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||
|
||||
if ([updaterDelegate respondsToSelector:@selector(updaterShouldShowUpdateAlertForScheduledUpdate:)]) {
|
||||
return [updaterDelegate updaterShouldShowUpdateAlertForScheduledUpdate:self.updater];
|
||||
if ([updaterDelegate respondsToSelector:@selector(updaterShouldShowUpdateAlertForScheduledUpdate:forItem:)]) {
|
||||
return [updaterDelegate updaterShouldShowUpdateAlertForScheduledUpdate:self.updater forItem:item];
|
||||
}
|
||||
|
||||
return [super shouldShowUpdateAlert];
|
||||
return [super shouldShowUpdateAlertForItem:item];
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+1
-1
@@ -20,7 +20,7 @@
|
||||
- (void)showAlert:(NSAlert *)alert;
|
||||
- (IBAction)cancelDownload:(id)sender;
|
||||
- (void)installAndRestart:(id)sender;
|
||||
- (BOOL)shouldShowUpdateAlert;
|
||||
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)item;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -56,7 +56,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)shouldShowUpdateAlert {
|
||||
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)__unused item {
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -72,12 +72,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (![self shouldShowUpdateAlert]) {
|
||||
SUAppcastItem *updateItem = self.updateItem;
|
||||
if (![self shouldShowUpdateAlertForItem:updateItem]) {
|
||||
[self abortUpdate];
|
||||
return;
|
||||
}
|
||||
|
||||
SUAppcastItem *updateItem = self.updateItem;
|
||||
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
|
||||
[self updateAlertFinishedWithChoice:choice forItem:updateItem];
|
||||
}];
|
||||
|
||||
Vendored
+1
-1
@@ -124,7 +124,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
|
||||
\return YES to allow the update prompt to be shown (the default behavior), or NO to suppress it.
|
||||
*/
|
||||
- (BOOL)updaterShouldShowUpdateAlertForScheduledUpdate:(SUUpdater *)updater;
|
||||
- (BOOL)updaterShouldShowUpdateAlertForScheduledUpdate:(SUUpdater *)updater forItem:(SUAppcastItem *)item;
|
||||
|
||||
/*!
|
||||
Called after the user dismisses the update alert.
|
||||
|
||||
Reference in new issue
Block a user