mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-29 05:24:26 +00:00
s/SUUpdatePermissionPromptResult/SUUpdatePermission/ && s/shouldSendProfile/sendProfile/
This commit is contained in:
1 parent
1356024b25
commit
350eba452c
17 files changed
+98
-95
No files matched your search
@@ -87,7 +87,6 @@
|
||||
61299A6009CA6EB100B7442F /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
|
||||
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A8B09CA790200B7442F /* SUUnarchiver.h */; };
|
||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; settings = {ATTRIBUTES = (); }; };
|
||||
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; };
|
||||
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; };
|
||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
||||
@@ -224,8 +223,9 @@
|
||||
729746571C936D5E00FC134E /* SUMessageTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 729746551C936D5E00FC134E /* SUMessageTypes.h */; };
|
||||
729746581C936D5E00FC134E /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; };
|
||||
729746591C936D5E00FC134E /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; };
|
||||
72A450531C69A68900D67EEA /* SUUpdatePermissionPromptResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
72A450541C69A68900D67EEA /* SUUpdatePermissionPromptResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */; };
|
||||
72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; };
|
||||
72A450531C69A68900D67EEA /* SUUpdatePermission.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A450511C69A68900D67EEA /* SUUpdatePermission.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
72A450541C69A68900D67EEA /* SUUpdatePermission.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A450521C69A68900D67EEA /* SUUpdatePermission.m */; };
|
||||
72A4A2401BB6567D00E7820D /* SUFileManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */; };
|
||||
72A6F97E1C94C370005F404C /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */; };
|
||||
72A6F97F1C94C392005F404C /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; };
|
||||
@@ -862,8 +862,8 @@
|
||||
729746561C936D5E00FC134E /* SUMessageTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUMessageTypes.m; sourceTree = "<group>"; };
|
||||
729F10FD1C65A9B500DFCCC5 /* ConfigUITest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITest.xcconfig; sourceTree = "<group>"; };
|
||||
729F10FE1C65A9B500DFCCC5 /* ConfigUITestCoverage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestCoverage.xcconfig; sourceTree = "<group>"; };
|
||||
72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionPromptResult.h; sourceTree = "<group>"; };
|
||||
72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPromptResult.m; sourceTree = "<group>"; };
|
||||
72A450511C69A68900D67EEA /* SUUpdatePermission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermission.h; sourceTree = "<group>"; };
|
||||
72A450521C69A68900D67EEA /* SUUpdatePermission.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermission.m; sourceTree = "<group>"; };
|
||||
72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUFileManagerTest.swift; sourceTree = "<group>"; };
|
||||
72A6F97D1C94A5C2005F404C /* SUInstallerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstallerProtocol.h; path = Autoupdate/SUInstallerProtocol.h; sourceTree = "<group>"; };
|
||||
72A6F9891C94E2D6005F404C /* SUUpdaterDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterDelegate.h; sourceTree = "<group>"; };
|
||||
@@ -1373,8 +1373,6 @@
|
||||
55C14F05136EF6DB00649790 /* SULog.m */,
|
||||
726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */,
|
||||
726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */,
|
||||
72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */,
|
||||
72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */,
|
||||
);
|
||||
includeInIndex = 1;
|
||||
name = "Other Sources";
|
||||
@@ -1458,6 +1456,8 @@
|
||||
726E078B1CA891E9001A286B /* SUUpdaterSettings.h */,
|
||||
726E078C1CA891E9001A286B /* SUUpdaterSettings.m */,
|
||||
72A6F9891C94E2D6005F404C /* SUUpdaterDelegate.h */,
|
||||
72A450511C69A68900D67EEA /* SUUpdatePermission.h */,
|
||||
72A450521C69A68900D67EEA /* SUUpdatePermission.m */,
|
||||
);
|
||||
name = "Update Control";
|
||||
sourceTree = "<group>";
|
||||
@@ -1700,7 +1700,7 @@
|
||||
72162B061C82C8B30013C1C5 /* SUParameterAssert.h in Headers */,
|
||||
729746571C936D5E00FC134E /* SUMessageTypes.h in Headers */,
|
||||
726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */,
|
||||
72A450531C69A68900D67EEA /* SUUpdatePermissionPromptResult.h in Headers */,
|
||||
72A450531C69A68900D67EEA /* SUUpdatePermission.h in Headers */,
|
||||
7229E1B61C97C91100CB50D0 /* SUUpdateDriver.h in Headers */,
|
||||
729746401C9119F300FC134E /* SULocalMessagePort.h in Headers */,
|
||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */,
|
||||
@@ -1708,6 +1708,7 @@
|
||||
72F94F581CC44DE1002DEE68 /* SUXPCServiceInfo.h in Headers */,
|
||||
72162B081C82C9600013C1C5 /* SULocalizations.h in Headers */,
|
||||
61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */,
|
||||
72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */,
|
||||
7246E0A31C83B685003B4E75 /* SUStandardUpdaterController.h in Headers */,
|
||||
726E08011CAF3F70001A286B /* SUDownloaderDelegate.h in Headers */,
|
||||
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */,
|
||||
@@ -1748,7 +1749,6 @@
|
||||
7229E1BD1C98EFF200CB50D0 /* SUDownloadDriver.h in Headers */,
|
||||
72B767CE1C9B924900A07552 /* SUInstallerDriver.h in Headers */,
|
||||
61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */,
|
||||
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */,
|
||||
61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */,
|
||||
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */,
|
||||
3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */,
|
||||
@@ -2600,7 +2600,7 @@
|
||||
725602D61C83551C00DAA70E /* SUApplicationInfo.m in Sources */,
|
||||
72B767DF1C9CDB9700A07552 /* SUUserInitiatedUpdateDriver.m in Sources */,
|
||||
72B767CF1C9B924900A07552 /* SUInstallerDriver.m in Sources */,
|
||||
72A450541C69A68900D67EEA /* SUUpdatePermissionPromptResult.m in Sources */,
|
||||
72A450541C69A68900D67EEA /* SUUpdatePermission.m in Sources */,
|
||||
7229E1BA1C97CC4D00CB50D0 /* SUScheduledUpdateDriver.m in Sources */,
|
||||
729746411C9119F300FC134E /* SULocalMessagePort.m in Sources */,
|
||||
726E07611CA4E9A5001A286B /* SUInstallationInputData.m in Sources */,
|
||||
|
||||
Vendored
+1
-1
@@ -102,7 +102,7 @@
|
||||
|
||||
#pragma mark Update Permission
|
||||
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// This shows a modal alert dialog which unlike other alerts cannot be closed until the user makes a decision
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// SUUpdatePermissionPromptResult.h
|
||||
// SUUpdatePermission.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 2/8/16.
|
||||
@@ -14,11 +14,11 @@ typedef NS_ENUM(NSInteger, SUCheckUpdatesChoice) {
|
||||
SUDoNotAutomaticallyCheck
|
||||
};
|
||||
|
||||
SU_EXPORT @interface SUUpdatePermissionPromptResult : NSObject<NSSecureCoding>
|
||||
SU_EXPORT @interface SUUpdatePermission : NSObject<NSSecureCoding>
|
||||
|
||||
+ (instancetype)updatePermissionPromptResultWithChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile;
|
||||
+ (instancetype)updatePermissionWithChoice:(SUCheckUpdatesChoice)choice sendProfile:(BOOL)sendProfile;
|
||||
|
||||
@property (nonatomic, readonly) SUCheckUpdatesChoice choice;
|
||||
@property (nonatomic, readonly) BOOL shouldSendProfile;
|
||||
@property (nonatomic, readonly) BOOL sendProfile;
|
||||
|
||||
@end
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// SUUpdatePermission.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 2/8/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUpdatePermission.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
static NSString *SUUpdatePermissionChoiceKey = @"SUUpdatePermissionChoice";
|
||||
static NSString *SUUpdatePermissionSendProfileKey = @"SUUpdatePermissionSendProfile";
|
||||
|
||||
@implementation SUUpdatePermission
|
||||
|
||||
@synthesize choice = _choice;
|
||||
@synthesize sendProfile = _sendProfile;
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
NSInteger choice = [decoder decodeIntegerForKey:SUUpdatePermissionChoiceKey];
|
||||
BOOL sendProfile = [decoder decodeBoolForKey:SUUpdatePermissionSendProfileKey];
|
||||
return [[self class] updatePermissionWithChoice:choice sendProfile:sendProfile];
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)encoder
|
||||
{
|
||||
[encoder encodeInteger:self.choice forKey:SUUpdatePermissionChoiceKey];
|
||||
[encoder encodeBool:self.sendProfile forKey:SUUpdatePermissionSendProfileKey];
|
||||
}
|
||||
|
||||
- (instancetype)initWithCheckUpdatesChoice:(SUCheckUpdatesChoice)choice sendProfile:(BOOL)sendProfile
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_choice = choice;
|
||||
_sendProfile = sendProfile;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (instancetype)updatePermissionWithChoice:(SUCheckUpdatesChoice)choice sendProfile:(BOOL)sendProfile
|
||||
{
|
||||
return [[self alloc] initWithCheckUpdatesChoice:choice sendProfile:sendProfile];
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+2
-2
@@ -11,11 +11,11 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class SUHost, SUUpdatePermissionPromptResult;
|
||||
@class SUHost, SUUpdatePermission;
|
||||
|
||||
@interface SUUpdatePermissionPrompt : NSWindowController
|
||||
|
||||
+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply;
|
||||
+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply;
|
||||
|
||||
- (IBAction)toggleMoreInfo:(id)sender;
|
||||
- (IBAction)finishPrompt:(id)sender;
|
||||
|
||||
Vendored
+5
-5
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "SUUpdatePermissionPrompt.h"
|
||||
#import "SUUpdatePermissionPromptResult.h"
|
||||
#import "SUUpdatePermission.h"
|
||||
#import "SULocalizations.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
@@ -26,7 +26,7 @@
|
||||
@property (weak) IBOutlet NSButton *moreInfoButton;
|
||||
@property (weak) IBOutlet NSTableView *profileTableView;
|
||||
|
||||
@property (nonatomic, readonly) void (^reply)(SUUpdatePermissionPromptResult *);
|
||||
@property (nonatomic, readonly) void (^reply)(SUUpdatePermission *);
|
||||
|
||||
@end
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
@synthesize moreInfoButton;
|
||||
@synthesize profileTableView;
|
||||
|
||||
- (instancetype)initPromptWithHost:(SUHost *)theHost systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply
|
||||
- (instancetype)initPromptWithHost:(SUHost *)theHost systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply
|
||||
{
|
||||
self = [super initWithWindowNibName:@"SUUpdatePermissionPrompt"];
|
||||
if (self)
|
||||
@@ -57,7 +57,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply
|
||||
+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply
|
||||
{
|
||||
// If this is a background application we need to focus it in order to bring the prompt
|
||||
// to the user's attention. Otherwise the prompt would be hidden behind other applications and
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
- (IBAction)finishPrompt:(id)sender
|
||||
{
|
||||
self.reply([SUUpdatePermissionPromptResult updatePermissionPromptResultWithChoice:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck) shouldSendProfile:self.shouldSendProfile]);
|
||||
self.reply([SUUpdatePermission updatePermissionWithChoice:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck) sendProfile:self.shouldSendProfile]);
|
||||
|
||||
[[self window] close];
|
||||
[NSApp stopModal];
|
||||
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// SUUpdatePermissionPromptResult.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 2/8/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUpdatePermissionPromptResult.h"
|
||||
|
||||
#ifdef _APPKITDEFINES_H
|
||||
#error This is a "core" class and should NOT import AppKit
|
||||
#endif
|
||||
|
||||
@implementation SUUpdatePermissionPromptResult
|
||||
|
||||
@synthesize choice = _choice;
|
||||
@synthesize shouldSendProfile = _shouldSendProfile;
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
NSInteger choice = [decoder decodeIntegerForKey:@"choice"];
|
||||
BOOL shouldSendProfile = [decoder decodeBoolForKey:@"shouldSendProfile"];
|
||||
return [[self class] updatePermissionPromptResultWithChoice:choice shouldSendProfile:shouldSendProfile];
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)encoder
|
||||
{
|
||||
[encoder encodeInteger:self.choice forKey:@"choice"];
|
||||
[encoder encodeBool:self.shouldSendProfile forKey:@"shouldSendProfile"];
|
||||
}
|
||||
|
||||
- (instancetype)initWithCheckUpdatesChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_choice = choice;
|
||||
_shouldSendProfile = shouldSendProfile;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (instancetype)updatePermissionPromptResultWithChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile
|
||||
{
|
||||
return [[self alloc] initWithCheckUpdatesChoice:choice shouldSendProfile:shouldSendProfile];
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+4
-4
@@ -10,7 +10,7 @@
|
||||
#import "SUUpdaterDelegate.h"
|
||||
#import "SUUpdaterSettings.h"
|
||||
#import "SUHost.h"
|
||||
#import "SUUpdatePermissionPromptResult.h"
|
||||
#import "SUUpdatePermission.h"
|
||||
#import "SUUpdateDriver.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SULog.h"
|
||||
@@ -252,7 +252,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
}
|
||||
|
||||
__weak SUUpdater *weakSelf = self;
|
||||
[self.userDriver requestUpdatePermissionWithSystemProfile:profileInfo reply:^(SUUpdatePermissionPromptResult *result) {
|
||||
[self.userDriver requestUpdatePermissionWithSystemProfile:profileInfo reply:^(SUUpdatePermission *result) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
SUUpdater *strongSelf = weakSelf;
|
||||
if (strongSelf != nil) {
|
||||
@@ -275,9 +275,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updatePermissionPromptFinishedWithResult:(SUUpdatePermissionPromptResult *)result
|
||||
- (void)updatePermissionPromptFinishedWithResult:(SUUpdatePermission *)result
|
||||
{
|
||||
[self.host setBool:result.shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
||||
[self.host setBool:result.sendProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
||||
[self setAutomaticallyChecksForUpdates:(result.choice == SUAutomaticallyCheck)];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -11,7 +11,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SUUpdatePermissionPromptResult, SUAppcastItem;
|
||||
@class SUUpdatePermission, SUAppcastItem;
|
||||
|
||||
/*!
|
||||
The API in Sparkle for controlling the user interaction.
|
||||
@@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* This can be called from any thread
|
||||
*/
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply;
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermission *))reply;
|
||||
|
||||
/*!
|
||||
* Show the user initating an update check
|
||||
|
||||
Vendored
+1
-1
@@ -22,7 +22,7 @@
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUVersionDisplayProtocol.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SUUpdatePermissionPromptResult.h"
|
||||
#import "SUUpdatePermission.h"
|
||||
#import "SUUserDriver.h"
|
||||
#import "SUStandardUserDriver.h"
|
||||
#import "SUStandardUserDriverDelegate.h"
|
||||
|
||||
@@ -150,11 +150,11 @@
|
||||
|
||||
#pragma mark Update Permission
|
||||
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermission *))reply
|
||||
{
|
||||
// Just make a decision..
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
reply([SUUpdatePermissionPromptResult updatePermissionPromptResultWithChoice:SUAutomaticallyCheck shouldSendProfile:NO]);
|
||||
reply([SUUpdatePermission updatePermissionWithChoice:SUAutomaticallyCheck sendProfile:NO]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
- (void)invalidateUpdateCheckTimer {}
|
||||
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))__unused reply {}
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermission *))__unused reply {}
|
||||
|
||||
- (void)showUserInitiatedUpdateCheckWithCompletion:(void (^)(SUUserInitiatedCheckStatus))__unused updateCheckStatusCompletion {}
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SUUpdatePermissionPromptResult;
|
||||
@class SUUpdatePermission;
|
||||
|
||||
@interface SUCommandLineDriver : NSObject
|
||||
|
||||
- (nullable instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose;
|
||||
- (nullable instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose;
|
||||
|
||||
- (void)runAndCheckForUpdatesNow:(BOOL)checkForUpdatesNow;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@synthesize updater = _updater;
|
||||
@synthesize applicationBundlePath = _applicationBundlePath;
|
||||
|
||||
- (instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose
|
||||
- (instancetype)initWithUpdateBundlePath:(NSString *)updateBundlePath applicationBundlePath:(nullable NSString *)applicationBundlePath updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
|
||||
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SUCommandLineUserDriver : NSObject <SUUserDriver>
|
||||
|
||||
- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose;
|
||||
- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@interface SUCommandLineUserDriver ()
|
||||
|
||||
@property (nonatomic, readonly) NSBundle *applicationBundle;
|
||||
@property (nonatomic, nullable, readonly) SUUpdatePermissionPromptResult *updatePermission;
|
||||
@property (nonatomic, nullable, readonly) SUUpdatePermission *updatePermission;
|
||||
@property (nonatomic, readonly) BOOL deferInstallation;
|
||||
@property (nonatomic, readonly) BOOL verbose;
|
||||
@property (nonatomic, readonly) SUUserDriverCoreComponent *coreComponent;
|
||||
@@ -33,7 +33,7 @@
|
||||
@synthesize bytesDownloaded = _bytesDownloaded;
|
||||
@synthesize bytesToDownload = _bytesToDownload;
|
||||
|
||||
- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermissionPromptResult *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose
|
||||
- (instancetype)initWithApplicationBundle:(NSBundle *)applicationBundle updatePermission:(nullable SUUpdatePermission *)updatePermission deferInstallation:(BOOL)deferInstallation verbose:(BOOL)verbose
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
@@ -86,7 +86,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply
|
||||
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)__unused systemProfile reply:(void (^)(SUUpdatePermission *))reply
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.updatePermission == nil) {
|
||||
@@ -95,7 +95,7 @@
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
if (self.verbose) {
|
||||
fprintf(stderr, "Granting permission for automatic update checks with sending system profile %s...\n", self.updatePermission.shouldSendProfile ? "enabled" : "disabled");
|
||||
fprintf(stderr, "Granting permission for automatic update checks with sending system profile %s...\n", self.updatePermission.sendProfile ? "enabled" : "disabled");
|
||||
}
|
||||
reply(self.updatePermission);
|
||||
}
|
||||
|
||||
+2
-2
@@ -92,9 +92,9 @@ int main(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
SUUpdatePermissionPromptResult *updatePermission = nil;
|
||||
SUUpdatePermission *updatePermission = nil;
|
||||
if (grantAutomaticChecking) {
|
||||
updatePermission = [SUUpdatePermissionPromptResult updatePermissionPromptResultWithChoice:SUAutomaticallyCheck shouldSendProfile:sendProfile];
|
||||
updatePermission = [SUUpdatePermission updatePermissionWithChoice:SUAutomaticallyCheck sendProfile:sendProfile];
|
||||
}
|
||||
|
||||
SUCommandLineDriver *driver = [[SUCommandLineDriver alloc] initWithUpdateBundlePath:updatePath applicationBundlePath:applicationPath updatePermission:updatePermission deferInstallation:deferInstall verbose:verbose];
|
||||
|
||||
Reference in new issue
Block a user