diff --git a/Sparkle/SUSparkleUserUpdaterDriver.h b/Sparkle/SUSparkleUserUpdaterDriver.h index b2434123..76c0525a 100644 --- a/Sparkle/SUSparkleUserUpdaterDriver.h +++ b/Sparkle/SUSparkleUserUpdaterDriver.h @@ -11,23 +11,10 @@ @class SUHost; -@protocol SUSparkleUserUpdaterDriverDelegate - -@optional - -- (BOOL)responsibleForInitiatingUpdateCheckForUserDriver:(id )userUpdaterDriver; -- (void)initiateUpdateCheckForUserDriver:(id )userUpdaterDriver; - -- (void)userUpdaterDriverWillShowModalAlert:(id )userUpdaterDriver; -- (void)userUpdaterDriverDidShowModalAlert:(id )userUpdaterDriver; - -@end - @interface SUSparkleUserUpdaterDriver : NSObject -- (instancetype)initWithHost:(SUHost *)host handlesTermination:(BOOL)handlesTermination delegate:(id )delegate; +- (instancetype)initWithHost:(SUHost *)host handlesTermination:(BOOL)handlesTermination delegate:(id )delegate; -@property (nonatomic, readonly, weak) id delegate; @property (nonatomic, readonly, getter = isInstallingUpdateOnTermination) BOOL installingUpdateOnTermination; - (void)sendTerminationSignalWithCompletion:(void (^)(void))finishTermination; diff --git a/Sparkle/SUSparkleUserUpdaterDriver.m b/Sparkle/SUSparkleUserUpdaterDriver.m index 8585f45c..5cc495e2 100644 --- a/Sparkle/SUSparkleUserUpdaterDriver.m +++ b/Sparkle/SUSparkleUserUpdaterDriver.m @@ -74,7 +74,7 @@ #pragma mark Birth -- (instancetype)initWithHost:(SUHost *)host handlesTermination:(BOOL)handlesTermination delegate:(id)delegate +- (instancetype)initWithHost:(SUHost *)host handlesTermination:(BOOL)handlesTermination delegate:(id)delegate { self = [super init]; if (self != nil) { @@ -330,7 +330,7 @@ - (void)showAlert:(NSAlert *)alert { dispatch_async(dispatch_get_main_queue(), ^{ - id delegate = self.delegate; + id delegate = self.delegate; if ([delegate respondsToSelector:@selector(userUpdaterDriverWillShowModalAlert:)]) { [delegate userUpdaterDriverWillShowModalAlert:self]; diff --git a/Sparkle/SUUserUpdaterDriver.h b/Sparkle/SUUserUpdaterDriver.h index 0ef87279..0e00fced 100644 --- a/Sparkle/SUUserUpdaterDriver.h +++ b/Sparkle/SUUserUpdaterDriver.h @@ -13,6 +13,7 @@ @class SUUpdatePermissionPromptResult, SUAppcastItem; @protocol SUVersionDisplay; +@protocol SUUserUpdaterDriver; typedef NS_ENUM(NSUInteger, SUUpdateCheckTimerStatus) { SUCheckForUpdateNow, @@ -39,8 +40,22 @@ typedef NS_ENUM(NSUInteger, SUInstallUpdateStatus) { SUCancelUpdateInstallation }; +@protocol SUUserUpdaterDriverDelegate + +@optional + +- (BOOL)responsibleForInitiatingUpdateCheckForUserDriver:(id )userUpdaterDriver; +- (void)initiateUpdateCheckForUserDriver:(id )userUpdaterDriver; + +- (void)userUpdaterDriverWillShowModalAlert:(id )userUpdaterDriver; +- (void)userUpdaterDriverDidShowModalAlert:(id )userUpdaterDriver; + +@end + @protocol SUUserUpdaterDriver +@property (nonatomic, readonly, weak) id delegate; + - (void)startUpdateCheckTimerWithNextTimeInterval:(NSTimeInterval)timeInterval reply:(void (^)(SUUpdateCheckTimerStatus))reply; - (void)invalidateUpdateCheckTimer; diff --git a/TestApplication/SUUpdateSettingsWindowController.m b/TestApplication/SUUpdateSettingsWindowController.m index 950813d4..1bfcd083 100644 --- a/TestApplication/SUUpdateSettingsWindowController.m +++ b/TestApplication/SUUpdateSettingsWindowController.m @@ -25,6 +25,7 @@ @implementation SULoggerUpdateDriver +@synthesize delegate = _delegate; @synthesize downloadUpdateStatusCompletion = _downloadUpdateStatusCompletion; @synthesize updateCheckStatusCompletion = _updateCheckStatusCompletion; @synthesize applicationTerminationHandler = _applicationTerminationHandler;