Skip to content

Commit

Permalink
Removing UI steps. Check for updates will not download, extract, and …
Browse files Browse the repository at this point in the history
…install the update.
  • Loading branch information
iloveitaly committed Feb 25, 2011
1 parent c177ec9 commit 4486edf
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions SUUIBasedUpdateDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit 4486edf

@iloveitaly
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, in the commit message I meant to say "will now" and not "will not"

Please sign in to comment.