Fix automatic updates checkbox state when not showing release notes

This commit is contained in:
Zorg committed 2021-01-23 21:14:59 -08:00
1 parent a85db747f1
commit f60b60b08f
2 files changed
+11 -18

No files matched your search

-5
View File
@@ -174,11 +174,6 @@ DQ
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<binding destination="-2" name="hidden" keyPath="allowsAutomaticUpdates" id="141">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="93" name="value" keyPath="values.SUAutomaticallyUpdate" id="135"/>
</connections>
</button>
+11 -13
View File
@@ -313,22 +313,20 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
// Automatic downloads is enabled by developer if they set SUAutomaticallyUpdateKey in Info.plist,
// rather than the user toggling the setting
BOOL automaticDownloadsEnabledByDeveloper = [self.host boolForInfoDictionaryKey:SUAutomaticallyUpdateKey];
if (showReleaseNotes && (!allowsAutomaticUpdates || automaticDownloadsEnabledByDeveloper)) {
// Fix constraints so that buttons aren't far away from web view when we hide the automatic updates check box
NSLayoutConstraint *skipButtonToReleaseNotesContainerConstraint = [NSLayoutConstraint constraintWithItem:self.skipButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.releaseNotesContainerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12.0];
[self.window.contentView addConstraint:skipButtonToReleaseNotesContainerConstraint];
[self.automaticallyInstallUpdatesButton removeFromSuperview];
if (!allowsAutomaticUpdates || automaticDownloadsEnabledByDeveloper) {
if (showReleaseNotes) {
// Fix constraints so that buttons aren't far away from web view when we hide the automatic updates check box
NSLayoutConstraint *skipButtonToReleaseNotesContainerConstraint = [NSLayoutConstraint constraintWithItem:self.skipButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.releaseNotesContainerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12.0];
[self.window.contentView addConstraint:skipButtonToReleaseNotesContainerConstraint];
[self.automaticallyInstallUpdatesButton removeFromSuperview];
} else {
self.automaticallyInstallUpdatesButton.enabled = NO;
}
}
if (automaticDownloadsEnabledByDeveloper) {
if (!showReleaseNotes) {
// Disable automatic install updates option if the developer wishes for it in Info.plist
// If we are showing release notes, this button will be hidden instead
self.automaticallyInstallUpdatesButton.enabled = NO;
}
// A developer wishing for automatic updates shouldn't want users to skip updates
self.skipButton.hidden = YES;
}