mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Sparkle now gies visual indication that it's checking for updates when hte update's user initiated. ie: it pops up a status controller saying "checking for updates..." What was SUUserInitiatedUpdateDriver is now SUUIBasedUpdateDriver; SUUserInitiatedUpdateDriver now is a subclass of that, along with SUScheduledUpdateDriver. This is a happy little refactoring that let me remove some redundant code.
45 lines
1.2 KiB
Objective-C
45 lines
1.2 KiB
Objective-C
//
|
|
// SUUserInitiatedUpdateDriver.m
|
|
// Sparkle
|
|
//
|
|
// Created by Andy Matuschak on 5/30/08.
|
|
// Copyright 2008 Andy Matuschak. All rights reserved.
|
|
//
|
|
|
|
#import "SUUserInitiatedUpdateDriver.h"
|
|
#import "Sparkle.h"
|
|
|
|
@implementation SUUserInitiatedUpdateDriver
|
|
|
|
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
|
|
{
|
|
[super checkForUpdatesAtURL:appcastURL hostBundle:hb];
|
|
checkingController = [[SUStatusController alloc] initWithHostBundle:hb];
|
|
[checkingController window]; // Force the checking controller to load its window.
|
|
[checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates...", nil) maxProgressValue:0 statusText:nil];
|
|
[checkingController setButtonHidden:YES];
|
|
[checkingController showWindow:self];
|
|
}
|
|
|
|
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
|
|
{
|
|
// We don't check to see if this update's been skipped, because the user explicitly *asked* if he had the latest version.
|
|
return [self hostSupportsItem:ui] && [self isItemNewer:ui];
|
|
}
|
|
|
|
- (void)didNotFindUpdate
|
|
{
|
|
[[checkingController window] close];
|
|
[checkingController release];
|
|
[super didNotFindUpdate];
|
|
}
|
|
|
|
- (void)didFindValidUpdate
|
|
{
|
|
[[checkingController window] close];
|
|
[checkingController release];
|
|
[super didFindValidUpdate];
|
|
}
|
|
|
|
@end
|