Skip to content

Commit

Permalink
Merge pull request #5 from PhorionTech/sparkle-fixe
Browse files Browse the repository at this point in the history
Fixes Sparkle to prompt for updates in the bg
  • Loading branch information
rookuu authored Nov 20, 2023
2 parents 4a68138 + f2fe09d commit 825c381
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TCCKronos/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@class XPCConnection;

@interface AppDelegate : NSObject <NSApplicationDelegate>
@interface AppDelegate : NSObject <NSApplicationDelegate, SPUUpdaterDelegate, SPUStandardUserDriverDelegate>

@property(strong) IBOutlet NSMenu *statusMenu;

Expand Down
23 changes: 23 additions & 0 deletions TCCKronos/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,27 @@ -(void)setActivationPolicy
return;
}

- (BOOL)supportsGentleScheduledUpdateReminders {
return YES;
}

- (void)standardUserDriverWillHandleShowingUpdate:(BOOL)handleShowingUpdate forUpdate:(SUAppcastItem *)update state:(SPUUserUpdateState *)state {
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];

if (!state.userInitiated) {
// Set a badge number on the app's Dock tile
[NSApp.dockTile setBadgeLabel:@"1"];
}
}

- (void)standardUserDriverDidReceiveUserAttentionForUpdate:(SUAppcastItem *)update {
[NSApp.dockTile setBadgeLabel:@""];
}

- (void)standardUserDriverWillFinishUpdateSession {
[self setActivationPolicy];
}



@end
7 changes: 6 additions & 1 deletion TCCKronos/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@
<action selector="terminate:" target="-1" id="1tv-Lk-5xt"/>
</connections>
</menuItem>
<customObject id="d87-kQ-5He" customClass="SPUStandardUpdaterController"/>
<customObject id="d87-kQ-5He" customClass="SPUStandardUpdaterController">
<connections>
<outlet property="updaterDelegate" destination="Voe-Tx-rLC" id="Y0t-Pk-wEC"/>
<outlet property="userDriverDelegate" destination="Voe-Tx-rLC" id="4Yj-jT-dDE"/>
</connections>
</customObject>
</objects>
<resources>
<image name="phorion-status-item" width="18" height="18"/>
Expand Down

0 comments on commit 825c381

Please sign in to comment.