diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 83981b5d..ca58cbda 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -181,6 +181,7 @@ 725CB95B1C7121830064365A /* SUSparkleUserDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 725CB9591C7121830064365A /* SUSparkleUserDriver.m */; }; 7268AC631AD634C200C3E0C1 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */; }; 726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 726E4A0E1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E4A0D1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h */; }; 726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; 726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */; }; 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; @@ -642,6 +643,7 @@ 7268AC641AD634E400C3E0C1 /* SUBinaryDeltaCreate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaCreate.h; sourceTree = ""; }; 726B2B5D1C645FC900388755 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusCompletionResults.h; sourceTree = ""; }; + 726E4A0D1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUSparkleUserDriverUIDelegate.h; sourceTree = ""; }; 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUOperatingSystem.h; sourceTree = ""; }; 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUOperatingSystem.m; sourceTree = ""; }; 7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileManager.h; sourceTree = ""; }; @@ -998,6 +1000,7 @@ children = ( 7246E0A11C83B685003B4E75 /* SUUpdaterController.h */, 7246E0A21C83B685003B4E75 /* SUUpdaterController.m */, + 726E4A0D1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h */, 725CB9581C7121830064365A /* SUSparkleUserDriver.h */, 725CB9591C7121830064365A /* SUSparkleUserDriver.m */, 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */, @@ -1222,6 +1225,7 @@ 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */, 6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */, 61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */, + 726E4A0E1C86881600C57C6A /* SUSparkleUserDriverUIDelegate.h in Headers */, 61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */, 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */, ); diff --git a/Sparkle/SUSparkleUserDriver.h b/Sparkle/SUSparkleUserDriver.h index 5534c7c1..b2ec0853 100644 --- a/Sparkle/SUSparkleUserDriver.h +++ b/Sparkle/SUSparkleUserDriver.h @@ -11,9 +11,9 @@ NS_ASSUME_NONNULL_BEGIN -@protocol SUVersionDisplay; +@protocol SUSparkleUserDriverUIDelegate; -@protocol SUSparkleUserDriverDelegate +@protocol SUSparkleUserDriverDelegate @optional @@ -22,11 +22,6 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)responsibleForSignalingApplicationTerminationForUserDriver:(id )userDriver; -- (void)userUpdaterDriverWillShowModalAlert:(id )userDriver; -- (void)userUpdaterDriverDidShowModalAlert:(id )userDriver; - -- (_Nullable id )versionDisplayerForUserDriver:(id )userDriver; - @end @interface SUSparkleUserDriver : NSObject diff --git a/Sparkle/SUSparkleUserDriver.m b/Sparkle/SUSparkleUserDriver.m index 5042dba1..7a710769 100644 --- a/Sparkle/SUSparkleUserDriver.m +++ b/Sparkle/SUSparkleUserDriver.m @@ -7,6 +7,7 @@ // #import "SUSparkleUserDriver.h" +#import "SUSparkleUserDriverUIDelegate.h" #import "SUAppcastItem.h" #import "SUVersionDisplayProtocol.h" #import "SUHost.h" @@ -347,10 +348,10 @@ - (void)showAlert:(NSAlert *)alert { dispatch_async(dispatch_get_main_queue(), ^{ - id delegate = self.delegate; + id delegate = self.delegate; - if ([delegate respondsToSelector:@selector(userUpdaterDriverWillShowModalAlert:)]) { - [delegate userUpdaterDriverWillShowModalAlert:self]; + if ([delegate respondsToSelector:@selector(userDriverWillShowModalAlert:)]) { + [delegate userDriverWillShowModalAlert:self]; } // When showing a modal alert we need to ensure that background applications @@ -360,8 +361,8 @@ [alert setIcon:[SUApplicationInfo bestIconForBundle:self.host.bundle]]; [alert runModal]; - if ([delegate respondsToSelector:@selector(userUpdaterDriverDidShowModalAlert:)]) { - [delegate userUpdaterDriverDidShowModalAlert:self]; + if ([delegate respondsToSelector:@selector(userDriverDidShowModalAlert:)]) { + [delegate userDriverDidShowModalAlert:self]; } }); } diff --git a/Sparkle/SUSparkleUserDriverUIDelegate.h b/Sparkle/SUSparkleUserDriverUIDelegate.h new file mode 100644 index 00000000..9f48cd76 --- /dev/null +++ b/Sparkle/SUSparkleUserDriverUIDelegate.h @@ -0,0 +1,26 @@ +// +// SUSparkleUserDriverUIDelegate.h +// Sparkle +// +// Created by Mayur Pawashe on 3/1/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol SUUserDriver, SUVersionDisplay; + +@protocol SUSparkleUserDriverUIDelegate + +@optional + +- (void)userDriverWillShowModalAlert:(id )userDriver; +- (void)userDriverDidShowModalAlert:(id )userDriver; + +- (_Nullable id )versionDisplayerForUserDriver:(id )userDriver; + +@end + +NS_ASSUME_NONNULL_END