diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 7ff6de0d..67c98f1c 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -327,6 +327,8 @@ 729E1D17266490FE00BF3EFB /* SPUAppcastItemSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = 729E1D14266490FE00BF3EFB /* SPUAppcastItemSelection.h */; }; 729E1D18266490FE00BF3EFB /* SPUAppcastItemSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 729E1D15266490FE00BF3EFB /* SPUAppcastItemSelection.m */; }; 729E1D19266490FE00BF3EFB /* SPUAppcastItemSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 729E1D15266490FE00BF3EFB /* SPUAppcastItemSelection.m */; }; + 729E1D1B2664C2C500BF3EFB /* SPUUserUpdateChoice.h in Headers */ = {isa = PBXBuildFile; fileRef = 729E1D1A2664C1F800BF3EFB /* SPUUserUpdateChoice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 729E1D1C2664C34000BF3EFB /* SPUUserUpdateChoice.h in Headers */ = {isa = PBXBuildFile; fileRef = 729E1D1A2664C1F800BF3EFB /* SPUUserUpdateChoice.h */; settings = {ATTRIBUTES = (Public, ); }; }; 72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; }; 72A450531C69A68900D67EEA /* SUUpdatePermissionResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A450511C69A68900D67EEA /* SUUpdatePermissionResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 72A450541C69A68900D67EEA /* SUUpdatePermissionResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A450521C69A68900D67EEA /* SUUpdatePermissionResponse.m */; }; @@ -1300,6 +1302,7 @@ 729BB3D11D503826007C4276 /* org.sparkle-project.Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "org.sparkle-project.Downloader.entitlements"; path = "Downloader/org.sparkle-project.Downloader.entitlements"; sourceTree = SOURCE_ROOT; }; 729E1D14266490FE00BF3EFB /* SPUAppcastItemSelection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUAppcastItemSelection.h; sourceTree = ""; }; 729E1D15266490FE00BF3EFB /* SPUAppcastItemSelection.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SPUAppcastItemSelection.m; sourceTree = ""; }; + 729E1D1A2664C1F800BF3EFB /* SPUUserUpdateChoice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUUserUpdateChoice.h; sourceTree = ""; }; 729F10FD1C65A9B500DFCCC5 /* ConfigUITest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITest.xcconfig; sourceTree = ""; }; 729F10FE1C65A9B500DFCCC5 /* ConfigUITestCoverage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestCoverage.xcconfig; sourceTree = ""; }; 72A450511C69A68900D67EEA /* SUUpdatePermissionResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionResponse.h; sourceTree = ""; }; @@ -2160,6 +2163,7 @@ 725CB9591C7121830064365A /* SPUStandardUserDriver.m */, 726E4A361C89116000C57C6A /* SPUStandardUserDriverDelegate.h */, 725CB9561C7120410064365A /* SPUUserDriver.h */, + 729E1D1A2664C1F800BF3EFB /* SPUUserUpdateChoice.h */, ); name = "User Driver"; sourceTree = ""; @@ -2408,6 +2412,7 @@ buildActionMask = 2147483647; files = ( 729E1D17266490FE00BF3EFB /* SPUAppcastItemSelection.h in Headers */, + 729E1D1C2664C34000BF3EFB /* SPUUserUpdateChoice.h in Headers */, 7269E495264798200088C213 /* SPUSkippedUpdate.h in Headers */, 72A5D5DE1D692ACC0009E5AC /* SparkleCore.h in Headers */, 72B3DECE1E23479000457642 /* SPUInformationalUpdate.h in Headers */, @@ -2439,6 +2444,7 @@ 72B767D61C9C8B5C00A07552 /* SPUBasicUpdateDriver.h in Headers */, 72B767E21C9CE90A00A07552 /* SPUCoreBasedUpdateDriver.h in Headers */, 72F9EC441D5E9ED8004AC8B6 /* SPUDownloadData.h in Headers */, + 729E1D1B2664C2C500BF3EFB /* SPUUserUpdateChoice.h in Headers */, 7229E1BD1C98EFF200CB50D0 /* SPUDownloadDriver.h in Headers */, 7267E5FD1D3DD1B700D1BF90 /* SPUResumableUpdate.h in Headers */, 7267E5B61D3D8AEE00D1BF90 /* SPUInstallationInfo.h in Headers */, diff --git a/Sparkle/SPUCoreBasedUpdateDriver.h b/Sparkle/SPUCoreBasedUpdateDriver.h index 3eec77d8..b52e4c95 100644 --- a/Sparkle/SPUCoreBasedUpdateDriver.h +++ b/Sparkle/SPUCoreBasedUpdateDriver.h @@ -9,6 +9,7 @@ #import #import "SPUUpdateState.h" #import "SPUUpdateDriver.h" +#import "SPUUserUpdateChoice.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Sparkle/SPUStandardUserDriver.m b/Sparkle/SPUStandardUserDriver.m index 66a04762..d0faf60d 100644 --- a/Sparkle/SPUStandardUserDriver.m +++ b/Sparkle/SPUStandardUserDriver.m @@ -17,6 +17,7 @@ #import "SULocalizations.h" #import "SUApplicationInfo.h" #import "SUOperatingSystem.h" +#import "SPUUpdateState.h" @interface SPUStandardUserDriver () diff --git a/Sparkle/SPUUpdateState.h b/Sparkle/SPUUpdateState.h index 034b6495..fd16f377 100644 --- a/Sparkle/SPUUpdateState.h +++ b/Sparkle/SPUUpdateState.h @@ -22,12 +22,6 @@ NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSInteger, SPUUserUpdateChoice) { - SPUUserUpdateChoiceSkip, - SPUUserUpdateChoiceInstall, - SPUUserUpdateChoiceDismiss, -}; - typedef NS_ENUM(NSInteger, SPUUpdateStage) { SPUUpdateStageNotDownloaded, SPUUpdateStageDownloaded, diff --git a/Sparkle/SPUUserDriver.h b/Sparkle/SPUUserDriver.h index f606a958..38b7f051 100644 --- a/Sparkle/SPUUserDriver.h +++ b/Sparkle/SPUUserDriver.h @@ -15,12 +15,12 @@ #import #endif -#import "SPUUpdateState.h" +#import "SPUUserUpdateChoice.h" #import "SUExport.h" NS_ASSUME_NONNULL_BEGIN -@class SPUUpdatePermissionRequest, SUUpdatePermissionResponse, SUAppcastItem, SPUDownloadData; +@class SPUUpdatePermissionRequest, SUUpdatePermissionResponse, SUAppcastItem, SPUDownloadData, SPUUpdateState; /*! The API in Sparkle for controlling the user interaction. diff --git a/Sparkle/SPUUserUpdateChoice.h b/Sparkle/SPUUserUpdateChoice.h new file mode 100644 index 00000000..194ff871 --- /dev/null +++ b/Sparkle/SPUUserUpdateChoice.h @@ -0,0 +1,18 @@ +// +// SPUUserUpdateChoice.h +// Sparkle +// +// Created by Mayur Pawashe on 5/31/21. +// Copyright © 2021 Sparkle Project. All rights reserved. +// + +#ifndef SPUUserUpdateChoice_h +#define SPUUserUpdateChoice_h + +typedef NS_ENUM(NSInteger, SPUUserUpdateChoice) { + SPUUserUpdateChoiceSkip, + SPUUserUpdateChoiceInstall, + SPUUserUpdateChoiceDismiss, +}; + +#endif /* SPUUserUpdateChoice_h */ diff --git a/Sparkle/SUUpdateAlert.h b/Sparkle/SUUpdateAlert.h index 6e610f4d..db2a5a3b 100644 --- a/Sparkle/SUUpdateAlert.h +++ b/Sparkle/SUUpdateAlert.h @@ -11,7 +11,7 @@ #import #import "SUVersionDisplayProtocol.h" -#import "SPUUpdateState.h" +#import "SPUUserUpdateChoice.h" @protocol SUUpdateAlertDelegate; diff --git a/Sparkle/Sparkle.h b/Sparkle/Sparkle.h index 8ec3e01e..bd72a9f5 100644 --- a/Sparkle/Sparkle.h +++ b/Sparkle/Sparkle.h @@ -30,6 +30,7 @@ #import "SPUUpdatePermissionRequest.h" #import "SUUpdatePermissionResponse.h" #import "SPUUserDriver.h" +#import "SPUUpdateState.h" #import "SPUStandardUserDriver.h" #import "SPUStandardUserDriverDelegate.h" #import "SPUDownloadData.h" diff --git a/Sparkle/SparkleCore.h b/Sparkle/SparkleCore.h index 118672aa..d151ca6f 100644 --- a/Sparkle/SparkleCore.h +++ b/Sparkle/SparkleCore.h @@ -29,6 +29,7 @@ #import "SPUUpdatePermissionRequest.h" #import "SUUpdatePermissionResponse.h" #import "SPUUserDriver.h" +#import "SPUUpdateState.h" #import "SPUDownloadData.h" #pragma clang diagnostic pop diff --git a/sparkle-cli/SPUCommandLineUserDriver.m b/sparkle-cli/SPUCommandLineUserDriver.m index cceb6c06..dd04d442 100644 --- a/sparkle-cli/SPUCommandLineUserDriver.m +++ b/sparkle-cli/SPUCommandLineUserDriver.m @@ -97,18 +97,18 @@ } } -- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem userInitiated:(BOOL)userInitiated state:(SPUUserUpdateState *)state reply:(void (^)(SPUUserUpdateChoice))reply +- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem state:(SPUUpdateState *)state reply:(void (^)(SPUUserUpdateChoice))reply { switch (state.stage) { - case SPUUserUpdateStageNotDownloaded: + case SPUUpdateStageNotDownloaded: [self showUpdateWithAppcastItem:appcastItem updateAdjective:@"new"]; reply(SPUUserUpdateChoiceInstall); break; - case SPUUserUpdateStageDownloaded: + case SPUUpdateStageDownloaded: [self showUpdateWithAppcastItem:appcastItem updateAdjective:@"downloaded"]; reply(SPUUserUpdateChoiceInstall); break; - case SPUUserUpdateStageInstalling: + case SPUUpdateStageInstalling: if (self.deferInstallation) { if (self.verbose) { fprintf(stderr, "Deferring Installation.\n"); @@ -118,7 +118,7 @@ reply(SPUUserUpdateChoiceInstall); } break; - case SPUUserUpdateStageInformational: + case SPUUpdateStageInformational: fprintf(stderr, "Found information for new update: %s\n", appcastItem.infoURL.absoluteString.UTF8String); reply(SPUUserUpdateChoiceDismiss); break;