Skip to content

Commit

Permalink
added buttons in settings panel to allow for manual update checking
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan 'Wolf' Rentzsch <[email protected]>
  • Loading branch information
Simone Manganelli authored and rentzsch committed Mar 10, 2009
1 parent 59edd69 commit 194f2dc
Show file tree
Hide file tree
Showing 4 changed files with 267 additions and 76 deletions.
3 changes: 3 additions & 0 deletions Plugin/CTFWhitelistWindowController.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#import <Cocoa/Cocoa.h>

extern NSString* kCTFCheckForUpdates;

@interface CTFWhitelistWindowController : NSWindowController {
IBOutlet NSArrayController *_controller;
}

- (IBAction)checkForUpdates:(id)sender;

@end

16 changes: 16 additions & 0 deletions Plugin/CTFWhitelistWindowController.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#import "CTFWhitelistWindowController.h"
#import <Sparkle/Sparkle.h>

NSString *kCTFCheckForUpdates = @"CTFCheckForUpdates";

@implementation CTFWhitelistWindowController

Expand All @@ -16,4 +19,17 @@ - (id)init
return self;
}

- (IBAction)checkForUpdates:(id)sender;
{
// this code is put here, because if it's code that's owned by the plugin object, then initiating
// an update will silently fail when no ClickToFlash view is loaded; putting it in the whitelist window
// object allows Sparkle to always check for updates

NSBundle *clickToFlashBundle = [NSBundle bundleWithIdentifier:@"com.github.rentzsch.clicktoflash"];
NSAssert(clickToFlashBundle, nil);
SUUpdater *updater = [SUUpdater updaterForBundle:clickToFlashBundle];
NSAssert(updater, nil);
[updater checkForUpdates:self];
}

@end
Loading

0 comments on commit 194f2dc

Please sign in to comment.