Rename SPUUserUpdateStateNotDownloaded to SPUUserUpdateStateNew

Update documentation too.

Fix test app trying to make installable update skippable.
This commit is contained in:
Zorg committed 2021-04-16 16:40:33 -07:00
1 parent e64253be0b
commit ab9ffdb901
6 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, SPUUserUpdateChoice) {
};
typedef NS_ENUM(NSInteger, SPUUserUpdateState) {
SPUUserUpdateStateNotDownloaded,
SPUUserUpdateStateNew,
SPUUserUpdateStateDownloaded,
SPUUserUpdateStateInstalling,
SPUUserUpdateStateInformational
+3 -3
View File
@@ -117,7 +117,7 @@
} else if (self.resumingInstallingUpdate) {
state = SPUUserUpdateStateInstalling;
} else {
state = SPUUserUpdateStateNotDownloaded;
state = SPUUserUpdateStateNew;
}
[self.userDriver showUpdateFoundWithAppcastItem:updateItem userInitiated:self.userInitiated state:state reply:^(SPUUserUpdateChoice userChoice) {
@@ -142,7 +142,7 @@
case SPUUserUpdateStateInstalling:
[self.coreDriver finishInstallationWithResponse:validatedChoice displayingUserInterface:!self.preventsInstallerInteraction];
break;
case SPUUserUpdateStateNotDownloaded:
case SPUUserUpdateStateNew:
[self.coreDriver downloadUpdateFromAppcastItem:updateItem inBackground:NO];
break;
case SPUUserUpdateStateInformational:
@@ -163,7 +163,7 @@
case SPUUserUpdateChoiceDismiss:
switch (state) {
case SPUUserUpdateStateDownloaded:
case SPUUserUpdateStateNotDownloaded:
case SPUUserUpdateStateNew:
case SPUUserUpdateStateInformational:
[self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
[self.delegate uiDriverIsRequestingAbortUpdateWithError:nil];
+3 -3
View File
@@ -77,7 +77,7 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
* @param userInitiated A flag indicating whether or not a user initiated this update check
*
* @param state The current state of the update.
* SPUUserUpdateStateNotDownloaded - Update has not been downloaded yet.
* SPUUserUpdateStateNew - Update has not been downloaded yet.
* SPUUserUpdateStateDownloaded - Update has already been downloaded but not started installing yet.
* SPUUserUpdateStateInstalling - Update has been downloaded and already started installing.
* SPUUserUpdateStateInformational - Update is only informational and has no download. You can direct the user to the the infoURL property of the appcastItem in their web browser. The informationOnlyUpdate property of the appcastItem will be YES.
@@ -89,8 +89,8 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
* If the state is SPUUserUpdateStateInstalling, this may send a quit event to the application and relaunch it immediately (in this state, this behaves as a fast "install and Relaunch").
*
* A reply of SPUUserUpdateChoiceDismiss dismisses the update for the time being. The user may be reminded of the update at a later point.
* If the state is SPUUserUpdateStateDownloaded, the downloaded update is kept upon dismissing until the next time an update is shown to the user.
* If the state is SPUUserUpdateStateInstalling, the installing update is also preserved upon dismissing. In this state however, the update will still be installed after the application is terminated.
* If the state is SPUUserUpdateStateDownloaded, the downloaded update is kept after dismissing until the next time an update is shown to the user.
* If the state is SPUUserUpdateStateInstalling, the installing update is also preserved after dismissing. In this state however, the update will also still be installed after the application is terminated.
*
* A reply of SPUUserUpdateChoiceSkip skips this particular version and won't notify the user again, unless they initiate an update check themselves.
* If the state is SPUUserUpdateStateInstalling, the update cannot be skipped, only dismissed or installed.
+2 -2
View File
@@ -420,13 +420,13 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
if (self.updateItem.isInformationOnlyUpdate) {
finalString = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?", @"Description text for SUUpdateAlert when the update informational with no download."), self.host.name, updateItemVersion, hostVersion];
} else if ([self.updateItem isCriticalUpdate]) {
if (self.state == SPUUserUpdateStateNotDownloaded) {
if (self.state == SPUUserUpdateStateNew) {
finalString = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. This is an important update; would you like to download it now?", @"Description text for SUUpdateAlert when the critical update is downloadable."), self.host.name, updateItemVersion, hostVersion];
} else {
finalString = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?", @"Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install."), self.host.name, updateItemVersion];
}
} else {
if (self.state == SPUUserUpdateStateNotDownloaded) {
if (self.state == SPUUserUpdateStateNew) {
finalString = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. Would you like to download it now?", @"Description text for SUUpdateAlert when the update is downloadable."), self.host.name, updateItemVersion, hostVersion];
} else {
finalString = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", @"Description text for SUUpdateAlert when the update has already been downloaded and ready to install."), self.host.name, updateItemVersion];
+2 -2
View File
@@ -149,12 +149,12 @@
reply(SPUUserUpdateChoiceDismiss);
break;
case SPUUserUpdateStateNotDownloaded:
case SPUUserUpdateStateNew:
case SPUUserUpdateStateDownloaded:
[self showUpdateWithAppcastItem:appcastItem skippable:YES reply:reply];
break;
case SPUUserUpdateStateInstalling:
[self showUpdateWithAppcastItem:appcastItem skippable:YES reply:reply];
[self showUpdateWithAppcastItem:appcastItem skippable:NO reply:reply];
break;
}
}
+1 -1
View File
@@ -108,7 +108,7 @@
- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem userInitiated:(BOOL)userInitiated state:(SPUUserUpdateState)state reply:(void (^)(SPUUserUpdateChoice))reply
{
switch (state) {
case SPUUserUpdateStateNotDownloaded:
case SPUUserUpdateStateNew:
[self showUpdateWithAppcastItem:appcastItem updateAdjective:@"new"];
reply(SPUUserUpdateChoiceInstall);
break;