Remove SUAutomaticInstallationChoice since it was duplicated definitions

This commit is contained in:
Zorg committed 2016-03-01 02:50:44 -05:00
1 parent cea47960dd
commit 3362ea174a
8 files changed
+20 -26

No files matched your search

+1 -1
View File
@@ -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;
+4 -4
View File
@@ -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;
}
+4 -4
View File
@@ -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;
+2 -2
View File
@@ -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;
}];
+1 -7
View File
@@ -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 */
+1 -1
View File
@@ -99,7 +99,7 @@
[self abortUpdate];
break;
case SURemindMeLaterChoice:
case SUInstallLaterChoice:
[self abortUpdate];
break;
}
+3 -3
View File
@@ -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;
}
+4 -4
View File
@@ -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