mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Remove SUAutomaticInstallationChoice since it was duplicated definitions
This commit is contained in:
1 parent
cea47960dd
commit
3362ea174a
8 files changed
+20
-26
No files matched your search
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -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;
|
||||
|
||||
Vendored
+2
-2
@@ -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;
|
||||
}];
|
||||
|
||||
Vendored
+1
-7
@@ -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 */
|
||||
Vendored
+1
-1
@@ -99,7 +99,7 @@
|
||||
[self abortUpdate];
|
||||
break;
|
||||
|
||||
case SURemindMeLaterChoice:
|
||||
case SUInstallLaterChoice:
|
||||
[self abortUpdate];
|
||||
break;
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user