Skip to content

Commit 194f2dc

Browse files
Simone Manganellirentzsch
Simone Manganelli
authored andcommitted
added buttons in settings panel to allow for manual update checking
Signed-off-by: Jonathan 'Wolf' Rentzsch <[email protected]>
1 parent 59edd69 commit 194f2dc

File tree

4 files changed

+267
-76
lines changed

4 files changed

+267
-76
lines changed

Plugin/CTFWhitelistWindowController.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#import <Cocoa/Cocoa.h>
22

3+
extern NSString* kCTFCheckForUpdates;
34

45
@interface CTFWhitelistWindowController : NSWindowController {
56
IBOutlet NSArrayController *_controller;
67
}
78

9+
- (IBAction)checkForUpdates:(id)sender;
10+
811
@end
912

Plugin/CTFWhitelistWindowController.m

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#import "CTFWhitelistWindowController.h"
2+
#import <Sparkle/Sparkle.h>
3+
4+
NSString *kCTFCheckForUpdates = @"CTFCheckForUpdates";
25

36
@implementation CTFWhitelistWindowController
47

@@ -16,4 +19,17 @@ - (id)init
1619
return self;
1720
}
1821

22+
- (IBAction)checkForUpdates:(id)sender;
23+
{
24+
// this code is put here, because if it's code that's owned by the plugin object, then initiating
25+
// an update will silently fail when no ClickToFlash view is loaded; putting it in the whitelist window
26+
// object allows Sparkle to always check for updates
27+
28+
NSBundle *clickToFlashBundle = [NSBundle bundleWithIdentifier:@"com.github.rentzsch.clicktoflash"];
29+
NSAssert(clickToFlashBundle, nil);
30+
SUUpdater *updater = [SUUpdater updaterForBundle:clickToFlashBundle];
31+
NSAssert(updater, nil);
32+
[updater checkForUpdates:self];
33+
}
34+
1935
@end

0 commit comments

Comments
 (0)