mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-29 05:24:26 +00:00
Hide "Skip..." and "Remind..." buttons. (#1480)
Show/Hide skip/later buttons based on whether update is critical / automatic updates enabled. The skip-button is now hidden for critical updates, and the later-button is hidden if automatic updates are disabled. Note that the user can still choose to just close the window by clicking the red dot at the top of the window.
This commit is contained in:
1 parent
8f01babdd3
commit
0cfedd4516
1 file changed
+18
Vendored
+18
@@ -262,11 +262,29 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
|
||||
if ([self.updateItem isCriticalUpdate]) {
|
||||
self.skipButton.enabled = NO;
|
||||
self.skipButton.hidden = YES;
|
||||
self.laterButton.enabled = NO;
|
||||
self.laterButton.hidden = YES;
|
||||
}
|
||||
|
||||
if (![self automaticChecksEnabled]) {
|
||||
self.laterButton.enabled = NO;
|
||||
self.laterButton.hidden = YES;
|
||||
}
|
||||
|
||||
[self.window center];
|
||||
}
|
||||
|
||||
- (BOOL)automaticChecksEnabled {
|
||||
NSNumber *automaticChecksEnabled = [self.host objectForInfoDictionaryKey:SUEnableAutomaticChecksKey];
|
||||
if (automaticChecksEnabled == nil)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return [automaticChecksEnabled boolValue];
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(NSNotification *) __unused note
|
||||
{
|
||||
[self endWithSelection:SURemindMeLaterChoice];
|
||||
|
||||
Reference in new issue
Block a user