merged with trunk

This commit is contained in:
Dominik committed 2008-06-30 08:23:22 +02:00
commit 9afa5febc2
61 files changed
+387 -101

No files matched your search

+1 -1
View File
@@ -5,4 +5,4 @@ DEBUG_INFORMATION_FORMAT = dwarf
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
SPARKLE_EXTRA_DEBUG = -DDEBUG -fstack-protector -D_FORTIFY_SOURCE=2
OTHER_CFLAGS = $(SPARKLE_EXTRA_DEBUG)
ARCHS = $(NATIVE_ARCH_32_BIT)
ARCHS = $(NATIVE_ARCH_ACTUAL)
+1 -1
View File
@@ -6,4 +6,4 @@ GCC_GENERATE_DEBUGGING_SYMBOLS = NO
DEAD_CODE_STRIPPING = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES
ARCHS = ppc ppc64 i386 x86_64
ARCHS = ppc i386 x86_64
+1 -1
View File
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en_US</string>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
+1 -1
View File
@@ -11,7 +11,7 @@
#import <Cocoa/Cocoa.h>
@interface NSFileManager (Aliases)
@interface NSFileManager (SUAliases)
- (BOOL)isAliasFolderAtPath:(NSString *)path;
@end
+1 -1
View File
@@ -9,7 +9,7 @@
#import "NSFileManager+Aliases.h"
@implementation NSFileManager (Aliases)
@implementation NSFileManager (SUAliases)
- (BOOL)isAliasFolderAtPath:(NSString *)path
{
+1 -1
View File
@@ -11,7 +11,7 @@
#import <Cocoa/Cocoa.h>
@interface NSFileManager (ExtendedAttributes)
@interface NSFileManager (MMExtendedAttributes)
// Wraps the removexattr system call, allowing an AppKit-style NSString* to
// be used for the pathname argument. Note that the order of the arguments
+1 -1
View File
@@ -20,7 +20,7 @@
#define XATTR_NOFOLLOW 1
#endif // SDK >= 10.4
@implementation NSFileManager (ExtendedAttributes)
@implementation NSFileManager (MMExtendedAttributes)
- (int)removeXAttr:(const char*)name
fromFile:(NSString*)file
+1 -1
View File
@@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
@interface NSNumber (Units)
@interface NSNumber (JWUnits)
+ (NSString *)humanReadableSizeFromDouble:(double)value;
+1 -1
View File
@@ -9,7 +9,7 @@
#import "NSNumber+Units.h"
#import "Sparkle.h"
@implementation NSNumber (Units)
@implementation NSNumber (JWUnits)
+ (NSString *)humanReadableSizeFromDouble:(double)value
{
+1 -1
View File
@@ -48,7 +48,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA
#import <CoreFoundation/CoreFoundation.h>
#import "SUConstants.h" // for NSInteger
@interface NSString (extras)
@interface NSString (BSextras)
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set;
+1 -1
View File
@@ -44,7 +44,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA
#import "NSString+extras.h"
@implementation NSString (extras)
@implementation NSString (BSextras)
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set
{
+1 -1
View File
@@ -11,7 +11,7 @@
#import <Cocoa/Cocoa.h>
@interface NSWorkspace (SystemVersion)
@interface NSWorkspace (SUSystemVersion)
+ (NSString *)systemVersionString;
@end
+1 -1
View File
@@ -9,7 +9,7 @@
#import "NSWorkspace+SystemVersion.h"
@implementation NSWorkspace (SystemVersion)
@implementation NSWorkspace (SUSystemVersion)
+ (NSString *)systemVersionString
{
// This returns a version string of the form X.Y.Z
+2
View File
@@ -47,7 +47,9 @@
- (void)installUpdate;
- (void)installerFinishedForHostBundle:(NSBundle *)hb;
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error;
- (void)relaunchHostApp;
- (void)cleanUp;
- (void)abortUpdate;
- (void)abortUpdateWithError:(NSError *)error;
+27 -21
View File
@@ -26,7 +26,7 @@
[appcast release];
[appcast setDelegate:self];
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b1", [hostBundle name], [hostBundle displayVersion]]];
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b2", [hostBundle name], [hostBundle displayVersion]]];
[appcast fetchAppcastFromURL:appcastURL];
}
@@ -58,17 +58,17 @@
- (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
[delegate appcastDidFinishLoading:ac];
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:forHostBundle:)])
[delegate appcastDidFinishLoading:ac forHostBundle:hostBundle];
NSArray* updates = [ac items];
if ([updates count] > 0)
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
// Now we have to find the best valid update in the appcast.
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:)]) // Does the delegate want to handle it?
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:forHostBundle:)]) // Does the delegate want to handle it?
{
updateItem = [delegate bestValidUpdateInAppcast:ac];
updateItem = [delegate bestValidUpdateInAppcast:ac forHostBundle:hostBundle];
}
else // If not, we'll take care of it ourselves.
{
@@ -97,13 +97,15 @@
- (void)didFindValidUpdate
{
if ([delegate respondsToSelector:@selector(didFindValidUpdate:)])
[delegate didFindValidUpdate:updateItem];
if ([delegate respondsToSelector:@selector(didFindValidUpdate:toHostBundle:)])
[delegate didFindValidUpdate:updateItem toHostBundle:hostBundle];
[self downloadUpdate];
}
- (void)didNotFindUpdate
{
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
[delegate didNotFindUpdateToHostBundle:hostBundle];
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
}
@@ -190,8 +192,8 @@
- (void)installUpdate
{
if ([delegate respondsToSelector:@selector(updateWillInstall:)])
[delegate updateWillInstall:updateItem];
if ([delegate respondsToSelector:@selector(updateWillInstall:toHostBundle:)])
[delegate updateWillInstall:updateItem toHostBundle:hostBundle];
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
NSString *relaunchPathToCopy = [[NSBundle bundleForClass:[self class]] pathForResource:@"relaunch" ofType:@""];
NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
@@ -213,36 +215,40 @@
{
// Give the host app an opportunity to postpone the relaunch.
static BOOL postponedOnce = NO;
if (!postponedOnce && [delegate respondsToSelector:@selector(shouldPostponeRelaunchForUpdate:untilInvoking:)])
if (!postponedOnce && [delegate respondsToSelector:@selector(shouldPostponeRelaunchForUpdate:toHostBundle:untilInvoking:)])
{
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[[self class] instanceMethodSignatureForSelector:@selector(relaunchHostApp)] retain]];
[invocation setSelector:@selector(relaunchHostApp)];
[invocation setTarget:self];
postponedOnce = YES;
if ([delegate shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
if ([delegate shouldPostponeRelaunchForUpdate:updateItem toHostBundle:hostBundle untilInvoking:invocation])
return;
}
[self cleanUp]; // Clean up the download and extracted files.
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self];
if ([delegate respondsToSelector:@selector(updaterWillRelaunchApplication)])
[delegate updaterWillRelaunchApplication];
@try
{
if(!relaunchPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath])
[NSException raise:@"SURelauncherNotFound" format:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath];
[NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:[hostBundle bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
}
@catch (NSException *e)
if(!relaunchPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath])
{
// Note that we explicitly use the host app's name here, since updating plugin for Mail relaunches Mail, not just the plugin.
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.", nil), [[NSBundle mainBundle] name]], NSLocalizedDescriptionKey, [e reason], NSLocalizedFailureReasonErrorKey, nil]]];
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.", nil), [[NSBundle mainBundle] name]], NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath], NSLocalizedFailureReasonErrorKey, nil]]];
// We intentionally don't abandon the update here so that the host won't initiate another.
}
return;
}
[NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:[hostBundle bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
[NSApp terminate:self];
}
- (void)cleanUp
{
[[NSFileManager defaultManager] removeFileAtPath:[downloadPath stringByDeletingLastPathComponent] handler:nil];
}
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error
{
if (hb != hostBundle) { return; }
-5
View File
@@ -16,9 +16,4 @@
@interface SUProbingUpdateDriver : SUBasicUpdateDriver { }
@end
@interface NSObject (SUProbeDriverDelegateProtocol)
- (void)didFindValidUpdate:(SUAppcastItem *)item toHostBundle:(NSBundle *)hb;
- (void)didNotFindUpdateToHostBundle:(NSBundle *)hb;
@end
#endif
+2 -4
View File
@@ -11,17 +11,15 @@
@implementation SUProbingUpdateDriver
// Stop as soon as we have an answer! The superclasses will already have taken care of notifying the delegate.
- (void)didFindValidUpdate
{
if ([delegate respondsToSelector:@selector(didFindValidUpdate:toHostBundle:)])
[delegate didFindValidUpdate:updateItem toHostBundle:hostBundle];
[self abortUpdate];
}
- (void)didNotFindUpdate
{
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
[delegate didNotFindUpdateToHostBundle:hostBundle];
[self abortUpdate];
}
-1
View File
@@ -28,7 +28,6 @@
// If isDefault is YES, the button's key equivalent will be \r.
- (void)setButtonTitle:(NSString *)buttonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault;
- (void)setButtonEnabled:(BOOL)enabled;
- (void)setButtonHidden:(BOOL)hidden;
- (double)progressValue;
- (void)setProgressValue:(double)value;
-6
View File
@@ -87,12 +87,6 @@
[actionButton setEnabled:enabled];
}
- (void)setButtonHidden:(BOOL)hidden
{
[actionButton setHidden:hidden];
[[actionButton superview] display];
}
- (double)progressValue
{
return progressValue;
+4 -2
View File
@@ -29,6 +29,8 @@
- (void)didNotFindUpdate
{
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
[delegate didNotFindUpdateToHostBundle:hostBundle];
NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"You're up to date!", nil) defaultButton:SULocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [hostBundle name], [hostBundle displayVersion]];
[alert setIcon:[hostBundle icon]];
[alert runModal];
@@ -44,8 +46,8 @@
- (void)updateAlert:(SUUpdateAlert *)alert finishedWithChoice:(SUUpdateAlertChoice)choice
{
[updateAlert release]; updateAlert = nil;
if ([delegate respondsToSelector:@selector(userChoseAction:forUpdate:)])
[delegate userChoseAction:choice forUpdate:updateItem];
if ([delegate respondsToSelector:@selector(userChoseAction:forUpdate:toHostBundle:)])
[delegate userChoseAction:choice forUpdate:updateItem toHostBundle:hostBundle];
[[SUUserDefaults standardUserDefaults] setObject:nil forKey:SUSkippedVersionKey];
switch (choice)
{
+23 -11
View File
@@ -9,18 +9,19 @@
#ifndef SUUPDATER_H
#define SUUPDATER_H
@class SUUpdateDriver;
#import "SUUpdateAlert.h"
@class SUUpdateDriver, SUAppcastItem, SUAppcast;
@interface SUUpdater : NSObject {
NSTimer *checkTimer;
SUUpdateDriver *driver;
NSBundle *hostBundle;
id delegate;
IBOutlet id delegate;
}
+ (SUUpdater *)sharedUpdater;
- (void)setHostBundle:(NSBundle *)hostBundle;
- (void)setDelegate:(id)delegate;
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
@@ -30,6 +31,14 @@
// This forces an update to begin with a particular driver (see SU*UpdateDriver.h)
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)driver;
// For non-.app updates:
// Call this when your bundle is loaded to tell Sparkle what to update.
- (void)setHostBundle:(NSBundle *)hostBundle;
// Call this to appropriately reschedule or cancel the update checking timer if preferences for time interval or automatic checks change.
// If you're using a .app, this'll be picked up automatically via NSUserDefaultsController, but for non-.apps, there's no way to observe changes.
- (void)updatePreferencesChanged;
- (BOOL)updateInProgress;
@end
@@ -37,29 +46,32 @@
@interface NSObject (SUUpdaterDelegateInformalProtocol)
// This method allows you to add extra parameters to the appcast URL, potentially based on whether or not
// Sparkle will also be sending along the system profile. This method should return an array of dictionaries with the following keys:
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
- (NSArray *)feedParametersForHostBundle:(NSBundle *)bundle sendingSystemProfile:(BOOL)sendingProfile;
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
- (BOOL)shouldPromptForPermissionToCheckForUpdates;
- (BOOL)shouldPromptForPermissionToCheckForUpdatesToHostBundle:(NSBundle *)bundle;
// Implement this if you want to do some special handling with the appcast once it finishes loading.
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;
- (void)appcastDidFinishLoading:(SUAppcast *)appcast forHostBundle:(NSBundle *)bundle;
// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
// a valid update, if any, in the given appcast.
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast;
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forHostBundle:(NSBundle *)bundle;
// Sent when a valid update is found by the update driver.
- (void)didFindValidUpdate:(SUAppcastItem *)update;
- (void)didFindValidUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
// Sent when a valid update is not found.
- (void)didNotFindUpdateToHostBundle:(NSBundle *)hb;
// Sent when the user makes a choice in the update alert dialog (install now / remind me later / skip this version).
- (void)userChoseAction:(SUUpdateAlertChoice)action forUpdate:(SUAppcastItem *)update;
- (void)userChoseAction:(SUUpdateAlertChoice)action forUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
// Sent immediately before installing the specified update.
- (void)updateWillInstall:(SUAppcastItem *)update;
- (void)updateWillInstall:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)hostBundle untilInvoking:(NSInvocation *)invocation;
// Called immediately before relaunching.
- (void)updaterWillRelaunchApplication;
+41 -18
View File
@@ -10,10 +10,10 @@
#import "SUUpdater.h"
@interface SUUpdater (Private)
- (void)beginUpdateCycle;
- (NSArray *)feedParameters;
- (BOOL)automaticallyUpdates;
- (BOOL)shouldScheduleUpdateCheck;
- (void)scheduleNextUpdateCheck;
- (NSTimeInterval)checkInterval;
@end
@@ -45,6 +45,8 @@ static SUUpdater *sharedUpdater = nil;
sharedUpdater = self;
[self setHostBundle:[NSBundle mainBundle]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidFinishLaunching:) name:NSApplicationDidFinishLaunchingNotification object:NSApp];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUScheduledCheckIntervalKey] options:0 context:NULL];
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey] options:0 context:NULL];
}
return self;
}
@@ -56,9 +58,9 @@ static SUUpdater *sharedUpdater = nil;
[[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKey] == NO) { return; }
// Does the delegate want to take care of the logic for when we should ask permission to update?
if ([delegate respondsToSelector:@selector(shouldPromptForPermissionToCheckForUpdates)])
if ([delegate respondsToSelector:@selector(shouldPromptForPermissionToCheckForUpdatesToHostBundle)])
{
if ([delegate shouldPromptForPermissionToCheckForUpdates])
if ([delegate shouldPromptForPermissionToCheckForUpdatesToHostBundle:hostBundle])
[SUUpdatePermissionPrompt promptWithHostBundle:hostBundle delegate:self];
}
// Has he been asked already? And don't ask if the host has a default value set in its Info.plist.
@@ -76,20 +78,28 @@ static SUUpdater *sharedUpdater = nil;
}
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
if ([self shouldScheduleUpdateCheck])
[self beginUpdateCycle];
[self scheduleNextUpdateCheck];
}
- (void)updatePermissionPromptFinishedWithResult:(SUPermissionPromptResult)result
{
BOOL automaticallyCheck = (result == SUAutomaticallyCheck);
[[SUUserDefaults standardUserDefaults] setBool:automaticallyCheck forKey:SUEnableAutomaticChecksKey];
if ([self automaticallyUpdates])
[self beginUpdateCycle];
[self scheduleNextUpdateCheck];
}
- (void)beginUpdateCycle
- (void)scheduleNextUpdateCheck
{
@synchronized (checkTimer)
{
if (checkTimer)
{
[checkTimer invalidate];
checkTimer = nil;
}
}
if (![self shouldScheduleUpdateCheck]) return;
// How long has it been since last we checked for an update?
NSDate *lastCheckDate = [[SUUserDefaults standardUserDefaults] objectForKey:SULastCheckTimeKey];
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
@@ -101,7 +111,6 @@ static SUUpdater *sharedUpdater = nil;
delayUntilCheck = ([self checkInterval] - intervalSinceCheck); // It hasn't been long enough.
else
delayUntilCheck = 0; // We're overdue! Run one now.
checkTimer = [NSTimer scheduledTimerWithTimeInterval:delayUntilCheck target:self selector:@selector(checkForUpdatesInBackground) userInfo:nil repeats:NO];
}
@@ -118,7 +127,7 @@ static SUUpdater *sharedUpdater = nil;
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d
{
if ([self updateInProgress]) { return; }
if (checkTimer) { [checkTimer invalidate]; checkTimer = nil; }
@synchronized (checkTimer) { if (checkTimer) { [checkTimer invalidate]; checkTimer = nil; } }
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
NSString *appcastString = [[SUUserDefaults standardUserDefaults] objectForKey:SUFeedURLKey];
@@ -137,11 +146,25 @@ static SUUpdater *sharedUpdater = nil;
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if (object != driver) { return; }
[driver removeObserver:self forKeyPath:@"finished"];
[driver release]; driver = nil;
if ([self shouldScheduleUpdateCheck])
checkTimer = [NSTimer scheduledTimerWithTimeInterval:[self checkInterval] target:self selector:@selector(checkForUpdatesInBackground) userInfo:nil repeats:NO];
if (object == driver && [keyPath isEqualToString:@"finished"])
{
[driver removeObserver:self forKeyPath:@"finished"];
[driver release]; driver = nil;
[self scheduleNextUpdateCheck];
}
else if (object == [NSUserDefaultsController sharedUserDefaultsController] && ([keyPath hasSuffix:SUScheduledCheckIntervalKey] || [keyPath hasSuffix:SUEnableAutomaticChecksKey]))
{
[self updatePreferencesChanged];
}
else
{
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}
- (void)updatePreferencesChanged
{
[self scheduleNextUpdateCheck];
}
- (BOOL)shouldScheduleUpdateCheck
@@ -154,7 +177,7 @@ static SUUpdater *sharedUpdater = nil;
if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil &&
[[hostBundle objectForInfoDictionaryKey:SUEnableAutomaticChecksKey] boolValue] == YES)
return YES;
return NO; // Otherwise, don't bothe.r
return NO; // Otherwise, don't bother.
}
- (BOOL)automaticallyUpdates
@@ -179,8 +202,8 @@ static SUUpdater *sharedUpdater = nil;
{
BOOL sendingSystemProfile = ([[SUUserDefaults standardUserDefaults] boolForKey:SUSendProfileInfoKey] == YES);
NSArray *parameters = [NSArray array];
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)])
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]];
if ([delegate respondsToSelector:@selector(feedParametersForHostBundle:sendingSystemProfile:)])
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForHostBundle:hostBundle sendingSystemProfile:sendingSystemProfile]];
if (sendingSystemProfile)
parameters = [parameters arrayByAddingObjectsFromArray:[hostBundle systemProfile]];
return parameters;
+1
View File
@@ -14,6 +14,7 @@
@interface SUUserInitiatedUpdateDriver : SUUIBasedUpdateDriver {
SUStatusController *checkingController;
BOOL isCanceled;
}
@end
+29 -15
View File
@@ -17,18 +17,44 @@
checkingController = [[SUStatusController alloc] initWithHostBundle:hb];
[checkingController window]; // Force the checking controller to load its window.
[checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates\u2026", nil) maxProgressValue:0 statusText:nil];
[checkingController setButtonHidden:YES];
[checkingController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
[checkingController showWindow:self];
}
- (void)closeCheckingWindow
{
[[checkingController window] close];
[checkingController release];
if (checkingController)
{
[[checkingController window] close];
[checkingController release];
checkingController = nil;
}
}
- (void)cancelCheckForUpdates:sender
{
[self closeCheckingWindow];
isCanceled = YES;
}
- (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if (isCanceled)
{
[self abortUpdate];
return;
}
[self closeCheckingWindow];
[super appcastDidFinishLoading:ac];
}
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error
{
if (isCanceled)
{
[self abortUpdate];
return;
}
[self closeCheckingWindow];
[super appcast:ac failedToLoadWithError:error];
}
@@ -39,16 +65,4 @@
return [self hostSupportsItem:ui] && [self isItemNewer:ui];
}
- (void)didNotFindUpdate
{
[self closeCheckingWindow];
[super didNotFindUpdate];
}
- (void)didFindValidUpdate
{
[self closeCheckingWindow];
[super didFindValidUpdate];
}
@end
+1
View File
@@ -1033,6 +1033,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */;
buildSettings = {
INSTALL_PATH = "@loader_path/../Frameworks";
};
name = "Release (GC dual-mode; 10.5-only)";
};
+5 -2
View File
@@ -3,15 +3,18 @@
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>629</string>
<string>667</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>2</integer>
<integer>57</integer>
</array>
<key>IBSystem Version</key>
<string>9B18</string>
<string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>SUWindowController</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>doNotInstall</key>
<string>id</string>
<key>installLater</key>
<string>id</string>
<key>installNow</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>SUAutomaticUpdateAlert</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>SUWindowController</string>
</dict>
<dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSObject</string>
<key>LANGUAGE</key>
<string>ObjC</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>667</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>SUWindowController</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSApplication</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSResponder</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>installUpdate</key>
<string>id</string>
<key>remindMeLater</key>
<string>id</string>
<key>skipThisVersion</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>SUUpdateAlert</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>delegate</key>
<string>id</string>
<key>description</key>
<string>NSTextField</string>
<key>releaseNotesView</key>
<string>WebView</string>
</dict>
<key>SUPERCLASS</key>
<string>SUWindowController</string>
</dict>
<dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSObject</string>
<key>LANGUAGE</key>
<string>ObjC</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>667</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>SUWindowController</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>finishPrompt</key>
<string>id</string>
<key>toggleMoreInfo</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>SUUpdatePermissionPrompt</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>delegate</key>
<string>id</string>
<key>descriptionTextField</key>
<string>NSTextField</string>
<key>moreInfoButton</key>
<string>NSButton</string>
<key>moreInfoView</key>
<string>NSView</string>
</dict>
<key>SUPERCLASS</key>
<string>SUWindowController</string>
</dict>
<dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSObject</string>
<key>LANGUAGE</key>
<string>ObjC</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>667</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -3
View File
@@ -41,16 +41,16 @@
"Check for updates on startup?" = "啟動時檢查更新項目?";
/* No comment provided by engineer. */
"Downloading update..." = "正在下載更新項目⋯";
"Downloading update…" = "正在下載更新項目⋯";
/* No comment provided by engineer. */
"Extracting update..." = "正在解壓縮更新項目⋯";
"Extracting update…" = "正在解壓縮更新項目⋯";
/* No comment provided by engineer. */
"Install and Relaunch" = "安裝與重新啟動";
/* No comment provided by engineer. */
"Installing update..." = "安裝更新...";
"Installing update…" = "安裝更新…";
/* No comment provided by engineer. */
"No" = "否";