mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Just add Sparkle user driver reference to SUUpdaterController
This commit is contained in:
1 parent
8b0eae8ef4
commit
772c6b7d3f
6 files changed
+25
-24
No files matched your search
@@ -181,7 +181,7 @@
|
||||
725CB95B1C7121830064365A /* SUSparkleUserDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 725CB9591C7121830064365A /* SUSparkleUserDriver.m */; };
|
||||
7268AC631AD634C200C3E0C1 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */; };
|
||||
726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
726E4A0E1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E4A0D1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h */; };
|
||||
726E4A0E1C86881600C57C6A /* SUSparkleUserDriverDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E4A0D1C86881600C57C6A /* SUSparkleUserDriverDelegate.h */; };
|
||||
726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; };
|
||||
726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */; };
|
||||
726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; };
|
||||
@@ -643,7 +643,7 @@
|
||||
7268AC641AD634E400C3E0C1 /* SUBinaryDeltaCreate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaCreate.h; sourceTree = "<group>"; };
|
||||
726B2B5D1C645FC900388755 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
726DF88D1C84277500188804 /* SUStatusCompletionResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusCompletionResults.h; sourceTree = "<group>"; };
|
||||
726E4A0D1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUSparkleUserDriverUIDelegate.h; sourceTree = "<group>"; };
|
||||
726E4A0D1C86881600C57C6A /* SUSparkleUserDriverDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUSparkleUserDriverDelegate.h; sourceTree = "<group>"; };
|
||||
726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUOperatingSystem.h; sourceTree = "<group>"; };
|
||||
726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUOperatingSystem.m; sourceTree = "<group>"; };
|
||||
7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileManager.h; sourceTree = "<group>"; };
|
||||
@@ -1000,7 +1000,7 @@
|
||||
children = (
|
||||
7246E0A11C83B685003B4E75 /* SUUpdaterController.h */,
|
||||
7246E0A21C83B685003B4E75 /* SUUpdaterController.m */,
|
||||
726E4A0D1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h */,
|
||||
726E4A0D1C86881600C57C6A /* SUSparkleUserDriverDelegate.h */,
|
||||
725CB9581C7121830064365A /* SUSparkleUserDriver.h */,
|
||||
725CB9591C7121830064365A /* SUSparkleUserDriver.m */,
|
||||
6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */,
|
||||
@@ -1225,7 +1225,7 @@
|
||||
61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */,
|
||||
6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */,
|
||||
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */,
|
||||
726E4A0E1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h in Headers */,
|
||||
726E4A0E1C86881600C57C6A /* SUSparkleUserDriverDelegate.h in Headers */,
|
||||
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */,
|
||||
3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */,
|
||||
);
|
||||
|
||||
Vendored
+1
-12
@@ -11,18 +11,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SUSparkleUserDriverUIDelegate;
|
||||
|
||||
@protocol SUSparkleUserDriverDelegate <NSObject, SUSparkleUserDriverUIDelegate>
|
||||
|
||||
@optional
|
||||
|
||||
- (BOOL)responsibleForInitiatingUpdateCheckForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
- (void)initiateUpdateCheckForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
|
||||
- (BOOL)responsibleForSignalingApplicationTerminationForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
|
||||
@end
|
||||
@protocol SUSparkleUserDriverDelegate;
|
||||
|
||||
@interface SUSparkleUserDriver : NSObject <SUUserDriver>
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "SUSparkleUserDriver.h"
|
||||
#import "SUSparkleUserDriverUIDelegate.h"
|
||||
#import "SUSparkleUserDriverDelegate.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUVersionDisplayProtocol.h"
|
||||
#import "SUHost.h"
|
||||
@@ -348,7 +348,7 @@
|
||||
- (void)showAlert:(NSAlert *)alert
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
id <SUSparkleUserDriverUIDelegate> delegate = self.delegate;
|
||||
id <SUSparkleUserDriverDelegate> delegate = self.delegate;
|
||||
|
||||
if ([delegate respondsToSelector:@selector(userDriverWillShowModalAlert:)]) {
|
||||
[delegate userDriverWillShowModalAlert:self];
|
||||
|
||||
+7
-4
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// SUSparkleUserDriverUIDelegate.h
|
||||
// SUSparkleUserDriverDelegate.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 3/1/16.
|
||||
@@ -12,15 +12,18 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SUUserDriver, SUVersionDisplay;
|
||||
|
||||
@protocol SUSparkleUserDriverUIDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
@protocol SUSparkleUserDriverDelegate <NSObject>
|
||||
|
||||
- (void)userDriverWillShowModalAlert:(id <SUUserDriver>)userDriver;
|
||||
- (void)userDriverDidShowModalAlert:(id <SUUserDriver>)userDriver;
|
||||
|
||||
- (_Nullable id <SUVersionDisplay>)versionDisplayerForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
|
||||
- (BOOL)responsibleForInitiatingUpdateCheckForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
- (void)initiateUpdateCheckForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
|
||||
- (BOOL)responsibleForSignalingApplicationTerminationForUserDriver:(id <SUUserDriver>)userDriver;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+6
@@ -11,6 +11,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SUUpdater;
|
||||
@class SUSparkleUserDriver;
|
||||
|
||||
/*!
|
||||
A controller class that instantiates a SUUpdater and allows binding UI to it.
|
||||
@@ -39,6 +40,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@property (nonatomic, readonly) SUUpdater *updater;
|
||||
|
||||
/*!
|
||||
Accessible property for the updater's user driver.
|
||||
*/
|
||||
@property (nonatomic, readonly) SUSparkleUserDriver *userDriver;
|
||||
|
||||
/*!
|
||||
Explicitly checks for updates and displays a progress dialog while doing so.
|
||||
|
||||
|
||||
Vendored
+5
-2
@@ -12,18 +12,21 @@
|
||||
#import "SUSparkleUserDriver.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SULog.h"
|
||||
#import "SUSparkleUserDriver.h"
|
||||
|
||||
static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaultsObservationContext";
|
||||
|
||||
@interface SUUpdaterController ()
|
||||
|
||||
@property (nonatomic) SUUpdater *updater;
|
||||
@property (nonatomic) SUSparkleUserDriver *userDriver;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SUUpdaterController
|
||||
|
||||
@synthesize updater = _updater;
|
||||
@synthesize userDriver = _userDriver;
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
@@ -32,8 +35,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
[self registerAsObserver];
|
||||
|
||||
NSBundle *hostBundle = [NSBundle mainBundle];
|
||||
id <SUUserDriver> driver = [[SUSparkleUserDriver alloc] initWithHostBundle:hostBundle delegate:nil];
|
||||
self.updater = [[SUUpdater alloc] initWithHostBundle:hostBundle userDriver:driver delegate:nil];
|
||||
_userDriver = [[SUSparkleUserDriver alloc] initWithHostBundle:hostBundle delegate:nil];
|
||||
_updater = [[SUUpdater alloc] initWithHostBundle:hostBundle userDriver:_userDriver delegate:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user