mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Show the present update in focus when checkForUpdates is invoked
When the update is shown to the user, the menu item for checking for updates is no longer disabled. Instead it is enabled, and when invoked, will bring the update to utmost focus back to the user again. This is consistent with other options (eg Preferences...) that bring up windows. Improved user experience here is that updates are now less "lost". We (re)define properties on SPUUpdater: canCheckForUpdates - to mean that the user can check for updates (start a new update check or show the already present update frontmost) sessionInProgress - to mean if Sparkle's internal driver / scheduler is running (i.e, downloading appcast or update, showing update, starting installation).
This commit is contained in:
1 parent
cb17e08b92
commit
2f783e01f0
16 files changed
+129
-63
No files matched your search
Vendored
+5
@@ -89,6 +89,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)showingUpdate
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)installerDidFinishPreparationAndWillInstallImmediately:(BOOL)willInstallImmediately silently:(BOOL)willInstallSilently
|
||||
{
|
||||
self.willInstallSilently = willInstallSilently;
|
||||
|
||||
Vendored
+5
@@ -60,6 +60,11 @@
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (BOOL)showingUpdate
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error
|
||||
{
|
||||
[self abortUpdateWithError:error];
|
||||
|
||||
Vendored
+8
@@ -19,6 +19,7 @@
|
||||
|
||||
@property (nonatomic, readonly) SPUUIBasedUpdateDriver *uiDriver;
|
||||
@property (nonatomic) BOOL showedUpdate;
|
||||
@property (nonatomic) BOOL showingUpdate;
|
||||
|
||||
@end
|
||||
|
||||
@@ -26,6 +27,7 @@
|
||||
|
||||
@synthesize uiDriver = _uiDriver;
|
||||
@synthesize showedUpdate = _showedUpdate;
|
||||
@synthesize showingUpdate = _showingUpdate;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
{
|
||||
@@ -63,6 +65,12 @@
|
||||
- (void)uiDriverDidShowUpdate
|
||||
{
|
||||
self.showedUpdate = YES;
|
||||
self.showingUpdate = YES;
|
||||
}
|
||||
|
||||
- (void)uiDriverFinishedShowingUpdate
|
||||
{
|
||||
self.showingUpdate = NO;
|
||||
}
|
||||
|
||||
- (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *) error
|
||||
|
||||
Vendored
+6
-10
@@ -57,13 +57,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark Is Update Busy?
|
||||
|
||||
- (void)showCanCheckForUpdates:(BOOL)canCheckForUpdates
|
||||
{
|
||||
assert(NSThread.isMainThread);
|
||||
}
|
||||
|
||||
#pragma mark Update Permission
|
||||
|
||||
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply
|
||||
@@ -99,9 +92,7 @@
|
||||
|
||||
// Only show the update alert if the app is active; otherwise, we'll wait until it is.
|
||||
if ([NSApp isActive]) {
|
||||
if (!userInitiated) {
|
||||
[self.activeUpdateAlert disableKeyboardShortcutForInstallButton];
|
||||
}
|
||||
[self.activeUpdateAlert setInstallButtonFocus:userInitiated];
|
||||
[self.activeUpdateAlert.window makeKeyAndOrderFront:self];
|
||||
} else {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
||||
@@ -195,6 +186,11 @@
|
||||
[self.activeUpdateAlert showReleaseNotesFailedToDownload];
|
||||
}
|
||||
|
||||
- (void)showUpdateInFocus
|
||||
{
|
||||
[self setUpFocusForActiveUpdateAlertWithUserInitiation:YES];
|
||||
}
|
||||
|
||||
#pragma mark Install & Relaunch Update
|
||||
|
||||
- (void)showReadyToInstallAndRelaunch:(void (^)(SPUInstallUpdateStatus))installUpdateHandler
|
||||
|
||||
Vendored
+3
-1
@@ -17,10 +17,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)coreDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error;
|
||||
- (void)uiDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error;
|
||||
|
||||
- (void)uiDriverDidShowUpdate;
|
||||
- (void)uiDriverFinishedShowingUpdate;
|
||||
|
||||
@optional
|
||||
|
||||
- (void)basicDriverDidFinishLoadingAppcast;
|
||||
- (void)uiDriverDidShowUpdate;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Vendored
+9
-3
@@ -115,6 +115,8 @@
|
||||
|
||||
[self.userDriver showInformationalUpdateFoundWithAppcastItem:updateItem userInitiated:self.userInitiated reply:^(SPUInformationalUpdateAlertChoice choice) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate uiDriverFinishedShowingUpdate];
|
||||
|
||||
switch (choice) {
|
||||
case SPUSkipThisInformationalVersionChoice:
|
||||
[self.host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
|
||||
@@ -132,6 +134,8 @@
|
||||
} else if (self.resumingDownloadedUpdate) {
|
||||
[self.userDriver showDownloadedUpdateFoundWithAppcastItem:updateItem userInitiated:self.userInitiated reply:^(SPUUpdateAlertChoice choice) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate uiDriverFinishedShowingUpdate];
|
||||
|
||||
[self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
|
||||
switch (choice) {
|
||||
case SPUInstallUpdateChoice:
|
||||
@@ -154,6 +158,8 @@
|
||||
} else if (!self.resumingInstallingUpdate) {
|
||||
[self.userDriver showUpdateFoundWithAppcastItem:updateItem userInitiated:self.userInitiated reply:^(SPUUpdateAlertChoice choice) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate uiDriverFinishedShowingUpdate];
|
||||
|
||||
[self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
|
||||
switch (choice) {
|
||||
case SPUInstallUpdateChoice:
|
||||
@@ -175,15 +181,15 @@
|
||||
} else {
|
||||
[self.userDriver showResumableUpdateFoundWithAppcastItem:updateItem userInitiated:self.userInitiated reply:^(SPUInstallUpdateStatus choice) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate uiDriverFinishedShowingUpdate];
|
||||
|
||||
[self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
|
||||
[self.coreDriver finishInstallationWithResponse:choice displayingUserInterface:!self.preventsInstallerInteraction];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(uiDriverDidShowUpdate)]) {
|
||||
[self.delegate uiDriverDidShowUpdate];
|
||||
}
|
||||
[self.delegate uiDriverDidShowUpdate];
|
||||
|
||||
if (updateItem.releaseNotesURL != nil && (![updaterDelegate respondsToSelector:@selector(updaterShouldDownloadReleaseNotes:)] || [updaterDelegate updaterShouldDownloadReleaseNotes:self.updater])) {
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:updateItem.releaseNotesURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];
|
||||
|
||||
Vendored
+2
@@ -25,6 +25,8 @@ typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, id<S
|
||||
|
||||
- (void)resumeUpdate:(id<SPUResumableUpdate>)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
@property (nonatomic, readonly) BOOL showingUpdate;
|
||||
|
||||
// A likely implementation of -abortUpdate is invoking -abortUpdateWithError: by passing nil
|
||||
- (void)abortUpdate;
|
||||
|
||||
|
||||
Vendored
+25
-5
@@ -79,9 +79,15 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
Checks for updates, and displays progress while doing so.
|
||||
|
||||
This is meant for users initiating an update check.
|
||||
|
||||
If an update session isn't in progress, the user will be shown that a check for new updates is occurring.
|
||||
If a new update is already being shown, that update will be shown to the user in active focus.
|
||||
|
||||
This may find a resumable update that has already been downloaded or has begun installing, or
|
||||
this may find a new update that can start to be downloaded if the user requests it.
|
||||
This will find updates that the user has opted into skipping.
|
||||
|
||||
See canCheckForUpdates property which can determine if this method may be invoked.
|
||||
*/
|
||||
- (void)checkForUpdates;
|
||||
|
||||
@@ -111,16 +117,30 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
- (void)checkForUpdateInformation;
|
||||
|
||||
/*!
|
||||
A property indicating whether or not updates can be checked.
|
||||
A property indicating whether or not updates can be checked by the user.
|
||||
|
||||
This property is useful for determining whether update checks can be made programatically or by the user.
|
||||
An update check cannot be made when an on-going update check is in progress.
|
||||
An update check can be made by the user when an update session isn't in progress, or when an update is presently being shown.
|
||||
|
||||
Note this property does not reflect whether or not an update itself is in progress. For example,
|
||||
an update check can be done to check if there's an already started update that can be resumed.
|
||||
This property is suitable to use for menu item validation for seeing if -checkForUpdates can be invoked.
|
||||
|
||||
Note this property does not reflect whether or not an update session is in progress. Please see sessionInProgress property instead.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL canCheckForUpdates;
|
||||
|
||||
/*!
|
||||
A property indicating whether or not an update session is in progress.
|
||||
|
||||
An update session is in progress when the appcast is being downloaded, an update is being downloaded,
|
||||
an update is being shown, or the installer is being started. An active session is when Sparkle's fired scheduler is running.
|
||||
|
||||
Note an update session may be inactive even though Sparkle's installer (ran as a separate process) may be running,
|
||||
or even though the update has been downloaded but the installation has been deferred. In both of these cases, an update session
|
||||
may be activated and resumed at a later point (automatically or manually).
|
||||
|
||||
See also canCheckForUpdates property which is more suited for menu item validation.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL sessionInProgress;
|
||||
|
||||
/*!
|
||||
A property indicating whether or not to check for updates automatically.
|
||||
|
||||
|
||||
Vendored
+28
-23
@@ -55,7 +55,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@property (nonatomic, readonly) SPUUpdaterTimer *updaterTimer;
|
||||
@property (nonatomic) BOOL startedUpdater;
|
||||
@property (nonatomic, nullable) id<SPUResumableUpdate> resumableUpdate;
|
||||
@property (nonatomic) BOOL canCheckForUpdates;
|
||||
@property (nonatomic) BOOL sessionInProgress;
|
||||
|
||||
@property (nonatomic, copy) NSDate *updateLastCheckedDate;
|
||||
|
||||
@@ -79,7 +79,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@synthesize sparkleBundle = _sparkleBundle;
|
||||
@synthesize startedUpdater = _startedUpdater;
|
||||
@synthesize resumableUpdate = _resumableUpdate;
|
||||
@synthesize canCheckForUpdates = _canCheckForUpdates;
|
||||
@synthesize sessionInProgress = _sessionInProgress;
|
||||
@synthesize updateLastCheckedDate = _updateLastCheckedDate;
|
||||
@synthesize loggedATSWarning = _loggedATSWarning;
|
||||
@synthesize loggedDSAWarning = _loggedDSAWarning;
|
||||
@@ -147,12 +147,11 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
}
|
||||
|
||||
self.startedUpdater = YES;
|
||||
[self setCanCheckForUpdates:YES];
|
||||
|
||||
// Start updater on next update cycle so we make sure the application invoking the updater is ready
|
||||
// This also gives the developer a cycle to check for updates before Sparkle's update cycle scheduler kicks in
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([self canCheckForUpdates]) {
|
||||
if (!self.sessionInProgress) {
|
||||
[self startUpdateCycle];
|
||||
}
|
||||
});
|
||||
@@ -357,11 +356,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
[self scheduleNextUpdateCheckFiringImmediately:NO];
|
||||
}
|
||||
|
||||
- (void)setCanCheckForUpdates:(BOOL)canCheckForUpdates
|
||||
- (BOOL)canCheckForUpdates
|
||||
{
|
||||
_canCheckForUpdates = canCheckForUpdates;
|
||||
|
||||
[self.userDriver showCanCheckForUpdates:canCheckForUpdates];
|
||||
return self.startedUpdater && (self.driver.showingUpdate || !self.sessionInProgress);
|
||||
}
|
||||
|
||||
- (void)scheduleNextUpdateCheckFiringImmediately:(BOOL)firingImmediately
|
||||
@@ -416,11 +413,11 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.canCheckForUpdates) {
|
||||
SULog(SULogLevelError, @"Error: -checkForUpdatesInBackground called but .canCheckForUpdates == NO");
|
||||
if (self.sessionInProgress) {
|
||||
SULog(SULogLevelError, @"Error: -checkForUpdatesInBackground called but .sessionInProgress == YES");
|
||||
}
|
||||
|
||||
[self setCanCheckForUpdates:NO];
|
||||
self.sessionInProgress = YES;
|
||||
|
||||
// We don't want the probe check to act on the driver if the updater is going near death
|
||||
__weak SPUUpdater *weakSelf = self;
|
||||
@@ -469,26 +466,34 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
|
||||
- (void)checkForUpdates
|
||||
{
|
||||
__weak SPUUpdater *weakSelf = self;
|
||||
if (self.driver.showingUpdate) {
|
||||
if ([self.userDriver respondsToSelector:@selector(showUpdateInFocus)]) {
|
||||
[self.userDriver showUpdateInFocus];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.startedUpdater) {
|
||||
SULog(SULogLevelError, @"Error: checkForUpdates - updater hasn't been started yet. Please call -startUpdater: first");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.canCheckForUpdates) {
|
||||
SULog(SULogLevelError, @"Error: -checkForUpdates called but .canCheckForUpdates == NO");
|
||||
if (self.sessionInProgress) {
|
||||
SULog(SULogLevelError, @"Error: -checkForUpdates called but .sessionInProgress == YES");
|
||||
}
|
||||
|
||||
if (self.driver != nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
[self setCanCheckForUpdates:NO];
|
||||
self.sessionInProgress = YES;
|
||||
|
||||
id <SPUUpdateDriver> theUpdateDriver = [[SPUUserInitiatedUpdateDriver alloc] initWithHost:self.host applicationBundle:self.applicationBundle sparkleBundle:self.sparkleBundle updater:self userDriver:self.userDriver updaterDelegate:self.delegate];
|
||||
|
||||
NSString *bundleIdentifier = self.host.bundle.bundleIdentifier;
|
||||
assert(bundleIdentifier != nil);
|
||||
|
||||
__weak SPUUpdater *weakSelf = self;
|
||||
[SPUProbeInstallStatus probeInstallerInProgressForHostBundleIdentifier:bundleIdentifier completion:^(BOOL installerInProgress) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
SPUUpdater *strongSelf = weakSelf;
|
||||
@@ -514,11 +519,11 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.canCheckForUpdates) {
|
||||
SULog(SULogLevelError, @"Error: -checkForUpdateInformation called but .canCheckForUpdates == NO");
|
||||
if (self.sessionInProgress) {
|
||||
SULog(SULogLevelError, @"Error: -checkForUpdateInformation called but .sessionInProgress == YES");
|
||||
}
|
||||
|
||||
[self setCanCheckForUpdates:NO];
|
||||
self.sessionInProgress = YES;
|
||||
|
||||
NSString *bundleIdentifier = self.host.bundle.bundleIdentifier;
|
||||
assert(bundleIdentifier != nil);
|
||||
@@ -544,7 +549,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
|
||||
if( [self.delegate respondsToSelector: @selector((updaterMayCheckForUpdates:))] && ![self.delegate updaterMayCheckForUpdates:self] )
|
||||
{
|
||||
[self setCanCheckForUpdates:YES];
|
||||
self.sessionInProgress = NO;
|
||||
[self scheduleNextUpdateCheck];
|
||||
return;
|
||||
}
|
||||
@@ -560,7 +565,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
SULog(SULogLevelError, @"Sparkle configuration error (%ld): %@", (long)configurationError.code, configurationError.localizedDescription);
|
||||
SULog(SULogLevelDefault, @"Disabling scheduled updates..");
|
||||
|
||||
[self setCanCheckForUpdates:YES];
|
||||
self.sessionInProgress = NO;
|
||||
[self.driver abortUpdateWithError:configurationError];
|
||||
self.driver = nil;
|
||||
|
||||
@@ -575,7 +580,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
if (strongSelf != nil) {
|
||||
strongSelf.resumableUpdate = resumableUpdate;
|
||||
strongSelf.driver = nil;
|
||||
[strongSelf setCanCheckForUpdates:YES];
|
||||
self.sessionInProgress = NO;
|
||||
[strongSelf updateLastUpdateCheckDate];
|
||||
[strongSelf scheduleNextUpdateCheckFiringImmediately:shouldShowUpdateImmediately];
|
||||
}
|
||||
@@ -591,7 +596,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
} else {
|
||||
// I think this is really unlikely to occur but better be safe
|
||||
[self.driver abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInvalidFeedURLError userInfo:@{ NSLocalizedDescriptionKey: @"Sparkle cannot form a valid feed URL." }]];
|
||||
[self setCanCheckForUpdates:YES];
|
||||
self.sessionInProgress = NO;
|
||||
self.driver = nil;
|
||||
}
|
||||
}
|
||||
@@ -608,7 +613,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
return; // not even ready yet
|
||||
}
|
||||
|
||||
if (self.canCheckForUpdates) {
|
||||
if (!self.sessionInProgress) {
|
||||
[self cancelNextUpdateCycle];
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
|
||||
Vendored
+7
-7
@@ -32,13 +32,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
|
||||
/*!
|
||||
* Show that an update can be checked by the user or not
|
||||
*
|
||||
* A client may choose to update the interface letting the user know if they can check for updates.
|
||||
*/
|
||||
- (void)showCanCheckForUpdates:(BOOL)canCheckForUpdates;
|
||||
|
||||
/*!
|
||||
* Show an updater permission request to the user
|
||||
*
|
||||
@@ -131,6 +124,13 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
*/
|
||||
- (void)showInformationalUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem userInitiated:(BOOL)userInitiated reply:(void (^)(SPUInformationalUpdateAlertChoice))reply;
|
||||
|
||||
/*!
|
||||
* Show the user currently presented update in utmost focus
|
||||
*
|
||||
* Sparkle uses this to make its update frontmost again
|
||||
*/
|
||||
- (void)showUpdateInFocus;
|
||||
|
||||
/*!
|
||||
* Show the user the release notes for the new update
|
||||
*
|
||||
|
||||
+12
@@ -18,6 +18,7 @@
|
||||
@property (nonatomic, readonly) SPUUIBasedUpdateDriver *uiDriver;
|
||||
@property (nonatomic, readonly) id<SPUUserDriver> userDriver;
|
||||
@property (nonatomic) BOOL showingUserInitiatedProgress;
|
||||
@property (nonatomic) BOOL showingUpdate;
|
||||
@property (nonatomic) BOOL aborted;
|
||||
|
||||
@end
|
||||
@@ -26,6 +27,7 @@
|
||||
|
||||
@synthesize uiDriver = _uiDriver;
|
||||
@synthesize userDriver = _userDriver;
|
||||
@synthesize showingUpdate = _showingUpdate;
|
||||
@synthesize showingUserInitiatedProgress = _showingUserInitiatedProgress;
|
||||
@synthesize aborted = _aborted;
|
||||
|
||||
@@ -91,6 +93,16 @@
|
||||
[self.uiDriver resumeUpdate:resumableUpdate completion:completionBlock];
|
||||
}
|
||||
|
||||
- (void)uiDriverDidShowUpdate
|
||||
{
|
||||
self.showingUpdate = YES;
|
||||
}
|
||||
|
||||
- (void)uiDriverFinishedShowingUpdate
|
||||
{
|
||||
self.showingUpdate = NO;
|
||||
}
|
||||
|
||||
- (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error
|
||||
{
|
||||
[self abortUpdateWithError:error];
|
||||
|
||||
Vendored
+2
-1
@@ -32,7 +32,8 @@
|
||||
- (IBAction)installUpdate:sender;
|
||||
- (IBAction)skipThisVersion:sender;
|
||||
- (IBAction)remindMeLater:sender;
|
||||
- (void)disableKeyboardShortcutForInstallButton;
|
||||
|
||||
- (void)setInstallButtonFocus:(BOOL)focus;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Vendored
+7
-2
@@ -133,8 +133,13 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
|
||||
|
||||
- (void)disableKeyboardShortcutForInstallButton {
|
||||
self.installButton.keyEquivalent = @"";
|
||||
- (void)setInstallButtonFocus:(BOOL)focus
|
||||
{
|
||||
if (focus) {
|
||||
self.installButton.keyEquivalent = @"\r";
|
||||
} else {
|
||||
self.installButton.keyEquivalent = @"";
|
||||
}
|
||||
}
|
||||
|
||||
- (void)endWithSelection:(SPUUpdateAlertChoice)choice
|
||||
|
||||
Vendored
+1
-1
@@ -212,7 +212,7 @@ static NSMutableDictionary *sharedUpdaters = nil;
|
||||
{
|
||||
// This is not quite true -- we may be able to check / resume an update if one is in progress
|
||||
// But this is a close enough approximation for 1.x updater API
|
||||
return !self.updater.canCheckForUpdates;
|
||||
return self.updater.sessionInProgress;
|
||||
}
|
||||
|
||||
// Not implemented properly at the moment - leaning towards it not be in the future
|
||||
|
||||
@@ -96,12 +96,6 @@
|
||||
self.updateButtonAction = nil;
|
||||
}
|
||||
|
||||
#pragma mark Can Check for Updates?
|
||||
|
||||
- (void)showCanCheckForUpdates:(BOOL)canCheckForUpdates
|
||||
{
|
||||
}
|
||||
|
||||
#pragma mark Update Permission
|
||||
|
||||
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)__unused request reply:(void (^)(SUUpdatePermissionResponse *))reply
|
||||
@@ -182,6 +176,11 @@
|
||||
{
|
||||
}
|
||||
|
||||
- (void)showUpdateInFocus
|
||||
{
|
||||
[self.window makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
#pragma mark Install & Relaunch Update
|
||||
|
||||
- (void)showReadyToInstallAndRelaunch:(void (^)(SPUInstallUpdateStatus))installUpdateHandler
|
||||
|
||||
@@ -41,10 +41,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)showCanCheckForUpdates:(BOOL)canCheckForUpdates
|
||||
{
|
||||
}
|
||||
|
||||
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)__unused request reply:(void (^)(SUUpdatePermissionResponse *))reply
|
||||
{
|
||||
if (self.updatePermissionResponse == nil) {
|
||||
@@ -138,6 +134,10 @@
|
||||
reply(SPUDismissInformationalNoticeChoice);
|
||||
}
|
||||
|
||||
- (void)showUpdateInFocus
|
||||
{
|
||||
}
|
||||
|
||||
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
|
||||
{
|
||||
if (self.verbose) {
|
||||
|
||||
Reference in new issue
Block a user