Allow manual checks when an install on quit update is pending

This commit is contained in:
Matt Stevens committed 2012-03-01 22:41:49 -07:00
1 parent 409e7e22bf
commit 7fc9e32ce7
4 files changed
+13 -1

No files matched your search

+6 -1
View File
@@ -19,6 +19,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
- (void)showUpdateAlert
{
isInterruptible = NO;
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem host:host delegate:self];
// If the app is a menubar app or the like, we need to focus it first and alter the
@@ -69,6 +70,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
else
{
showUpdateAlertTimer = [[NSTimer scheduledTimerWithTimeInterval:SUAutomaticUpdatePromptImpatienceTimer target:self selector:@selector(showUpdateAlert) userInfo:nil repeats:NO] retain];
// At this point the driver is idle, allow it to be interrupted for user-initiated update checks.
isInterruptible = YES;
}
}
@@ -126,7 +130,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
break;
case SUInstallLaterChoice:
// No-op: we're already waiting on quit.
// We're already waiting on quit, just indicate that we're idle.
isInterruptible = YES;
break;
case SUDoNotInstallChoice:
+2
View File
@@ -21,11 +21,13 @@ extern NSString * const SUUpdateDriverFinishedNotification;
NSURL *appcastURL;
BOOL finished;
BOOL isInterruptible;
}
- initWithUpdater:(SUUpdater *)updater;
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
- (void)abortUpdate;
- (BOOL)isInterruptible;
- (BOOL)finished;
@end
+2
View File
@@ -33,6 +33,8 @@ NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdateDriverFinishedNotification object:self];
}
- (BOOL)isInterruptible { return isInterruptible; }
- (BOOL)finished { return finished; }
- (void)dealloc
+3
View File
@@ -288,6 +288,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
- (IBAction)checkForUpdates: (id)sender
{
if (driver && [driver isInterruptible])
[driver abortUpdate];
[self checkForUpdatesWithDriver:[[[SUUserInitiatedUpdateDriver alloc] initWithUpdater:self] autorelease]];
}