From 3362ea174aefef300a603dc101086da72bbe5cdf Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 1 Mar 2016 02:50:44 -0500 Subject: [PATCH] Remove SUAutomaticInstallationChoice since it was duplicated definitions --- Sparkle/SUAutomaticUpdateAlert.h | 2 +- Sparkle/SUAutomaticUpdateAlert.m | 8 ++++---- Sparkle/SUAutomaticUpdateDriver.m | 8 ++++---- Sparkle/SUSparkleUserUpdaterDriver.m | 4 ++-- Sparkle/SUStatusCompletionResults.h | 8 +------- Sparkle/SUUIBasedUpdateDriver.m | 2 +- Sparkle/SUUpdateAlert.m | 6 +++--- Sparkle/SUUserUpdaterDriver.h | 8 ++++---- 8 files changed, 20 insertions(+), 26 deletions(-) diff --git a/Sparkle/SUAutomaticUpdateAlert.h b/Sparkle/SUAutomaticUpdateAlert.h index 74554045..09951dac 100644 --- a/Sparkle/SUAutomaticUpdateAlert.h +++ b/Sparkle/SUAutomaticUpdateAlert.h @@ -15,7 +15,7 @@ @class SUAppcastItem, SUHost; @interface SUAutomaticUpdateAlert : NSWindowController -- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle completionBlock:(void (^)(SUAutomaticInstallationChoice))c; +- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle completionBlock:(void (^)(SUUpdateAlertChoice))c; - (IBAction)installNow:sender; - (IBAction)installLater:sender; - (IBAction)doNotInstall:sender; diff --git a/Sparkle/SUAutomaticUpdateAlert.m b/Sparkle/SUAutomaticUpdateAlert.m index 0cbd902c..ece0a2c6 100644 --- a/Sparkle/SUAutomaticUpdateAlert.m +++ b/Sparkle/SUAutomaticUpdateAlert.m @@ -14,7 +14,7 @@ #import "SUApplicationInfo.h" @interface SUAutomaticUpdateAlert () -@property (strong) void(^completionBlock)(SUAutomaticInstallationChoice); +@property (strong) void(^completionBlock)(SUUpdateAlertChoice); @property (strong) SUAppcastItem *updateItem; @property (strong) SUHost *host; @end @@ -24,7 +24,7 @@ @synthesize updateItem; @synthesize completionBlock; -- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost completionBlock:(void (^)(SUAutomaticInstallationChoice))block +- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost completionBlock:(void (^)(SUUpdateAlertChoice))block { self = [super initWithWindowNibName:@"SUAutomaticUpdateAlert"]; if (self) { @@ -42,7 +42,7 @@ - (IBAction)installNow:(id)__unused sender { [self close]; - self.completionBlock(SUInstallNowChoice); + self.completionBlock(SUInstallUpdateChoice); self.completionBlock = nil; } @@ -56,7 +56,7 @@ - (IBAction)doNotInstall:(id)__unused sender { [self close]; - self.completionBlock(SUDoNotInstallChoice); + self.completionBlock(SUSkipThisVersionChoice); self.completionBlock = nil; } diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 9e27aaba..14f7f1ba 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -48,7 +48,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 { self.interruptible = NO; - [self.updater.userUpdaterDriver showAutomaticUpdateFoundWithAppcastItem:self.updateItem reply:^(SUAutomaticInstallationChoice choice) { + [self.updater.userUpdaterDriver showAutomaticUpdateFoundWithAppcastItem:self.updateItem reply:^(SUUpdateAlertChoice choice) { dispatch_async(dispatch_get_main_queue(), ^{ [self automaticUpdateAlertFinishedWithChoice:choice]; }); @@ -151,11 +151,11 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 [super abortUpdate]; } -- (void)automaticUpdateAlertFinishedWithChoice:(SUAutomaticInstallationChoice)choice +- (void)automaticUpdateAlertFinishedWithChoice:(SUUpdateAlertChoice)choice { switch (choice) { - case SUInstallNowChoice: + case SUInstallUpdateChoice: [self stopUpdatingOnTermination]; [self installWithToolAndRelaunch:YES]; break; @@ -166,7 +166,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 self.interruptible = YES; break; - case SUDoNotInstallChoice: + case SUSkipThisVersionChoice: [self.host setObject:[self.updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey]; [self abortUpdate]; break; diff --git a/Sparkle/SUSparkleUserUpdaterDriver.m b/Sparkle/SUSparkleUserUpdaterDriver.m index 96bdfae7..e7915f36 100644 --- a/Sparkle/SUSparkleUserUpdaterDriver.m +++ b/Sparkle/SUSparkleUserUpdaterDriver.m @@ -216,11 +216,11 @@ }); } -- (void)showAutomaticUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUAutomaticInstallationChoice))reply +- (void)showAutomaticUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply { dispatch_async(dispatch_get_main_queue(), ^{ __weak SUSparkleUserUpdaterDriver *weakSelf = self; - self.activeUpdateAlert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:appcastItem host:self.host completionBlock:^(SUAutomaticInstallationChoice choice) { + self.activeUpdateAlert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:appcastItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) { reply(choice); weakSelf.activeUpdateAlert = nil; }]; diff --git a/Sparkle/SUStatusCompletionResults.h b/Sparkle/SUStatusCompletionResults.h index 94f519c4..84306e21 100644 --- a/Sparkle/SUStatusCompletionResults.h +++ b/Sparkle/SUStatusCompletionResults.h @@ -43,14 +43,8 @@ typedef NS_ENUM(NSUInteger, SUInstallUpdateStatus) { typedef NS_ENUM(NSInteger, SUUpdateAlertChoice) { SUInstallUpdateChoice, - SURemindMeLaterChoice, + SUInstallLaterChoice, SUSkipThisVersionChoice }; -typedef NS_ENUM(NSInteger, SUAutomaticInstallationChoice) { - SUInstallNowChoice, - SUInstallLaterChoice, - SUDoNotInstallChoice -}; - #endif /* SUStatusCompletionResults_h */ diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 1ea4ce0a..481b01df 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -99,7 +99,7 @@ [self abortUpdate]; break; - case SURemindMeLaterChoice: + case SUInstallLaterChoice: [self abortUpdate]; break; } diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 3863d8df..bc8818eb 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -112,7 +112,7 @@ { [[NSWorkspace sharedWorkspace] openURL:self.updateItem.infoURL]; - [self endWithSelection:SURemindMeLaterChoice]; + [self endWithSelection:SUInstallLaterChoice]; } - (IBAction)skipThisVersion:(id)__unused sender @@ -122,7 +122,7 @@ - (IBAction)remindMeLater:(id)__unused sender { - [self endWithSelection:SURemindMeLaterChoice]; + [self endWithSelection:SUInstallLaterChoice]; } - (void)displayReleaseNotes @@ -213,7 +213,7 @@ - (BOOL)windowShouldClose:(NSNotification *) __unused note { - [self endWithSelection:SURemindMeLaterChoice]; + [self endWithSelection:SUInstallLaterChoice]; return YES; } diff --git a/Sparkle/SUUserUpdaterDriver.h b/Sparkle/SUUserUpdaterDriver.h index 8eb62323..346cf8ea 100644 --- a/Sparkle/SUUserUpdaterDriver.h +++ b/Sparkle/SUUserUpdaterDriver.h @@ -107,7 +107,7 @@ * @param allowsAutomaticUpdates Indicates whether the user is allowed to use automatic updates. * A user interface may use this to give the user an option to enable automatic updates. * @param reply A reply of SUInstallUpdateChoice installs the new update immediately. A reply of - * SURemindMeLaterChoice reminds the user later of the update, which can act as a "do nothing" option. + * SUInstallLaterChoice reminds the user later of the update, which can act as a "do nothing" option. * Lastly, SUSkipThisVersionChoice skips this particular version and won't bother the user again * (unless they initiate an update check themselves). * @@ -121,14 +121,14 @@ * Let the user know a new update is found and ask them what they want to do. * * @param appcastItem The Appcast Item containing information that reflects the new update - * @param reply A reply of SUInstallNowChoice installs the new update immediately. A reply of + * @param reply A reply of SUInstallUpdateChoice installs the new update immediately. A reply of * SUInstallLaterChoice will attempt to install the update when the application terminates; this can act as a - * "do nothing" option. Lastly, SUDoNotInstallChoice skips this particular version and won't bother the user again + * "do nothing" option. Lastly, SUSkipThisVersionChoice skips this particular version and won't bother the user again * (unless they initiate an update check themselves). * * This can be called from any thread */ -- (void)showAutomaticUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUAutomaticInstallationChoice))reply; +- (void)showAutomaticUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply; /*! * Show the user a new update was not found