mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Merge pull request #1696 from lorenrh/customUpdateButtons
Hide automatic update button and skip button, depending on `SUAutomaticallyUpdate` key
This commit is contained in:
1 file changed
+17
Vendored
+17
@@ -326,6 +326,13 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
self.laterButton.enabled = NO;
|
||||
self.laterButton.hidden = YES;
|
||||
}
|
||||
|
||||
if([self automaticallyUpdateEnabled]) {
|
||||
self.skipButton.hidden = YES;
|
||||
self.automaticallyInstallUpdatesButton.hidden = YES;
|
||||
[self.laterButton setTitle:SULocalizedString(@"Install later", @"Alternate title for 'Remind me later' button when automatic updates are enabled")];
|
||||
}
|
||||
|
||||
[self.window center];
|
||||
}
|
||||
|
||||
@@ -339,6 +346,16 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
return [automaticChecksEnabled boolValue];
|
||||
}
|
||||
|
||||
- (BOOL)automaticallyUpdateEnabled {
|
||||
NSNumber *automaticChecksEnabled = [self.host objectForKey:SUAutomaticallyUpdateKey];
|
||||
if (automaticChecksEnabled == nil)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return [automaticChecksEnabled boolValue];
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(NSNotification *) __unused note
|
||||
{
|
||||
[self endWithSelection:SURemindMeLaterChoice];
|
||||
|
||||
Reference in new issue
Block a user