From 4486edfb028135247d5ed76eb25bd6c9b7ef31d7 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 25 Feb 2011 14:41:33 -0500 Subject: [PATCH] Removing UI steps. Check for updates will not download, extract, and install the update. --- SUUIBasedUpdateDriver.m | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/SUUIBasedUpdateDriver.m b/SUUIBasedUpdateDriver.m index 79d509ea89..9d84e485f0 100644 --- a/SUUIBasedUpdateDriver.m +++ b/SUUIBasedUpdateDriver.m @@ -23,26 +23,8 @@ - (IBAction)cancelDownload:sender - (void)didFindValidUpdate { - updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:host]; - [updateAlert setDelegate:self]; - - if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) - [[updater delegate] updater:updater didFindValidUpdate:updateItem]; - - // If the app is a menubar app or the like, we need to focus it first and alter the - // update prompt to behave like a normal window. Otherwise if the window were hidden - // there may be no way for the application to be activated to make it visible again. - if ([host isBackgroundApplication]) - { - [[updateAlert window] setHidesOnDeactivate:NO]; - [NSApp activateIgnoringOtherApps:YES]; - } - - // Only show the update alert if the app is active; otherwise, we'll wait until it is. - if ([NSApp isActive]) - [[updateAlert window] makeKeyAndOrderFront:self]; - else - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp]; + // don't ask the user if they want to install the update, just do it + [self updateAlert:nil finishedWithChoice:SUInstallUpdateChoice]; } - (void)didNotFindUpdate @@ -138,11 +120,7 @@ - (void)installAndRestart:sender { [self installUpdate]; } - (void)unarchiverDidFinish:(SUUnarchiver *)ua { - [statusController beginActionWithTitle:SULocalizedString(@"Ready to Install", nil) maxProgressValue:1.0 statusText:nil]; - [statusController setProgressValue:1.0]; // Fill the bar. - [statusController setButtonEnabled:YES]; - [statusController setButtonTitle:SULocalizedString(@"Install and Relaunch", nil) target:self action:@selector(installAndRestart:) isDefault:YES]; - [NSApp requestUserAttention:NSInformationalRequest]; + [self installUpdate]; } - (void)installUpdate