mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Fix automatic updates checkbox state when not showing release notes
This commit is contained in:
1 parent
a85db747f1
commit
f60b60b08f
2 files changed
+11
-18
No files matched your search
Vendored
-5
@@ -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>
|
||||
|
||||
Vendored
+11
-13
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user