mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
User updater driver is now aware about updates being in progress or not
This commit is contained in:
1 parent
8c769ca9cd
commit
45e6951552
4 files changed
+21
No files matched your search
Vendored
+2
@@ -15,6 +15,8 @@
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host handlesTermination:(BOOL)handlesTermination delegate:(id <SUUserUpdaterDriverDelegate>)delegate;
|
||||
|
||||
@property (nonatomic, readonly, getter=isUpdateInProgress) BOOL updateInProgress;
|
||||
|
||||
- (NSApplicationTerminateReply)sendApplicationTerminationSignal;
|
||||
|
||||
@end
|
||||
Vendored
+14
@@ -38,6 +38,8 @@
|
||||
@property (nonatomic, readonly) SUHost *host;
|
||||
@property (nonatomic, readonly) BOOL handlesTermination;
|
||||
|
||||
@property (nonatomic) BOOL updaterInProgress;
|
||||
|
||||
@property (nonatomic) NSTimer *checkUpdateTimer;
|
||||
@property (nonatomic, copy) void (^checkForUpdatesReply)(SUUpdateCheckTimerStatus);
|
||||
|
||||
@@ -61,6 +63,7 @@
|
||||
@synthesize host = _host;
|
||||
@synthesize handlesTermination = _handlesTermination;
|
||||
@synthesize delegate = _delegate;
|
||||
@synthesize updaterInProgress = _updaterInProgress;
|
||||
@synthesize checkUpdateTimer = _checkUpdateTimer;
|
||||
@synthesize checkForUpdatesReply = _checkForUpdatesReply;
|
||||
@synthesize checkingController = _checkingController;
|
||||
@@ -85,6 +88,15 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark Is Update Busy?
|
||||
|
||||
- (void)showUpdateInProgress:(BOOL)isUpdateInProgress
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.updaterInProgress = isUpdateInProgress;
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark Check Updates Timer
|
||||
|
||||
- (BOOL)isDelegateResponsibleForUpdateChecking
|
||||
@@ -533,6 +545,8 @@
|
||||
// Make sure everything we call here does not dispatch async to main queue
|
||||
// because we are already on the main queue (and I've been bitten in the past by this before)
|
||||
|
||||
self.updaterInProgress = NO;
|
||||
|
||||
[self _invalidateUpdateCheckTimer];
|
||||
|
||||
[self cancelCheckForUpdates];
|
||||
|
||||
Vendored
+3
@@ -165,6 +165,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
if ([note object] == self.driver && [self.driver finished])
|
||||
{
|
||||
self.driver = nil;
|
||||
[self.userUpdaterDriver showUpdateInProgress:NO];
|
||||
[self updateLastUpdateCheckDate];
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
@@ -342,6 +343,8 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, SU
|
||||
[self scheduleNextUpdateCheck];
|
||||
return;
|
||||
}
|
||||
|
||||
[self.userUpdaterDriver showUpdateInProgress:YES];
|
||||
|
||||
[self checkIfConfiguredProperly];
|
||||
|
||||
|
||||
Vendored
+2
@@ -56,6 +56,8 @@ typedef NS_ENUM(NSUInteger, SUInstallUpdateStatus) {
|
||||
|
||||
@property (nonatomic, readonly, weak) id <SUUserUpdaterDriverDelegate> delegate;
|
||||
|
||||
- (void)showUpdateInProgress:(BOOL)isUpdateInProgress;
|
||||
|
||||
- (void)startUpdateCheckTimerWithNextTimeInterval:(NSTimeInterval)timeInterval reply:(void (^)(SUUpdateCheckTimerStatus))reply;
|
||||
- (void)invalidateUpdateCheckTimer;
|
||||
|
||||
|
||||
Reference in new issue
Block a user