Disable determinate progress for guided pkg install properly

This commit is contained in:
Zorg committed 2021-02-19 20:50:04 -08:00
1 parent acd22dda12
commit 7980c4dfdc
5 files changed
+23 -2

No files matched your search

+4 -2
View File
@@ -136,7 +136,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
self.statusController = [[SUStatusController alloc] initWithHost:host];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:Nil isDefault:NO];
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
maxProgressValue:100 statusText: @""];
maxProgressValue:installer.supportsDeterminateProgress ? 100 : 0 statusText: @""];
[self.statusController showWindow:self];
}
@@ -153,7 +153,9 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
void(^progressBlock)(double) = ^(double progress){
dispatch_async(dispatch_get_main_queue(), ^(){
self.statusController.progressValue = progress * 100.0;
if (installer.supportsDeterminateProgress) {
self.statusController.progressValue = progress * 100.0;
}
});
};
+7
View File
@@ -54,4 +54,11 @@
return YES;
}
// We used to, but it broke due to fragile text processing
// Maybe one day someone will fix it, but until then.
- (BOOL)supportsDeterminateProgress
{
return NO;
}
@end
+2
View File
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
// Should be thread safe
- (NSString *)installationPath;
- (BOOL)supportsDeterminateProgress;
@end
NS_ASSUME_NONNULL_END
+5
View File
@@ -78,4 +78,9 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open";
return NO;
}
- (BOOL)supportsDeterminateProgress
{
return NO;
}
@end
+5
View File
@@ -265,4 +265,9 @@
return YES;
}
- (BOOL)supportsDeterminateProgress
{
return YES;
}
@end