mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Fixes from Matt Stevens: "For background applications (menu bar, completely UI-less, etc) there are a couple of issues with Sparkle notifications: - When prompts such as the initial prompt to enable update checking are displayed they can be hidden behind other windows since the background app is not in focus. This can cause problems, as these prompts run modally and can stop the application from functioning without the user knowing why. - If the update notification window is displayed and the user clicks away to another application, the window disappears and there is no way to get it back since there is no other UI to cause the app to activate. In this case the update should probably operate as a standard window since it is effectively operating as the application's UI."
70 lines
1.5 KiB
Objective-C
70 lines
1.5 KiB
Objective-C
//
|
|
// SUAutomaticUpdateAlert.m
|
|
// Sparkle
|
|
//
|
|
// Created by Andy Matuschak on 3/18/06.
|
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
|
//
|
|
|
|
#import "Sparkle.h"
|
|
#import "SUAutomaticUpdateAlert.h"
|
|
|
|
@implementation SUAutomaticUpdateAlert
|
|
|
|
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:del;
|
|
{
|
|
self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"];
|
|
if (self)
|
|
{
|
|
updateItem = [item retain];
|
|
delegate = del;
|
|
host = [aHost retain];
|
|
[self setShouldCascadeWindows:NO];
|
|
[[self window] center];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)dealloc
|
|
{
|
|
[host release];
|
|
[updateItem release];
|
|
[super dealloc];
|
|
}
|
|
|
|
|
|
- (IBAction)installNow:sender
|
|
{
|
|
[self close];
|
|
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallNowChoice];
|
|
}
|
|
|
|
- (IBAction)installLater:sender
|
|
{
|
|
[self close];
|
|
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallLaterChoice];
|
|
}
|
|
|
|
- (IBAction)doNotInstall:sender
|
|
{
|
|
[self close];
|
|
[delegate automaticUpdateAlert:self finishedWithChoice:SUDoNotInstallChoice];
|
|
}
|
|
|
|
- (NSImage *)applicationIcon
|
|
{
|
|
return [host icon];
|
|
}
|
|
|
|
- (NSString *)titleText
|
|
{
|
|
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!", nil), [host name]];
|
|
}
|
|
|
|
- (NSString *)descriptionText
|
|
{
|
|
return [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", nil), [host name], [host displayVersion]];
|
|
}
|
|
|
|
@end
|