mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-29 05:24:26 +00:00
Pass majorUpdate information to user driver
We unify the user driver method showing the update to take a generic state object now. The current fields of the state object are its current stage, if it's user initiated, and if the update is a major one. We also remove deprecated code paths that were complex to support and will otherwise generate in compile errors if people adopt the new API.
This commit is contained in:
1 parent
a79f6b2a85
commit
d193f2e28b
16 files changed
+246
-326
No files matched your search
@@ -97,18 +97,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem userInitiated:(BOOL)userInitiated state:(SPUUserUpdateState)state reply:(void (^)(SPUUserUpdateChoice))reply
|
||||
- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem userInitiated:(BOOL)userInitiated state:(SPUUserUpdateState *)state reply:(void (^)(SPUUserUpdateChoice))reply
|
||||
{
|
||||
switch (state) {
|
||||
case SPUUserUpdateStateNotDownloaded:
|
||||
switch (state.stage) {
|
||||
case SPUUserUpdateStageNotDownloaded:
|
||||
[self showUpdateWithAppcastItem:appcastItem updateAdjective:@"new"];
|
||||
reply(SPUUserUpdateChoiceInstall);
|
||||
break;
|
||||
case SPUUserUpdateStateDownloaded:
|
||||
case SPUUserUpdateStageDownloaded:
|
||||
[self showUpdateWithAppcastItem:appcastItem updateAdjective:@"downloaded"];
|
||||
reply(SPUUserUpdateChoiceInstall);
|
||||
break;
|
||||
case SPUUserUpdateStateInstalling:
|
||||
case SPUUserUpdateStageInstalling:
|
||||
if (self.deferInstallation) {
|
||||
if (self.verbose) {
|
||||
fprintf(stderr, "Deferring Installation.\n");
|
||||
@@ -118,7 +118,7 @@
|
||||
reply(SPUUserUpdateChoiceInstall);
|
||||
}
|
||||
break;
|
||||
case SPUUserUpdateStateInformational:
|
||||
case SPUUserUpdateStageInformational:
|
||||
fprintf(stderr, "Found information for new update: %s\n", appcastItem.infoURL.absoluteString.UTF8String);
|
||||
reply(SPUUserUpdateChoiceDismiss);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user