Skip to content

Commit d59b533

Browse files
committed
Revert "Removed Sparkle"
This reverts commit b54ee58.
1 parent bc9e7b5 commit d59b533

File tree

189 files changed

+7504
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+7504
-17
lines changed

Application/AppController.h

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@class PlaylistController;
88
@class PlaylistView;
99
@class PlaylistLoader;
10+
@class SUUpdater;
1011

1112
@interface AppController : NSObject {
1213
IBOutlet NSObjectController *currentEntryController;
@@ -47,6 +48,8 @@
4748

4849
IBOutlet FileTreeViewController *fileTreeViewController;
4950

51+
IBOutlet SUUpdater *updater;
52+
5053
NSOperationQueue *queue; // Since we are the app delegate, we take care of the op queue
5154

5255
NSMutableSet *expandedNodes;

Application/AppController.m

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#import "Shortcuts.h"
2929
#import <MASShortcut/Shortcut.h>
3030

31+
#import <Sparkle/Sparkle.h>
32+
3133
@import Firebase;
3234

3335
void *kAppControllerContext = &kAppControllerContext;
@@ -149,6 +151,11 @@ - (void)awakeFromNib {
149151
[FIRApp configure];
150152
[FIRAnalytics setAnalyticsCollectionEnabled:YES];
151153

154+
#ifdef DEBUG
155+
// Prevent updates automatically in debug builds
156+
[updater setAutomaticallyChecksForUpdates:NO];
157+
#endif
158+
152159
[[totalTimeField cell] setBackgroundStyle:NSBackgroundStyleRaised];
153160

154161
[self.infoButton setToolTip:NSLocalizedString(@"InfoButtonTooltip", @"")];

Base.lproj/MainMenu.xib

+24-17
Large diffs are not rendered by default.

Cog.xcodeproj/project.pbxproj

+6
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@
175175
8384916C18083EAB00E7332D /* stopTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 8384915618083EAB00E7332D /* stopTemplate.pdf */; };
176176
8384916D18083EAB00E7332D /* volume1Template.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 8384915718083EAB00E7332D /* volume1Template.pdf */; };
177177
8384916E18083EAB00E7332D /* volume3Template.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 8384915818083EAB00E7332D /* volume3Template.pdf */; };
178+
838F851E256B4E5E00C3E614 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 838F851D256B4E5E00C3E614 /* Sparkle.framework */; };
179+
838F851F256B4E8B00C3E614 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 838F851D256B4E5E00C3E614 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
178180
83978E16285C58190076ED21 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 83978E15285C58190076ED21 /* FirebaseCrashlytics */; };
179181
83978E26285C596F0076ED21 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 83978E25285C596F0076ED21 /* FirebaseAnalytics */; };
180182
83978E29285C5C0A0076ED21 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 83978E28285C5C0A0076ED21 /* GoogleService-Info.plist */; };
@@ -748,6 +750,7 @@
748750
83B72E3B279045B7006007A3 /* libfdk-aac.2.dylib in CopyFiles */,
749751
8305963C277F013200EBFAAE /* File_Extractor.framework in CopyFiles */,
750752
ED69CBCA25BE32E80090B90D /* MASShortcut.framework in CopyFiles */,
753+
838F851F256B4E8B00C3E614 /* Sparkle.framework in CopyFiles */,
751754
17F561400C3BD4F30019975C /* CogAudio.framework in CopyFiles */,
752755
);
753756
runOnlyForDeploymentPostprocessing = 0;
@@ -1021,6 +1024,7 @@
10211024
8384915818083EAB00E7332D /* volume3Template.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = volume3Template.pdf; path = Images/volume3Template.pdf; sourceTree = "<group>"; };
10221025
83859520234FEB35004E9946 /* Cog.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Cog.entitlements; sourceTree = "<group>"; };
10231026
838F84FF25687C5C00C3E614 /* Cog-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Cog-Bridging-Header.h"; sourceTree = "<group>"; };
1027+
838F851D256B4E5E00C3E614 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ThirdParty/Frameworks/Sparkle.framework; sourceTree = "<group>"; };
10241028
83978E28285C5C0A0076ED21 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
10251029
83988F0C27BE0A5900A0E89A /* RedundantPlaylistDataStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RedundantPlaylistDataStore.h; sourceTree = "<group>"; };
10261030
83988F0D27BE0A5900A0E89A /* RedundantPlaylistDataStore.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RedundantPlaylistDataStore.m; sourceTree = "<group>"; };
@@ -1105,6 +1109,7 @@
11051109
83978E26285C596F0076ED21 /* FirebaseAnalytics in Frameworks */,
11061110
17BB5CF90B8A86350009ACB1 /* AudioUnit.framework in Frameworks */,
11071111
17BB5CFA0B8A86350009ACB1 /* CoreAudio.framework in Frameworks */,
1112+
838F851E256B4E5E00C3E614 /* Sparkle.framework in Frameworks */,
11081113
17BB5CFB0B8A86350009ACB1 /* CoreAudioKit.framework in Frameworks */,
11091114
83978E16285C58190076ED21 /* FirebaseCrashlytics in Frameworks */,
11101115
17BB5EA60B8A87850009ACB1 /* IOKit.framework in Frameworks */,
@@ -1148,6 +1153,7 @@
11481153
isa = PBXGroup;
11491154
children = (
11501155
ED69CBB825BE328C0090B90D /* MASShortcut.xcodeproj */,
1156+
838F851D256B4E5E00C3E614 /* Sparkle.framework */,
11511157
17F5612A0C3BD4DC0019975C /* CogAudio.xcodeproj */,
11521158
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
11531159
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Autoupdate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Headers
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Modules
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/PrivateHeaders
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Resources
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Sparkle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Updater.app
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//
2+
// SPUDownloadData.h
3+
// Sparkle
4+
//
5+
// Created by Mayur Pawashe on 8/10/16.
6+
// Copyright © 2016 Sparkle Project. All rights reserved.
7+
//
8+
9+
#if __has_feature(modules)
10+
#if __has_warning("-Watimport-in-framework-header")
11+
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
12+
#endif
13+
@import Foundation;
14+
#else
15+
#import <Foundation/Foundation.h>
16+
#endif
17+
18+
#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
19+
// Ignore incorrect warning
20+
#pragma clang diagnostic push
21+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
22+
#import "SUExport.h"
23+
#pragma clang diagnostic pop
24+
#else
25+
#import <Sparkle/SUExport.h>
26+
#endif
27+
28+
NS_ASSUME_NONNULL_BEGIN
29+
30+
/**
31+
* A class for containing downloaded data along with some information about it.
32+
*/
33+
SU_EXPORT @interface SPUDownloadData : NSObject <NSSecureCoding>
34+
35+
/**
36+
* The raw data that was downloaded.
37+
*/
38+
@property (nonatomic, readonly) NSData *data;
39+
40+
/**
41+
* The URL that was fetched from.
42+
*
43+
* This may be different from the URL in the request if there were redirects involved.
44+
*/
45+
@property (nonatomic, readonly, copy) NSURL *URL;
46+
47+
/**
48+
* The IANA charset encoding name if available. Eg: "utf-8"
49+
*/
50+
@property (nonatomic, readonly, nullable, copy) NSString *textEncodingName;
51+
52+
/**
53+
* The MIME type if available. Eg: "text/plain"
54+
*/
55+
@property (nonatomic, readonly, nullable, copy) NSString *MIMEType;
56+
57+
@end
58+
59+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
//
2+
// SPUStandardUpdaterController.h
3+
// Sparkle
4+
//
5+
// Created by Mayur Pawashe on 2/28/16.
6+
// Copyright © 2016 Sparkle Project. All rights reserved.
7+
//
8+
9+
#if __has_feature(modules)
10+
#if __has_warning("-Watimport-in-framework-header")
11+
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
12+
#endif
13+
@import Foundation;
14+
#else
15+
#import <Foundation/Foundation.h>
16+
#endif
17+
#import <Sparkle/SUExport.h>
18+
19+
NS_ASSUME_NONNULL_BEGIN
20+
21+
@class SPUUpdater;
22+
@class SPUStandardUserDriver;
23+
@class NSMenuItem;
24+
@protocol SPUUserDriver, SPUUpdaterDelegate, SPUStandardUserDriverDelegate;
25+
26+
/**
27+
A controller class that instantiates a `SPUUpdater` and allows binding UI to its updater settings.
28+
29+
This class can be instantiated in a nib or created programatically using `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:`.
30+
31+
The controller's updater targets the application's main bundle and uses Sparkle's standard user interface.
32+
Typically, this class is used by sticking it as a custom NSObject subclass in an Interface Builder nib (probably in MainMenu) but it works well programatically too.
33+
34+
The controller creates an `SPUUpdater` instance using a `SPUStandardUserDriver` and allows hooking up the check for updates action and handling menu item validation.
35+
It also allows hooking up the updater's and user driver's delegates.
36+
37+
If you need more control over what bundle you want to update, or you want to provide a custom user interface (via `SPUUserDriver`), please use `SPUUpdater` directly instead.
38+
*/
39+
SU_EXPORT @interface SPUStandardUpdaterController : NSObject
40+
{
41+
/**
42+
* Interface builder outlet for the updater's delegate.
43+
*/
44+
IBOutlet __weak id<SPUUpdaterDelegate> updaterDelegate;
45+
46+
/**
47+
* Interface builder outlet for the user driver's delegate.
48+
*/
49+
IBOutlet __weak id<SPUStandardUserDriverDelegate> userDriverDelegate;
50+
}
51+
52+
/**
53+
Accessible property for the updater. Some properties on the updater can be binded via KVO
54+
55+
When instantiated from a nib, don't perform update checks before the application has finished launching in a MainMenu nib (i.e applicationDidFinishLaunching:) or before the corresponding window/view controller has been loaded (i.e, windowDidLoad or viewDidLoad). The updater is not guaranteed to be started yet before these points.
56+
*/
57+
@property (nonatomic, readonly) SPUUpdater *updater;
58+
59+
/**
60+
Accessible property for the updater's user driver.
61+
*/
62+
@property (nonatomic, readonly) SPUStandardUserDriver *userDriver;
63+
64+
/**
65+
Create a new `SPUStandardUpdaterController` from a nib.
66+
67+
You cannot call this initializer directly. You must instantiate a `SPUStandardUpdaterController` inside of a nib (typically the MainMenu nib) to use it.
68+
69+
To create a `SPUStandardUpdaterController` programatically, use `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:` instead.
70+
*/
71+
- (instancetype)init NS_UNAVAILABLE;
72+
73+
/**
74+
Create a new `SPUStandardUpdaterController` programmatically.
75+
76+
The updater is started automatically. See `-startUpdater` for more information.
77+
*/
78+
- (instancetype)initWithUpdaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
79+
80+
/**
81+
Create a new `SPUStandardUpdaterController` programmatically allowing you to specify whether or not to start the updater immediately.
82+
83+
You can specify whether or not you want to start the updater immediately.
84+
If you do not start the updater, you must invoke `-startUpdater` at a later time to start it.
85+
*/
86+
- (instancetype)initWithStartingUpdater:(BOOL)startUpdater updaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
87+
88+
/**
89+
Starts the updater if it has not already been started.
90+
91+
You should only call this method yourself if you opted out of starting the updater on initialization.
92+
Hence, do not call this yourself if you are instantiating this controller from a nib.
93+
94+
This invokes `-[SPUUpdater startUpdater:]`. If the application is misconfigured with Sparkle, an error is logged and an alert is shown to the user (after a few seconds) to contact the developer.
95+
If you want more control over this behavior, you can create your own `SPUUpdater` instead of using `SPUStandardUpdaterController`.
96+
*/
97+
- (void)startUpdater;
98+
99+
/**
100+
Explicitly checks for updates and displays a progress dialog while doing so.
101+
102+
This method is meant for a main menu item.
103+
Connect any NSMenuItem to this action in Interface Builder or programmatically,
104+
and Sparkle will check for updates and report back its findings verbosely when it is invoked.
105+
106+
When the target/action of the menu item is set to this controller and this method,
107+
this controller also handles enabling/disabling the menu item by checking
108+
`-[SPUUpdater canCheckForUpdates]`
109+
110+
This action checks updates by invoking `-[SPUUpdater checkForUpdates]`
111+
*/
112+
- (IBAction)checkForUpdates:(nullable id)sender;
113+
114+
@end
115+
116+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// SPUStandardUserDriver.h
3+
// Sparkle
4+
//
5+
// Created by Mayur Pawashe on 2/14/16.
6+
// Copyright © 2016 Sparkle Project. All rights reserved.
7+
//
8+
9+
#if __has_feature(modules)
10+
#if __has_warning("-Watimport-in-framework-header")
11+
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
12+
#endif
13+
@import Foundation;
14+
#else
15+
#import <Foundation/Foundation.h>
16+
#endif
17+
#import <Sparkle/SPUUserDriver.h>
18+
#import <Sparkle/SUExport.h>
19+
20+
NS_ASSUME_NONNULL_BEGIN
21+
22+
@protocol SPUStandardUserDriverDelegate;
23+
24+
/**
25+
Sparkle's standard built-in user driver for updater interactions
26+
*/
27+
SU_EXPORT @interface SPUStandardUserDriver : NSObject <SPUUserDriver>
28+
29+
/**
30+
Initializes a Sparkle's standard user driver for user update interactions
31+
32+
@param hostBundle The target bundle of the host that is being updated.
33+
@param delegate The optional delegate to this user driver.
34+
*/
35+
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(nullable id<SPUStandardUserDriverDelegate>)delegate;
36+
37+
/**
38+
Use initWithHostBundle:delegate: instead.
39+
*/
40+
- (instancetype)init NS_UNAVAILABLE;
41+
42+
@end
43+
44+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// SPUStandardUserDriverDelegate.h
3+
// Sparkle
4+
//
5+
// Created by Mayur Pawashe on 3/3/16.
6+
// Copyright © 2016 Sparkle Project. All rights reserved.
7+
//
8+
9+
#if __has_feature(modules)
10+
#if __has_warning("-Watimport-in-framework-header")
11+
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
12+
#endif
13+
@import Foundation;
14+
#else
15+
#import <Foundation/Foundation.h>
16+
#endif
17+
#import <Sparkle/SUExport.h>
18+
19+
@protocol SUVersionDisplay;
20+
21+
/**
22+
A protocol for Sparkle's standard user driver's delegate
23+
24+
This includes methods related to UI interactions
25+
*/
26+
SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
27+
28+
@optional
29+
30+
/**
31+
Called before showing a modal alert window,
32+
to give the opportunity to hide attached windows that may get in the way.
33+
*/
34+
- (void)standardUserDriverWillShowModalAlert;
35+
36+
/**
37+
Called after showing a modal alert window,
38+
to give the opportunity to hide attached windows that may get in the way.
39+
*/
40+
- (void)standardUserDriverDidShowModalAlert;
41+
42+
/**
43+
Returns an object that formats version numbers for display to the user.
44+
If you don't implement this method or return @c nil, the standard version formatter will be used.
45+
*/
46+
- (_Nullable id <SUVersionDisplay>)standardUserDriverRequestsVersionDisplayer;
47+
48+
/**
49+
Handles showing the full release notes to the user.
50+
51+
When a user checks for new updates and no new update is found, Sparkle will offer to show the application's version history to the user
52+
by providing a "Version History" button in the no new update available alert.
53+
54+
If this delegate method is not implemented, Sparkle will instead offer to open the
55+
`fullReleaseNotesLink` (or `releaseNotesLink` if the former is unavailable) from the appcast's latest `item` in the user's web browser.
56+
57+
If this delegate method is implemented, Sparkle will instead ask the delegate to show the full release notes to the user.
58+
A delegate may want to implement this method if they want to show in-app or offline release notes.
59+
60+
@param item The appcast item corresponding to the latest version available.
61+
*/
62+
- (void)standardUserDriverShowVersionHistoryForAppcastItem:(SUAppcastItem *_Nonnull)item;
63+
64+
@end

0 commit comments

Comments
 (0)